aws-samples / amazon-textract-code-samples
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 93 units with 951 lines of code in units (60.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (61 lines of code)
    • 13 medium size units (362 lines of code)
    • 17 small units (249 lines of code)
    • 62 very small units (279 lines of code)
0% | 6% | 38% | 26% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 6% | 38% | 23% | 31%
py0% | 0% | 32% | 59% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src-csharp0% | 100% | 0% | 0% | 0%
src-csharp/TextractExtensions0% | 0% | 66% | 3% | 30%
src-csharp/ArgHandlers0% | 0% | 40% | 33% | 26%
python0% | 0% | 32% | 59% | 8%
src-csharp/Services0% | 0% | 0% | 53% | 46%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static void Main()
in src-csharp/Program.cs
61 14 1
internal void Handle()
in src-csharp/ArgHandlers/ReadingOrderHandler.cs
34 7 2
internal void Handle()
in src-csharp/ArgHandlers/FormsRedactionHandler.cs
34 3 4
public Cell()
in src-csharp/TextractExtensions/Cell.cs
33 9 2
internal void Handle()
in src-csharp/ArgHandlers/TablesExpenseHandler.cs
32 5 2
public Page()
in src-csharp/TextractExtensions/Page.cs
31 7 2
private void ParseDocumentPagesAndBlockMap()
in src-csharp/TextractExtensions/TextractDocument.cs
27 5 0
public Table()
in src-csharp/TextractExtensions/Table.cs
27 7 2
public List GetLinesInReadingOrder()
in src-csharp/TextractExtensions/Page.cs
27 6 0
public FieldValue()
in src-csharp/TextractExtensions/FieldValue.cs
26 6 3
public Field()
in src-csharp/TextractExtensions/Field.cs
24 9 2
def indexDocument()
in python/07-search.py
23 1 3
public Line()
in src-csharp/TextractExtensions/Line.cs
22 6 2
public FieldKey()
in src-csharp/TextractExtensions/FieldKey.cs
22 5 3
internal void Handle()
in src-csharp/ArgHandlers/TablesHandler.cs
20 1 2
public void PrintDebug()
in src-csharp/Services/TextractTextAnalysisService.cs
20 4 1
public List GetJobResults()
in src-csharp/Services/TextractTextDetectionService.cs
20 2 1
def getJobResults()
in python/12-pdf-text.py
19 4 1
internal void Handle()
in src-csharp/ArgHandlers/FormsHandler.cs
18 2 2
internal void Handle()
in src-csharp/ArgHandlers/TranslateHandler.cs
15 2 2