aws-samples / amazon-textract-code-samples
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 93 units with 951 lines of code in units (60.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (61 lines of code)
    • 8 simple units (224 lines of code)
    • 84 very simple units (666 lines of code)
0% | 0% | 6% | 23% | 70%
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
cs0% | 0% | 6% | 25% | 67%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src-csharp0% | 0% | 100% | 0% | 0%
src-csharp/TextractExtensions0% | 0% | 0% | 52% | 47%
src-csharp/ArgHandlers0% | 0% | 0% | 13% | 86%
src-csharp/Services0% | 0% | 0% | 0% | 100%
python0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static void Main()
in src-csharp/Program.cs
61 14 1
public Cell()
in src-csharp/TextractExtensions/Cell.cs
33 9 2
public Field()
in src-csharp/TextractExtensions/Field.cs
24 9 2
public Table()
in src-csharp/TextractExtensions/Table.cs
27 7 2
public Page()
in src-csharp/TextractExtensions/Page.cs
31 7 2
internal void Handle()
in src-csharp/ArgHandlers/ReadingOrderHandler.cs
34 7 2
public FieldValue()
in src-csharp/TextractExtensions/FieldValue.cs
26 6 3
public Line()
in src-csharp/TextractExtensions/Line.cs
22 6 2
public List GetLinesInReadingOrder()
in src-csharp/TextractExtensions/Page.cs
27 6 0
private void ParseDocumentPagesAndBlockMap()
in src-csharp/TextractExtensions/TextractDocument.cs
27 5 0
public Word()
in src-csharp/TextractExtensions/Word.cs
8 5 2
public FieldKey()
in src-csharp/TextractExtensions/FieldKey.cs
22 5 3
internal void Handle()
in src-csharp/ArgHandlers/TablesExpenseHandler.cs
32 5 2
def getJobResults()
in python/12-pdf-text.py
19 4 1
public void PrintDebug()
in src-csharp/Services/TextractTextAnalysisService.cs
20 4 1
internal void Handle()
in src-csharp/ArgHandlers/FormsRedactionHandler.cs
34 3 4
public void Print()
in src-csharp/Services/TextractTextDetectionService.cs
5 3 1
def isFloat()
in python/11-tables-expense.py
6 2 1
def isJobComplete()
in python/12-pdf-text.py
12 2 1
internal void Handle()
in src-csharp/ArgHandlers/FormsHandler.cs
18 2 2