microsoft / pxt-arcade
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 479 units with 5,133 lines of code in units (52.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (125 lines of code)
    • 8 medium complex units (606 lines of code)
    • 28 simple units (648 lines of code)
    • 441 very simple units (3,754 lines of code)
0% | 2% | 11% | 12% | 73%
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
cpp0% | 17% | 10% | 20% | 51%
ts0% | 1% | 6% | 11% | 80%
tsx0% | 0% | 24% | 14% | 61%
js0% | 0% | 25% | 0% | 74%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
libs/hw---vm0% | 30% | 18% | 7% | 42%
share/src0% | 1% | 9% | 13% | 75%
editor0% | 0% | 66% | 0% | 33%
libs/template0% | 0% | 33% | 0% | 66%
libs/hw---rpi0% | 0% | 0% | 41% | 58%
libs/sevenseg0% | 0% | 0% | 8% | 91%
libs/corgio0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
libs/darts0% | 0% | 0% | 0% | 100%
libs/screen---st77350% | 0% | 0% | 0% | 100%
libs/storage0% | 0% | 0% | 0% | 100%
libs/game0% | 0% | 0% | 0% | 100%
libs/screen---ext0% | 0% | 0% | 0% | 100%
libs/screen---linux0% | 0% | 0% | 0% | 100%
libs/screen0% | 0% | 0% | 0% | 100%
libs/device0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function imageLiteralToBitmap()
in share/src/sprite-editor/bitmap.ts
52 45 2
void handle_touch_events()
in libs/hw---vm/sdlmain.cpp
73 28 1
function patchBlocks()
in editor/extension.ts
111 25 2
int mapKeyCode()
in libs/hw---vm/sdlmain.cpp
44 24 1
data: imageLiteralToBitmap()
in share/src/components/GameModder.tsx
232 17 1
protected setHandlePosition()
in share/src/components/Joystick.tsx
62 17 3
function httpRequestCoreAsync()
in share/src/components/util.ts
51 14 1
protected interpolate()
in share/src/sprite-editor/tools.ts
29 12 4
protected bresenham()
in share/src/sprite-editor/tools.ts
29 12 5
function makeCodeRun()
in libs/template/assets/js/loader.js
48 11 1
static int isPressed()
in libs/hw---rpi/keys.cpp
29 10 2
int pressureLevelByButtonId()
in libs/hw---rpi/keys.cpp
35 10 2
constructor()
in share/src/sprite-editor/spriteEditor.ts
57 10 4
function lengthWithUnits()
in share/src/sprite-editor/svgUtil.ts
14 10 2
protected setButtonState()
in share/src/components/GameButtons.tsx
17 9 2
handle()
in share/src/sprite-editor/canvasGrid.ts
31 9 3
equals()
in share/src/sprite-editor/canvasState.ts
5 9 1
private newEdit()
in share/src/sprite-editor/spriteEditor.ts
20 9 0
export function f4PreProcess()
in share/src/bitmap_helpers.ts
31 8 1
equals()
in share/src/sprite-editor/bitmap.ts
9 8 1