aws-samples / ccp-react-dashboard-example
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 5 units with 250 lines of code in units (13.7% of code).
    • 1 very long units (163 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (80 lines of code)
    • 0 small units (0 lines of code)
    • 1 very small units (7 lines of code)
65% | 0% | 32% | 0% | 2%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts100% | 0% | 0% | 0% | 0%
js0% | 0% | 91% | 0% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ccp-cdk-infra/lib100% | 0% | 0% | 0% | 0%
ccp-ui/src0% | 0% | 91% | 0% | 8%
Alternative Visuals
Longest Units
Top 5 longest units
Unit# linesMcCabe index# params
constructor()
in ccp-cdk-infra/lib/ccp-stack.ts
163 8 3
function registerValidSW()
in ccp-ui/src/serviceWorker.js
33 8 2
function checkValidServiceWorker()
in ccp-ui/src/serviceWorker.js
25 4 2
export function register()
in ccp-ui/src/serviceWorker.js
22 5 1
export function unregister()
in ccp-ui/src/serviceWorker.js
7 2 0