facebook / litho
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,596 units with 84,751 lines of code in units (66.0% of code).
    • 3 very complex units (1,222 lines of code)
    • 30 complex units (3,569 lines of code)
    • 162 medium complex units (9,904 lines of code)
    • 370 simple units (10,860 lines of code)
    • 9,031 very simple units (59,196 lines of code)
1% | 4% | 11% | 12% | 69%
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
cpp14% | 18% | 15% | 6% | 44%
java<1% | 3% | 11% | 13% | 70%
kt0% | 0% | 3% | 0% | 96%
h0% | 0% | 0% | 4% | 95%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib11% | 14% | 12% | 6% | 56%
litho-core2% | 4% | 13% | 13% | 66%
litho-widget0% | 4% | 16% | 15% | 63%
litho-processor0% | 3% | 19% | 13% | 63%
litho-rendercore-text0% | 20% | 11% | 22% | 45%
litho-sections-core0% | 4% | 15% | 20% | 59%
litho-rendercore-visibility0% | 22% | 6% | 0% | 70%
litho-rendercore-incremental-mount0% | 17% | 7% | 18% | 56%
litho-editor-flipper0% | 8% | 6% | 13% | 71%
litho-testing0% | <1% | 2% | 3% | 92%
litho-rendercore0% | 0% | 13% | 17% | 69%
litho-rendercore-transitions0% | 0% | 6% | 23% | 70%
litho-intellij-plugin0% | 0% | 5% | 14% | 80%
litho-widget-kotlin0% | 0% | 19% | 0% | 80%
litho-rendercore-yoga0% | 0% | 16% | 24% | 59%
litho-sections-widget0% | 0% | 2% | 12% | 84%
litho-editor-core0% | 0% | 3% | 9% | 86%
litho-widget-material0% | 0% | 0% | 27% | 72%
litho-rendercore-testing0% | 0% | 0% | 9% | 90%
litho-fresco0% | 0% | 0% | 28% | 71%
litho-it0% | 0% | 0% | 1% | 98%
litho-sections-debug0% | 0% | 0% | 33% | 66%
codelabs0% | 0% | 0% | 0% | 100%
litho-core-kotlin0% | 0% | 0% | 0% | 100%
litho-sections-processor0% | 0% | 0% | 0% | 100%
litho-espresso0% | 0% | 0% | 0% | 100%
website0% | 0% | 0% | 0% | 100%
litho-coroutines-kotlin0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
736 141 15
313 65 7
173 55 3
141 50 1
50 47 1
173 43 14
157 41 3
142 41 2
82 39 2
155 38 5
234 38 15
43 37 1
109 36 1
109 36 28
158 35 4
175 35 17
80 34 2
112 34 2
176 34 11
76 33 4
121 32 11
149 32 37
156 31 4
100 31 2
176 31 14
113 28 1
104 28 4
83 27 3
70 27 6
117 26 5
70 26 7
69 26 6
69 26 6
91 25 1
169 24 6
30 24 1
45 24 4
75 24 1
140 24 10
90 24 4
112 24 6
31 23 3
61 23 6
62 23 6
62 23 6
74 23 2
90 23 3
78 23 2
69 23 1
72 23 20