facebook / relay
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 2,341 units with 39,818 lines of code in units (47.7% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (212 lines of code)
    • 47 medium complex units (4,747 lines of code)
    • 145 simple units (6,969 lines of code)
    • 2,147 very simple units (27,890 lines of code)
0% | <1% | 11% | 17% | 70%
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
js0% | 3% | 13% | 18% | 64%
rs0% | 0% | 11% | 17% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/relay-runtime0% | 4% | 15% | 17% | 62%
compiler/crates0% | 0% | 11% | 17% | 71%
website/src0% | 0% | 6% | 32% | 60%
scripts0% | 0% | 0% | 20% | 79%
ROOT0% | 0% | 0% | 30% | 69%
packages/babel-plugin-relay0% | 0% | 0% | 0% | 100%
website0% | 0% | 0% | 0% | 100%
scripts/jest0% | 0% | 0% | 0% | 100%
packages/react-relay0% | 0% | 0% | 0% | 100%
compiler/test-project0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
152 37 2
60 35 2
231 25 2
67 23 2
192 23 4
206 23 4
174 20 11
218 19 2
167 19 3
167 19 1
116 18 3
87 18 0
68 17 6
68 17 6
147 17 4
128 16 4
138 15 4
106 15 3
324 15 4
81 14 6
63 14 2
71 13 3
96 13 3
67 12 2
85 12 2
70 12 3
135 12 3
28 12 2
20 12 2
60 12 0
132 12 4
39 11 1
56 11 2
40 11 2
32 11 2
87 11 4
26 11 2
58 11 4
45 11 2
181 11 2
137 11 2
38 11 2
95 11 3
60 11 2
92 11 2
68 11 5
40 11 1
37 11 1
104 11 5
23 10 1