facebookincubator / ktfmt
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 240 units with 2,263 lines of code in units (20.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (38 lines of code)
    • 11 simple units (304 lines of code)
    • 228 very simple units (1,921 lines of code)
0% | 0% | 1% | 13% | 84%
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
kt0% | 0% | 2% | 18% | 79%
java0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
core/src/main/java/com/facebook/ktfmt/cli0% | 0% | 45% | 20% | 34%
core/src/main/java/com/facebook/ktfmt/format0% | 0% | 0% | 16% | 83%
core/src/main/java/com/facebook/ktfmt/debughelpers0% | 0% | 0% | 76% | 23%
core/src/main/java/com/facebook/ktfmt/kdoc0% | 0% | 0% | 14% | 85%
ktfmt_idea_plugin/src/main/java/com/facebook/ktfmt/intellij0% | 0% | 0% | 0% | 100%
website/index0% | 0% | 0% | 0% | 100%
website0% | 0% | 0% | 0% | 100%
online_formatter/src/main/kotlin0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
38 12 0
47 10 1
17 7 1
43 7 1
24 7 1
40 7 1
41 7 1
17 7 1
23 7 1
12 7 0
19 6 2
21 6 3
22 5 1
20 5 1
21 5 1
6 5 1
10 5 4
19 4 1
24 4 1
27 4 1
16 4 1
47 4 1
29 4 1
14 4 1
20 4 3
7 3 2
19 3 2
14 3 1
12 3 1
19 3 1
12 3 1
23 3 1
19 3 1
13 3 2
64 3 1
12 3 1
20 3 1
9 3 1
10 3 0
14 3 2
17 3 2
18 3 2
11 2 1
13 2 1
21 2 1
4 2 2
10 2 1
11 2 1
8 2 1
18 2 1