facebookresearch / CodeGen
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 3,981 units with 67,644 lines of code in units (71.7% of code).
    • 3 very complex units (732 lines of code)
    • 19 complex units (2,139 lines of code)
    • 97 medium complex units (3,651 lines of code)
    • 530 simple units (10,298 lines of code)
    • 3,332 very simple units (50,824 lines of code)
1% | 3% | 5% | 15% | 75%
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
py4% | 12% | 15% | 23% | 45%
cpp0% | 0% | 2% | 15% | 81%
java0% | 0% | 1% | 10% | 88%
perl0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
codegen_sources/model/src8% | 15% | 27% | 17% | 30%
CodeXGLUE/Code-Text/code-to-text38% | 0% | 7% | 29% | 24%
CodeXGLUE/Text-Code/text-to-code0% | 39% | 24% | 12% | 23%
CodeXGLUE/Text-Code/NL-code-search-Adv0% | 56% | 9% | 16% | 17%
CodeXGLUE/Code-Code/Clone-detection-BigCloneBench0% | 52% | 0% | 24% | 23%
codegen_sources/preprocessing/obfuscation0% | 30% | 25% | 14% | 30%
codegen_sources/preprocessing/lang_processors0% | 27% | 30% | 14% | 26%
codegen_sources/model0% | 11% | 0% | 0% | 88%
data/transcoder_evaluation_gfg/cpp0% | 0% | 2% | 15% | 81%
data/transcoder_evaluation_gfg/python0% | 0% | 7% | 35% | 57%
data/transcoder_evaluation_gfg/java0% | 0% | 1% | 10% | 88%
codegen_sources/preprocessing/dataset_modes0% | 0% | 18% | 27% | 53%
codegen_sources/preprocessing0% | 0% | 19% | 4% | 75%
codegen_sources/wrappers0% | 0% | 0% | 12% | 87%
codegen_sources/preprocessing/bpe_modes0% | 0% | 0% | 0% | 100%
codegen_sources/model/tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def check_data_params()
in codegen_sources/model/src/data/loader.py
281 135 1
def main()
in CodeXGLUE/Code-Text/code-to-text/code/run.py
301 76 0
def __init__()
in codegen_sources/model/src/trainer.py
150 54 4
def train()
in CodeXGLUE/Text-Code/text-to-code/code/run.py
144 49 6
def obfuscate()
in codegen_sources/preprocessing/obfuscation/javalang_obfuscator.py
114 45 1
def run_all_evals()
in codegen_sources/model/src/evaluation/evaluator.py
123 41 2
def train()
in CodeXGLUE/Code-Code/Clone-detection-BigCloneBench/code/run.py
110 40 5
def train()
in CodeXGLUE/Text-Code/NL-code-search-Adv/code/run.py
111 37 4
def main()
in CodeXGLUE/Text-Code/NL-code-search-Adv/code/run.py
169 32 0
def load_mono_data()
in codegen_sources/model/src/data/loader.py
66 32 2
def extract_functions()
in codegen_sources/preprocessing/lang_processors/cpp_processor.py
121 32 2
def main()
in CodeXGLUE/Code-Code/Clone-detection-BigCloneBench/code/run.py
167 30 0
def evaluate_classif()
in codegen_sources/model/src/evaluation/evaluator.py
88 29 5
def main()
in CodeXGLUE/Text-Code/text-to-code/code/run.py
172 28 0
def main()
in codegen_sources/model/train.py
101 28 1
def check_model_params()
in codegen_sources/model/src/model/__init__.py
87 28 1
def st_step()
in codegen_sources/model/src/trainer.py
139 28 5
def getMangledName()
in codegen_sources/preprocessing/obfuscation/bobskater_obfuscator.py
96 28 4
def build_model()
in codegen_sources/model/src/model/__init__.py
69 27 3
def convert_filled_arguments()
in codegen_sources/model/src/evaluation/comp_acc_computation.py
83 27 5