facebookresearch / esm
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 122 units with 1,350 lines of code in units (64.5% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (63 lines of code)
    • 5 medium complex units (296 lines of code)
    • 3 simple units (84 lines of code)
    • 113 very simple units (907 lines of code)
0% | 4% | 21% | 6% | 67%
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% | 4% | 21% | 6% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
esm0% | 5% | 14% | 7% | 71%
variant-prediction0% | 0% | 47% | 0% | 52%
ROOT0% | 0% | 57% | 0% | 42%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
63 26 2
def main()
in extract.py
56 20 1
def forward()
in esm/model.py
58 19 5
def tokenize()
in esm/data.py
47 19 3
def forward()
in esm/model.py
56 14 5
def main()
in variant-prediction/predict.py
79 11 1
def upgrade_state_dict_named()
in esm/multihead_attention.py
22 7 3
def __call__()
in esm/data.py
31 7 3
def __call__()
in esm/data.py
31 7 3
def reset_parameters()
in esm/multihead_attention.py
16 5 1
def from_file()
in esm/data.py
28 5 2
21 5 3
25 4 2
def parse()
in esm/data.py
6 4 1
def _check_exists()
in esm/data.py
6 4 1
def read_msa()
in variant-prediction/predict.py
7 3 2
def with_incremental_state()
in esm/multihead_attention.py
5 3 1
def load_hub_workaround()
in esm/pretrained.py
12 3 1
def __init__()
in esm/model.py
54 3 3
4 3 2