facebookresearch / access
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 164 units with 1,234 lines of code in units (81.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (143 lines of code)
    • 3 simple units (112 lines of code)
    • 159 very simple units (979 lines of code)
0% | 0% | 11% | 9% | 79%
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% | 11% | 9% | 79%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
access/fairseq0% | 0% | 34% | 32% | 32%
access/resources0% | 0% | 14% | 0% | 85%
access/utils0% | 0% | 0% | 5% | 94%
access0% | 0% | 0% | 0% | 100%
access/evaluation0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def fairseq_train()
in access/fairseq/base.py
105 15 8
def prepare_turkcorpus()
in access/resources/prepare.py
38 12 0
def _fairseq_generate()
in access/fairseq/base.py
70 8 12
def find_best_parametrization()
in access/fairseq/main.py
31 6 4
def yield_lines_in_parallel()
in access/utils/helpers.py
11 6 4
def merge_files()
in access/preprocess.py
9 5 3
25 5 3
def extract()
in access/resources/utils.py
27 5 2
def prepare_turkcorpus_lower()
in access/resources/prepare.py
25 5 0
def log_stdout()
in access/utils/helpers.py
22 5 2
def get_lexical_complexity_score()
in access/feature_extraction.py
6 5 1
def get_dependency_tree_depth()
in access/feature_extraction.py
9 5 1
def word_dropout()
in access/preprocess.py
6 4 2
def move_with_overwrite()
in access/resources/utils.py
6 4 2
def prepare_wikilarge()
in access/resources/prepare.py
16 4 0
def get_fairseq_simplifier()
in access/simplifiers.py
13 4 3
def yield_lines()
in access/utils/helpers.py
9 4 2
def __exit__()
in access/utils/helpers.py
9 4 4
def get_word2rank()
in access/feature_extraction.py
11 4 1
def store_args()
in access/preprocessors.py
8 4 1