amazon-research / panrep
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 368 units with 18,303 lines of code in units (96.9% of code).
    • 21 very complex units (7,473 lines of code)
    • 15 complex units (2,367 lines of code)
    • 57 medium complex units (4,384 lines of code)
    • 41 simple units (1,320 lines of code)
    • 234 very simple units (2,759 lines of code)
40% | 12% | 23% | 7% | 15%
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
py40% | 12% | 23% | 7% | 15%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
panrep41% | 11% | 25% | 6% | 14%
data_handler/imdb27% | 36% | 2% | 11% | 21%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
393 72 0
393 72 0
389 71 0
390 71 0
390 71 0
390 71 0
def finetuneimdb_infomax()
in panrep/plot_data.py
390 71 0
391 71 0
392 71 0
def finetunedblp_all_signals()
in panrep/plot_data.py
391 71 0
def finetunedblp_small()
in panrep/plot_data.py
386 71 0
def finetunedblp_med()
in panrep/plot_data.py
386 71 0
350 64 0
def finetuneimdb_small_no_init()
in panrep/plot_data.py
353 64 0
352 64 0
def finetuneimdb_tune_ssl_univ()
in panrep/plot_data.py
343 63 0
341 63 0
def evaluation_link_prediction()
in panrep/evaluation.py
351 59 9
344 57 10
def read_subset_imdb2dic()
in data_handler/imdb/imdb_data_loader.py
179 53 2