facebookexperimental / skybison
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 9,939 units with 97,105 lines of code in units (45.5% of code).
    • 10 very complex units (2,394 lines of code)
    • 45 complex units (4,227 lines of code)
    • 314 medium complex units (15,538 lines of code)
    • 684 simple units (18,792 lines of code)
    • 8,886 very simple units (56,154 lines of code)
2% | 4% | 16% | 19% | 57%
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
cpp3% | 4% | 16% | 19% | 55%
py1% | 3% | 16% | 20% | 57%
h0% | 1% | <1% | 2% | 95%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
runtime2% | 4% | 15% | 18% | 57%
library1% | 3% | 19% | 20% | 54%
ext/Python7% | 10% | 18% | 20% | 42%
util9% | 17% | 10% | 20% | 43%
ext/Modules36% | 0% | 9% | 0% | 53%
benchmarks/benchmarks0% | 5% | 5% | 17% | 71%
ext/Objects0% | 1% | 16% | 15% | 65%
library/compiler0% | <1% | 14% | 22% | 62%
library/asyncio0% | 0% | 28% | 40% | 31%
library/distutils0% | 0% | 30% | 41% | 27%
library/json0% | 0% | 62% | 0% | 37%
library/__static__0% | 0% | 18% | 6% | 74%
ext/Internal0% | 0% | 0% | 22% | 77%
benchmarks0% | 0% | 0% | 22% | 77%
library/collections0% | 0% | 0% | 0% | 100%
library/encodings0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
capi0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
556 165 2
132 126 1
308 103 1
309 101 1
187 84 3
258 82 4
110 67 5
152 66 3
183 57 2
199 54 6
129 50 6
137 47 5
169 46 2
160 43 7
170 43 8
123 42 4
104 42 4
125 41 1
136 40 3
147 39 5
151 38 5
42 36 1
78 35 1
67 35 1
84 33 2
49 33 4
31 33 3
89 32 0
45 32 3
73 32 3
76 31 2
150 31 2
88 31 4
101 31 4
97 31 7
68 30 3
106 28 2
115 28 5
64 28 4
81 27 2
110 27 1
97 27 2
89 27 3
46 27 5
65 27 4
121 27 2
57 27 1
34 27 6
142 26 3
75 26 3