facebook / buck
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 26,034 units with 265,142 lines of code in units (67.9% of code).
    • 9 very complex units (3,773 lines of code)
    • 48 complex units (5,774 lines of code)
    • 339 medium complex units (22,908 lines of code)
    • 992 simple units (37,426 lines of code)
    • 24,646 very simple units (195,261 lines of code)
1% | 2% | 8% | 14% | 73%
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
java<1% | 2% | 8% | 14% | 74%
c51% | 12% | 13% | 9% | 12%
py1% | 1% | 16% | 17% | 63%
kt0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
android/com40% | 10% | 10% | 10% | 28%
src/com<1% | 1% | 7% | 13% | 77%
src-gen/com1% | 8% | 15% | 17% | 57%
scripts4% | 0% | 20% | 18% | 56%
tools/ideabuck0% | 1% | 5% | 21% | 71%
programs0% | 6% | 12% | 26% | 55%
tools/psi-grammar0% | 9% | 3% | 2% | 84%
python-dsl/buck_parser0% | 0% | 16% | 20% | 63%
tools/consistency_checker0% | 0% | 16% | 34% | 48%
scripts/artificialproject0% | 0% | 27% | 5% | 66%
tools/release0% | 0% | 18% | 2% | 79%
scripts/apple0% | 0% | 100% | 0% | 0%
tools/dxanalysis0% | 0% | 12% | 32% | 55%
programs/fixes0% | 0% | 0% | 18% | 81%
scripts/migrations0% | 0% | 0% | 13% | 86%
tools/datascience0% | 0% | 0% | 0% | 100%
tools/build0% | 0% | 0% | 0% | 100%
android/android0% | 0% | 0% | 0% | 100%
py/hash0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
1802 473 3
119 101 1
635 94 14
103 87 1
103 87 1
83 73 0
79 66 1
752 61 3
97 60 0
133 48 2
355 47 15
496 46 4
147 45 2
271 45 1
147 44 1
99 40 7
115 39 2
110 38 1
47 38 1
127 38 1
127 38 1
96 37 2
48 34 6
72 33 2
112 33 0
150 32 2
90 32 1
39 31 1
39 31 1
39 31 1
39 31 1
39 31 1
39 31 1
39 31 1
113 31 2
115 30 1
46 30 0
95 30 2
166 30 1
110 29 3
97 29 1
102 29 2
109 29 2
137 29 2
199 29 1
86 29 1
134 28 2
158 28 8
90 27 2
198 27 11