awslabs / document-understanding-solution
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 384 units with 5,998 lines of code in units (42.8% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (570 lines of code)
    • 16 medium complex units (1,036 lines of code)
    • 33 simple units (913 lines of code)
    • 332 very simple units (3,479 lines of code)
0% | 9% | 17% | 15% | 58%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
js0% | 13% | 19% | 9% | 58%
py0% | 4% | 14% | 23% | 57%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/app/pages0% | 38% | 14% | 3% | 44%
source/lambda/apiprocessor0% | 18% | 19% | 8% | 53%
source/app/components0% | 0% | 24% | 16% | 59%
source/lambda/helper0% | 0% | 24% | 17% | 57%
source/app/utils0% | 0% | 22% | 5% | 72%
source/lambda/textractor0% | 0% | 10% | 22% | 66%
source/lambda/documentprocessor0% | 0% | 46% | 38% | 15%
source/lambda/jobresultprocessor0% | 0% | 0% | 70% | 29%
source/lambda/documentbulkprocessor0% | 0% | 0% | 65% | 34%
source/lambda/kendraIndexPoller0% | 0% | 0% | 84% | 15%
source/lambda/syncprocessor0% | 0% | 0% | 32% | 67%
source/app/store0% | 0% | 0% | 0% | 100%
deployment/document-understanding-cicd0% | 0% | 0% | 0% | 100%
source/lambda/asyncprocessor0% | 0% | 0% | 0% | 100%
source/lambda/customResourceKendraIndex0% | 0% | 0% | 0% | 100%
source/lambda/customResourceKendraDataSource0% | 0% | 0% | 0% | 100%
deployment/logger0% | 0% | 0% | 0% | 100%
source/lambda/joberrorhandler0% | 0% | 0% | 0% | 100%
source/lib0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in source/lambda/apiprocessor/lambda_function.py
110 41 2
function Document()
in source/app/pages/documents/view.js
309 32 7
function Documents()
in source/app/pages/documents/index.js
151 31 18
def processComprehend()
in source/lambda/helper/python/comprehendHelper.py
73 21 5
def search()
in source/lambda/apiprocessor/search.py
82 20 1
def indexDocument()
in source/lambda/helper/python/kendraHelper.py
63 19 8
export default function KendraResults()
in source/app/components/KendraResults/KendraResults.js
75 17 15
export default function KeyValueList()
in source/app/components/KeyValueList/KeyValueList.js
104 15 11
def processRecord()
in source/lambda/documentprocessor/lambda_function.py
25 13 4
def extractTextByPages()
in source/lambda/helper/python/comprehendHelper.py
21 13 4
export default function EntitiesCheckbox()
in source/app/components/EntitiesCheckbox/EntitiesCheckbox.js
76 12 13
def indexDocument()
in source/lambda/textractor/python/og.py
64 12 3
export function getPageWordsBySearch()
in source/app/utils/document.js
80 11 3
function FileUpload()
in source/app/components/FileUpload/FileUpload.js
102 11 1
export default function Button()
in source/app/components/Button/Button.js
47 11 9
export default function Login()
in source/app/pages/index.js
118 11 0
function Page()
in source/app/pages/_app.js
55 11 3
def lambda_handler()
in source/lambda/documentprocessor/lambda_function.py
18 11 2
def processLine()
in source/lambda/apiprocessor/redact.py
33 11 2
or setModal()
in source/app/components/FileUpload/FileUpload.js
47 10 1