facebook / fbghc
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 1,039 units with 14,286 lines of code in units (3.0% of code).
    • 3 very complex units (1,128 lines of code)
    • 6 complex units (633 lines of code)
    • 33 medium complex units (1,754 lines of code)
    • 95 simple units (3,190 lines of code)
    • 902 very simple units (7,581 lines of code)
7% | 4% | 12% | 22% | 53%
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
c9% | 4% | 11% | 24% | 50%
py0% | 7% | 25% | 20% | 47%
pl0% | 0% | 0% | 63% | 36%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
rts10% | 3% | 9% | 23% | 53%
utils0% | 26% | 41% | 14% | 18%
testsuite0% | 7% | 25% | 20% | 46%
driver0% | 0% | 0% | 35% | 64%
distrib0% | 0% | 0% | 63% | 36%
libraries0% | 0% | 0% | 4% | 95%
includes0% | 0% | 0% | 0% | 100%
compiler0% | 0% | 0% | 0% | 100%
ghc0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
713 132 2
287 65 1
128 52 2
104 46 1
226 42 4
70 33 5
97 30 2
64 28 8
72 27 1
64 24 2
80 21 6
41 21 4
57 20 2
55 19 5
56 19 7
59 18 1
35 18 5
56 18 3
79 17 3
72 17 1
41 17 1
62 16 1
28 16 2
86 16 2
20 16 2
47 15 4
38 15 6
82 14 2
35 13 1
70 13 4
63 13 4
50 12 4
48 12 1
47 12 1
54 12 1
66 11 3
55 11 4
53 11 1
18 11 2
67 11 1
37 11 2
33 11 1
48 10 2
58 10 3
41 10 1
71 10 1
42 10 1
18 10 5
18 10 0
48 9 5