microsoft / SpeciesClassification
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 265 units with 4,491 lines of code in units (77.4% of code).
    • 1 very complex units (279 lines of code)
    • 4 complex units (334 lines of code)
    • 15 medium complex units (959 lines of code)
    • 38 simple units (1,110 lines of code)
    • 207 very simple units (1,809 lines of code)
6% | 7% | 21% | 24% | 40%
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
py6% | 7% | 21% | 24% | 39%
pyx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
PyTorchClassification14% | 10% | 19% | 31% | 23%
misc0% | 47% | 30% | 0% | 22%
FasterRCNNDetection0% | 0% | 63% | 5% | 31%
FasterRCNNDetection/data0% | 0% | 25% | 23% | 51%
FasterRCNNDetection/utils0% | 0% | 40% | 8% | 51%
FasterRCNNDetection/model0% | 0% | 0% | 16% | 83%
PyTorchClassification/pretrained0% | 0% | 0% | 39% | 60%
FasterRCNNDetection/misc0% | 0% | 0% | 73% | 26%
PyTorchClassification/snakes0% | 0% | 0% | 80% | 19%
DetectionClassificationAPI0% | 0% | 0% | 45% | 55%
ROOT0% | 0% | 0% | 45% | 54%
PyTorchClassification/imagenet-nonanimal-test0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in PyTorchClassification/train.py
279 58 0
def __init__()
in PyTorchClassification/data_loader.py
119 44 11
def __init__()
in PyTorchClassification/data_loader_cv.py
85 39 10
def add_new_categories()
in misc/convert_folders_to_coco_format.py
65 30 5
def add_new_categories()
in misc/make_species_extended.py
65 30 5
def merge()
in misc/merge_iNat_and_animals_extension.py
47 25 5
def __init__()
in FasterRCNNDetection/data/vott_dataset.py
43 23 3
def init()
in PyTorchClassification/models.py
103 23 5
def calc_detection_voc_prec_rec()
in FasterRCNNDetection/utils/eval_tool.py
79 21 7
def vis_bbox()
in FasterRCNNDetection/utils/vis_tool.py
31 21 6
def __init__()
in FasterRCNNDetection/data/coco_camera_traps_dataset.py
42 20 4
def train()
in FasterRCNNDetection/train.py
108 20 1
def __init__()
in FasterRCNNDetection/data/iwildcam_dataset.py
42 15 4
def eval()
in FasterRCNNDetection/train.py
60 15 6
def main()
in misc/add_new_images_to_json.py
38 15 0
def load_model()
in PyTorchClassification/data_loader.py
42 13 2
def load_model()
in PyTorchClassification/data_loader_cv.py
42 13 2
def forward()
in FasterRCNNDetection/trainer.py
93 12 5
def train()
in PyTorchClassification/train.py
72 12 6
def main()
in PyTorchClassification/run_training.py
117 11 0