tensorflow / playground
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 69 units with 1,352 lines of code in units (44.8% of code).
    • 3 very long units (396 lines of code)
    • 1 long units (53 lines of code)
    • 14 medium size units (449 lines of code)
    • 17 small units (251 lines of code)
    • 34 very small units (203 lines of code)
29% | 3% | 33% | 18% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts29% | 3% | 33% | 18% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src29% | 3% | 33% | 18% | 15%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function makeGUI()
in src/playground.ts
181 12 0
function drawNetwork()
in src/playground.ts
108 15 1
function drawNode()
in src/playground.ts
107 12 6
53 17 0
function updateHoverCard()
in src/playground.ts
46 8 4
42 11 2
41 10 3
function addPlusMinusControl()
in src/playground.ts
39 4 2
38 9 3
36 7 6
function hideControls()
in src/playground.ts
35 3 0
constructor()
in src/linechart.ts
31 2 2
27 3 2
26 2 2
function initTutorial()
in src/playground.ts
23 6 0
private updateCircles()
in src/heatmap.ts
22 5 2
function reset()
in src/playground.ts
22 4 1
function generateData()
in src/playground.ts
21 5 1
serialize()
in src/state.ts
20 5 0
19 5 0