aws-samples / aws-iot-chat-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 77 units with 883 lines of code in units (28.7% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (237 lines of code)
    • 6 medium size units (151 lines of code)
    • 17 small units (254 lines of code)
    • 50 very small units (241 lines of code)
0% | 26% | 17% | 28% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 26% | 17% | 28% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
client/src/reducers0% | 53% | 17% | 28% | 0%
client/src/components0% | 30% | 12% | 18% | 38%
client/src0% | 0% | 65% | 24% | 10%
client/src/lib0% | 0% | 9% | 47% | 42%
api/src/user0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export default()
in client/src/reducers/chatReducer.js
69 12 2
export default()
in client/src/reducers/authReducer.js
60 13 2
render()
in client/src/components/Rooms/CreateRoom.js
57 1 0
render()
in client/src/components/Auth/Login.js
51 3 0
export default()
in client/src/reducers/iotReducer.js
42 8 2
render()
in client/src/components/Chat/Chat.js
23 1 0
componentWillReceiveProps()
in client/src/components/App.js
22 6 1
function checkValidServiceWorker()
in client/src/registerServiceWorker.js
22 3 1
function buildCanonicalQueryString()
in client/src/lib/sigV4Client.js
21 5 1
function registerValidSW()
in client/src/registerServiceWorker.js
21 3 1
renderPageBody()
in client/src/components/App.js
20 2 0
function buildAuthorizationHeader()
in client/src/lib/sigV4Client.js
18 1 4
render()
in client/src/components/Rooms/Rooms.js
17 1 0
initClient()
in client/src/lib/iot-client.js
16 12 1
export default()
in client/src/reducers/unreadsReducer.js
16 4 2
export default()
in client/src/reducers/messagesReducer.js
16 2 2
render()
in client/src/components/Routers/RootRouter.js
16 1 0
export default function register()
in client/src/registerServiceWorker.js
16 5 0
function buildCanonicalRequest()
in client/src/lib/sigV4Client.js
15 1 5
function buildCanonicalHeaders()
in client/src/lib/sigV4Client.js
15 4 1