facebookresearch / muss
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 333 units with 2,642 lines of code in units (69.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (68 lines of code)
    • 10 simple units (196 lines of code)
    • 321 very simple units (2,378 lines of code)
0% | 0% | 2% | 7% | 90%
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% | 2% | 7% | 90%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
muss/utils0% | 0% | 8% | 10% | 81%
muss/resources0% | 0% | 11% | 15% | 73%
muss/mining0% | 0% | 0% | 9% | 90%
muss/fairseq0% | 0% | 0% | 12% | 87%
muss0% | 0% | 0% | 0% | 100%
muss/evaluation0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def mix_datasets()
in muss/resources/datasets.py
22 12 3
def run_command()
in muss/utils/helpers.py
46 11 2
def get_sentences_from_ids()
in muss/mining/nn_search.py
28 10 2
def redirect_streams()
in muss/utils/helpers.py
22 9 2
def get_nearest_sentence_ids()
in muss/mining/nn_search.py
23 9 6
31 6 3
14 6 3
22 6 3
def yield_lines_in_parallel()
in muss/utils/helpers.py
11 6 4
def yield_lines()
in muss/utils/helpers.py
10 6 3
def print_args()
in muss/utils/training.py
16 6 2
def split_ccnet_shard()
in muss/mining/preprocessing.py
19 6 3
def mix_files()
in muss/resources/datasets.py
16 5 3
def get_downstream_preprocessed_datasets()
in muss/resources/datasets.py
9 5 1
def fairseq_preprocess()
in muss/fairseq/base.py
26 5 4
def download()
in muss/utils/resources.py
14 5 3
def extract()
in muss/utils/resources.py
28 5 2
def get_hashable_object()
in muss/utils/helpers.py
14 5 1
def get_dependency_tree_depth()
in muss/feature_extraction.py
11 5 2
def is_overlapping()
in muss/mining/filtering.py
16 5 2