aws-samples / amazon-comprehend-examples
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 29 units with 372 lines of code in units (39.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (92 lines of code)
    • 3 medium size units (83 lines of code)
    • 3 small units (47 lines of code)
    • 22 very small units (150 lines of code)
0% | 24% | 22% | 12% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 24% | 22% | 12% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
amazon_comprehend_events_tutorial/notebooks0% | 65% | 17% | 0% | 17%
comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer0% | 0% | 29% | 14% | 56%
comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier0% | 0% | 21% | 26% | 52%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_nodes_and_edges()
in amazon_comprehend_events_tutorial/notebooks/events_graph.py
92 38 6
def convert_to_dataset_annotations()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_to_comprehend_format_converter.py
34 7 3
def convert_to_multilabel_dataset()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
25 10 4
def build_network_graph()
in amazon_comprehend_events_tutorial/notebooks/events_graph.py
24 8 3
def convert_to_multiclass_dataset()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
17 5 3
def validate_s3_input()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_format_conversion_handler.py
16 5 2
def main()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py
14 3 0
def get_labeling_job_name()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_to_comprehend_format_converter.py
10 7 3
def _check_for_overlapping_annotations()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_to_comprehend_format_converter.py
10 3 2
def get_canonical_mention()
in amazon_comprehend_events_tutorial/notebooks/events_graph.py
9 4 2
def plot()
in amazon_comprehend_events_tutorial/notebooks/events_graph.py
9 1 4
def get_labeling_job_name()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
9 4 3
def read_write_dataset_annotations()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_format_conversion_handler.py
9 2 3
def _check_document_size()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
8 2 4
def validate_s3_input()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py
8 3 2
def read_write_multiclass_dataset()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py
8 2 1
def read_write_multilabel_dataset()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py
8 2 2
def main()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_format_conversion_handler.py
8 1 0
def _parse_manifest_input()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
7 3 3
def parse_manifest_input()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_to_comprehend_format_converter.py
7 2 2