microsoft / tolerant-php-parser
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 367 units with 4,638 lines of code in units (56.7% of code).
    • 2 very complex units (211 lines of code)
    • 5 complex units (327 lines of code)
    • 18 medium complex units (642 lines of code)
    • 30 simple units (686 lines of code)
    • 312 very simple units (2,772 lines of code)
4% | 7% | 13% | 14% | 59%
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
php4% | 7% | 13% | 14% | 59%
ts0% | 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
experiments22% | 0% | 21% | 6% | 49%
src1% | 9% | 13% | 14% | 61%
src/Node0% | 0% | 20% | 5% | 74%
src/Node/Statement0% | 0% | 0% | 76% | 23%
php-langspec/tools/xreference0% | 0% | 0% | 64% | 35%
tools0% | 0% | 0% | 100% | 0%
syntax-visualizer/server/src0% | 0% | 0% | 0% | 100%
syntax-visualizer/client/src0% | 0% | 0% | 0% | 100%
src/Node/Expression0% | 0% | 0% | 0% | 100%
syntax-visualizer/client0% | 0% | 0% | 0% | 100%
syntax-visualizer/example0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private function scan()
in experiments/Lexer.php
140 64 0
71 59 0
69 41 1
87 38 0
78 32 2
37 31 1
56 26 1
51 25 2
99 25 4
49 24 3
public function getResolvedName()
in src/Node/QualifiedName.php
41 20 1
37 19 1
37 16 1
55 15 0
26 15 2
25 14 1
42 13 3
18 13 1
18 13 1
26 12 0