amazon-research / unified-ept
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 205 units with 2,308 lines of code in units (50.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (305 lines of code)
    • 20 simple units (480 lines of code)
    • 179 very simple units (1,523 lines of code)
0% | 0% | 13% | 20% | 65%
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% | 0% | 13% | 20% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 66% | 0% | 33%
modified_mmseg/datasets0% | 0% | 22% | 34% | 42%
modified_mmseg/apis0% | 0% | 89% | 0% | 10%
models0% | 0% | 2% | 18% | 79%
modified_mmseg/datasets/pipelines0% | 0% | 0% | 26% | 73%
models/ops/modules0% | 0% | 0% | 0% | 100%
models/ops/functions0% | 0% | 0% | 0% | 100%
modified_mmseg0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in test.py
60 20 0
def main()
in train.py
68 19 0
def evaluate()
in modified_mmseg/datasets/custom.py
61 15 6
def _concat_dataset()
in modified_mmseg/datasets/builder.py
31 14 2
def forward_test()
in models/base.py
20 13 4
def train_segmentor()
in modified_mmseg/apis/train.py
65 11 7
def __init__()
in modified_mmseg/datasets/custom.py
40 10 14
def get_classes_and_palette()
in modified_mmseg/datasets/custom.py
22 10 3
def _parse_losses()
in models/base.py
19 10 1
def __init__()
in modified_mmseg/datasets/pipelines/transforms.py
20 9 5
def __call__()
in modified_mmseg/datasets/pipelines/loading.py
36 8 2
22 8 7
def to_tensor()
in modified_mmseg/datasets/pipelines/formating.py
13 7 1
def load_annotations()
in modified_mmseg/datasets/custom.py
24 7 7
def __init__()
in models/UN_EPT.py
70 7 12
def checkpoint_filter_fn()
in models/vision_transformer.py
12 7 2
def _evaluate_cityscapes()
in modified_mmseg/datasets/cityscapes.py
32 6 4
def __call__()
in modified_mmseg/datasets/pipelines/loading.py
26 6 2
def _random_scale()
in modified_mmseg/datasets/pipelines/transforms.py
19 6 2
def __call__()
in modified_mmseg/datasets/pipelines/transforms.py
13 6 2