facebookresearch / cc_net
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 305 units with 2,633 lines of code in units (69.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (40 lines of code)
    • 9 medium complex units (347 lines of code)
    • 18 simple units (368 lines of code)
    • 277 very simple units (1,878 lines of code)
0% | 1% | 13% | 13% | 71%
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% | 1% | 13% | 13% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cc_net0% | 1% | 11% | 14% | 72%
cc_net/tools0% | 0% | 33% | 9% | 57%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def describe()
in cc_net/jsonql.py
40 26 4
def mine()
in cc_net/mine.py
46 19 1
def regroup()
in cc_net/mine.py
46 14 2
def display_stats()
in cc_net/jsonql.py
34 14 5
def open_read()
in cc_net/jsonql.py
30 14 1
def do()
in cc_net/tools/expand_corpus.py
29 12 2
def do()
in cc_net/split_by_lang.py
25 12 2
def _mine_shard()
in cc_net/mine.py
75 11 4
def main()
in cc_net/mine.py
24 11 2
def _dl_shard()
in cc_net/tools/dl_cc_100.py
38 11 2
def run_par()
in cc_net/dedup.py
20 10 1
def _validate_test()
in cc_net/mine.py
45 8 3
def select()
in cc_net/jsonql.py
12 8 5
def open_remote_file()
in cc_net/jsonql.py
17 8 2
def make_corpus()
in cc_net/tools/make_dmoz_corpus.py
20 8 3
def get_lm_languages()
in cc_net/mine.py
9 7 1
def hashes()
in cc_net/mine.py
12 7 1
def request_get_content()
in cc_net/jsonql.py
22 7 2
def normalize()
in cc_net/text_normalizer.py
16 7 5
def finalize_doc()
in cc_net/dedup.py
25 7 3