microsoft / pxt-calliope
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 736 units with 7,236 lines of code in units (63.4% of code).
    • 0 very complex units (0 lines of code)
    • 14 complex units (631 lines of code)
    • 23 medium complex units (873 lines of code)
    • 50 simple units (1,336 lines of code)
    • 649 very simple units (4,396 lines of code)
0% | 8% | 12% | 18% | 60%
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
ts0% | 11% | 8% | 14% | 64%
js0% | 10% | 19% | 29% | 40%
cpp0% | 0% | 6% | 13% | 80%
cs0% | 0% | 12% | 5% | 82%
tsx0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
libs/core0% | 18% | 6% | 17% | 56%
editor/prepend0% | 10% | 19% | 30% | 39%
editor0% | 0% | 15% | 21% | 63%
sim/visuals0% | 0% | 15% | 7% | 76%
clients/winuploader0% | 0% | 12% | 5% | 82%
sim/state0% | 0% | 6% | 7% | 86%
sim0% | 0% | 0% | 14% | 85%
libs/bluetooth0% | 0% | 0% | 0% | 100%
libs/lang-test10% | 0% | 0% | 0% | 100%
libs/radio0% | 0% | 0% | 0% | 100%
pxtwapp/pxtwapp0% | 0% | 0% | 0% | 100%
libs/devices0% | 0% | 0% | 0% | 100%
fieldeditors0% | 0% | 0% | 0% | 100%
clients/macuploader0% | 0% | 0% | 0% | 100%
libs/cpp-test0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function iconImage()
in libs/core/icons.ts
299 49 1
public ifOnEdgeBounce()
in libs/core/game.ts
44 33 0
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function step()
in editor/prepend/dapjs.js
22 30 1
function playNextNote()
in libs/core/music.ts
46 30 1
private instantaneousPosture()
in sim/state/accelerometer.ts
49 24 0
89 21 2
export function getMelody()
in libs/core/melodies.ts
46 21 1
47 20 3
private updatePin()
in sim/visuals/microbit.ts
30 20 2
void handleFile()
in clients/winuploader/Microbit.Uploader/MainForm.cs
59 18 1