microsoft / pxt-blockly
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 3,562 units with 42,476 lines of code in units (40.3% of code).
    • 2 very complex units (213 lines of code)
    • 8 complex units (808 lines of code)
    • 114 medium complex units (5,540 lines of code)
    • 367 simple units (9,610 lines of code)
    • 3,071 very simple units (26,305 lines of code)
<1% | 1% | 13% | 22% | 61%
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
js<1% | 1% | 12% | 22% | 62%
py0% | 0% | 30% | 16% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
core<1% | 1% | 8% | 23% | 66%
generators0% | 5% | 32% | 19% | 42%
blocks0% | 0% | 17% | 24% | 58%
scripts0% | 0% | 14% | 18% | 67%
closure0% | 0% | 0% | 17% | 82%
externs0% | 0% | 0% | 0% | 100%
appengine0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
113 58 2
100 53 2
107 39 2
Blockly.PHP[''] = function()
in generators/php/lists.js
113 37 1
Blockly.Dart[''] = function()
in generators/dart/lists.js
136 36 1
56 29 0
109 29 2
Blockly.Dart[''] = function()
in generators/dart/math.js
81 28 1
121 26 1
Blockly.PHP[''] = function()
in generators/php/lists.js
85 26 1
55 25 3
Blockly.JavaScript[''] = function()
in generators/javascript/lists.js
75 25 1
Blockly.JavaScript[''] = function()
in generators/javascript/math.js
76 25 1
Blockly.PHP[''] = function()
in generators/php/math.js
76 25 1
61 24 3
74 24 1
Blockly.JavaScript[''] = function()
in generators/javascript/text.js
68 24 1
Blockly.Lua[''] = function()
in generators/lua/lists.js
61 24 1
Blockly.Python[''] = function()
in generators/python/lists.js
75 24 1
Blockly.Python[''] = function()
in generators/python/math.js
73 24 1