facebookresearch / covid19_spread
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 160 units with 2,213 lines of code in units (68.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (418 lines of code)
    • 18 simple units (745 lines of code)
    • 137 very simple units (1,050 lines of code)
0% | 0% | 18% | 33% | 47%
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% | 18% | 33% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 38% | 26% | 34%
covid19_spread/data/usa/google0% | 0% | 69% | 28% | 1%
covid19_spread/data/usa0% | 0% | 31% | 35% | 33%
covid19_spread0% | 0% | 5% | 31% | 63%
covid19_spread/lib0% | 0% | 0% | 30% | 69%
covid19_spread/data/usa/fb0% | 0% | 0% | 97% | 2%
covid19_spread/data/usa/testing0% | 0% | 0% | 97% | 2%
covid19_spread/data/usa/symptom_survey0% | 0% | 0% | 18% | 81%
covid19_spread/data0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
103 15 6
def main()
in covid19_spread/data/usa/convert.py
81 14 4
64 13 6
def main()
in covid19_spread/data/usa/google/process_open_data.py
130 12 0
def model_selection()
in covid19_spread/cross_val.py
40 11 4
def add_to_parser()
in covid19_spread/lib/click_lib.py
25 10 3
def __call__()
in covid19_spread/lib/slurm_pool_executor.py
68 10 1
def main()
in covid19_spread/data/usa/google/process_mobility.py
53 10 0
def process_time_features()
in covid19_spread/data/usa/convert.py
40 10 5
def initialize()
in covid19_spread/bar.py
80 8 2
def env_var()
in covid19_spread/lib/context_managers.py
14 8 3
def run_par()
in covid19_spread/data/usa/convert.py
15 8 4
def main()
in covid19_spread/data/usa/fb/process_mobility.py
74 8 0
41 7 5
11 7 2
61 7 5
def score()
in covid19_spread/bar.py
38 7 3
def main()
in covid19_spread/data/usa/symptom_survey/process_symptom_survey.py
23 7 2
def mk_absolute_paths()
in covid19_spread/common.py
11 6 1
def train()
in covid19_spread/bar.py
71 6 6