facebook / pyre-check
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,966 units with 12,319 lines of code in units (10.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (371 lines of code)
    • 16 medium complex units (763 lines of code)
    • 61 simple units (1,693 lines of code)
    • 1,887 very simple units (9,492 lines of code)
0% | 3% | 6% | 13% | 77%
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
py0% | 3% | 7% | 14% | 73%
c0% | 0% | 0% | 18% | 81%
pyi0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
client0% | 10% | 6% | 11% | 72%
tools/generate_taint_models0% | 16% | 6% | 16% | 59%
scripts0% | 0% | 16% | 10% | 72%
tools/upgrade0% | 0% | 9% | 22% | 68%
client/commands0% | 0% | 6% | 16% | 77%
tools/incremental_test0% | 0% | 14% | 10% | 75%
client/log0% | 0% | 20% | 11% | 67%
source/hack_parallel0% | 0% | 0% | 18% | 81%
tools/playground0% | 0% | 0% | 26% | 73%
pyre_extensions0% | 0% | 0% | 21% | 78%
client/libcst_vendored_visitors0% | 0% | 0% | 4% | 95%
api0% | 0% | 0% | 4% | 95%
stubs/django0% | 0% | 0% | 0% | 100%
stubs/mysql0% | 0% | 0% | 0% | 100%
scripts/pypi0% | 0% | 0% | 0% | 100%
stubs/integration_test0% | 0% | 0% | 0% | 100%
tools/ide_plugins0% | 0% | 0% | 0% | 100%
tools/pysa_integration_tests0% | 0% | 0% | 0% | 100%
stubs/lxml0% | 0% | 0% | 0% | 100%
stubs/rest_framework0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
223 38 1
148 32 3
82 21 2
69 18 0
73 18 1
49 15 1
36 14 1
29 13 1
32 13 2
30 13 1
65 13 2
32 13 1
31 12 1
43 12 2
45 12 1
58 12 0
46 11 3
43 11 2
66 10 1
30 10 2
27 10 2
46 10 3
44 9 1
37 9 1
38 9 1
38 9 2
22 9 1
27 9 1
101 9 2
18 9 2
18 9 1
14 9 1
36 9 1
18 9 2
26 9 2
44 9 0
19 9 1
27 9 1
41 9 1
26 8 1
17 8 2
18 8 3
16 8 3
29 8 2
30 8 2
24 8 1
28 8 1
26 8 1
20 8 2
18 7 2