aws-samples / amazon-comprehend-examples
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 29 units with 372 lines of code in units (39.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (92 lines of code)
    • 0 medium complex units (0 lines of code)
    • 4 simple units (93 lines of code)
    • 24 very simple units (187 lines of code)
0% | 24% | 0% | 25% | 50%
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
py0% | 24% | 0% | 25% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
amazon_comprehend_events_tutorial/notebooks0% | 65% | 0% | 17% | 17%
comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer0% | 0% | 0% | 38% | 61%
comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier0% | 0% | 0% | 21% | 78%
Most Complex Units
Top 20 most complex 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_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_dataset_annotations()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_to_comprehend_format_converter.py
34 7 3
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 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 get_canonical_mention()
in amazon_comprehend_events_tutorial/notebooks/events_graph.py
9 4 2
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 _parse_manifest_input()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
7 3 3
def validate_s3_input()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py
8 3 2
def main()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py
14 3 0
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_color_map()
in amazon_comprehend_events_tutorial/notebooks/events_graph.py
6 2 1
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 _check_label_size()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
5 2 4
def _get_labels()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_to_comprehend_clr_format_converter.py
2 2 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 parse_manifest_input()
in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/EntityRecognizer/groundtruth_to_comprehend_format_converter.py
7 2 2