aws-samples / workshop-textract-comprehend-es
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 8 units with 150 lines of code in units (24.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (98 lines of code)
    • 2 small units (34 lines of code)
    • 3 very small units (18 lines of code)
0% | 0% | 65% | 22% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 65% | 22% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sources/lambda/async0% | 0% | 49% | 33% | 17%
sources/lambda/sync0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 8 longest units
Unit# linesMcCabe index# params
def handler()
in sources/lambda/sync/index.py
48 8 2
def handler()
in sources/lambda/async/index.py
28 2 2
def __extract_all_pages()
in sources/lambda/async/text_extractor.py
22 6 5
def extract_entities()
in sources/lambda/async/document_analyzer.py
18 8 2
def __get_clean_text_in_supported_language()
in sources/lambda/async/document_analyzer.py
16 3 2
def index()
in sources/lambda/async/document_indexer.py
8 1 2
def extract_text()
in sources/lambda/async/text_extractor.py
5 1 2
def __get_textract_result()
in sources/lambda/async/text_extractor.py
5 1 2