facebookincubator / electron
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 5,760 units with 63,703 lines of code in units (46.5% of code).
    • 2 very complex units (297 lines of code)
    • 11 complex units (1,167 lines of code)
    • 118 medium complex units (7,959 lines of code)
    • 331 simple units (10,731 lines of code)
    • 5,298 very simple units (43,549 lines of code)
<1% | 1% | 12% | 16% | 68%
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
cc<1% | 2% | 10% | 16% | 69%
mm0% | 4% | 12% | 16% | 66%
ts0% | <1% | 9% | 20% | 69%
js0% | 0% | 26% | 13% | 59%
py0% | 0% | 32% | 16% | 50%
h0% | 0% | 0% | 6% | 93%
cpp0% | 0% | 0% | 67% | 32%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
shell/common4% | 2% | 6% | 18% | 68%
shell/browser0% | 1% | 10% | 16% | 70%
shell/renderer0% | 7% | 9% | 14% | 68%
lib/browser0% | 3% | 13% | 27% | 55%
spec0% | 0% | 45% | 0% | 54%
script0% | 0% | 32% | 24% | 43%
spec-main0% | 0% | 6% | 20% | 72%
shell/app0% | 0% | 33% | 11% | 55%
script/release0% | 0% | 19% | 18% | 62%
lib/asar0% | 0% | 28% | 24% | 46%
build0% | 0% | 36% | 0% | 63%
lib/renderer0% | 0% | 6% | 10% | 83%
script/lib0% | 0% | 0% | 35% | 64%
default_app0% | 0% | 0% | 18% | 81%
spec-main/fixtures0% | 0% | 0% | 5% | 94%
script/zip_manifests0% | 0% | 0% | 100% | 0%
spec/fixtures0% | 0% | 0% | 5% | 95%
lib/common0% | 0% | 0% | 0% | 100%
shell/utility0% | 0% | 0% | 0% | 100%
npm0% | 0% | 0% | 0% | 100%
spec/ts-smoke0% | 0% | 0% | 0% | 100%
spec/static0% | 0% | 0% | 0% | 100%
lib/sandboxed_renderer0% | 0% | 0% | 0% | 100%
build/mac0% | 0% | 0% | 0% | 100%
build/fuses0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
177 75 2
120 63 2
94 45 1
141 44 1
88 42 2
133 36 4
199 35 7
75 34 2
190 33 4
69 31 2
17 27 1
87 27 1
74 26 1
96 25 1
949 25 2
189 25 0
88 24 0
122 23 2
89 23 4
57 23 2
80 22 1
68 22 3
96 21 0
63 21 0
96 20 13
65 20 3
96 20 3
65 20 3
137 19 1
44 19 1
60 19 4
76 18 2
111 18 4
62 18 4
74 18 3
98 18 1
68 18 1
70 18 0
77 17 2
37 17 1
68 17 2
32 17 3
50 17 0
46 16 1
70 16 4
29 16 4
78 15 1
38 15 2
51 15 0
60 15 7