microsoft / pxt-adafruit
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 72 units with 1,220 lines of code in units (3.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (191 lines of code)
    • 13 simple units (405 lines of code)
    • 56 very simple units (624 lines of code)
0% | 0% | 15% | 33% | 51%
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% | 0% | 17% | 35% | 47%
cpp0% | 0% | 0% | 100% | 0%
tsx0% | 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
sim/visuals0% | 0% | 28% | 29% | 41%
fieldeditors0% | 0% | 0% | 79% | 20%
libs/light0% | 0% | 0% | 61% | 38%
libs/circuit-playground0% | 0% | 0% | 28% | 71%
sim0% | 0% | 0% | 17% | 82%
editor0% | 0% | 0% | 0% | 100%
libs/cptest0% | 0% | 0% | 0% | 100%
pxtwapp/pxtwapp0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private updateTemperature()
in sim/visuals/board.ts
71 13 0
private updateLightLevel()
in sim/visuals/board.ts
60 12 0
private updateSoundLevel()
in sim/visuals/board.ts
60 12 0
private updateNeoPixels()
in sim/visuals/board.ts
26 10 0
render_()
in fieldeditors/field_lights.ts
18 9 0
initRing()
in fieldeditors/field_lights.ts
97 8 0
receiveMessage()
in sim/dalboard.ts
18 8 1
private updatePin()
in sim/visuals/board.ts
18 8 2
export function defaultStrip()
in libs/light/defaultstrip.ts
27 7 0
constructor()
in sim/visuals/board.ts
14 7 1
private buildDom()
in sim/visuals/board.ts
74 7 0
onPixelClicked()
in fieldeditors/field_lights.ts
14 6 3
static void showCode()
in libs/circuit-playground/panic.cpp
20 6 1
export function onboardStrip()
in libs/light/onboardstrip.ts
17 6 0
public updateState()
in sim/visuals/board.ts
23 6 0
private addButtonEvents()
in sim/visuals/pincontrol.ts
39 6 0
56 5 3
onColorClicked()
in fieldeditors/field_lights.ts
7 5 2
function switchMode()
in libs/cptest/main.ts
10 5 0
export function ambientColor()
in libs/circuit-playground/input.ts
47 4 0