aws-samples / aws-alien-attack
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 371 units with 6,490 lines of code in units (75.9% of code).
    • 4 very long units (1,129 lines of code)
    • 13 long units (849 lines of code)
    • 69 medium size units (2,136 lines of code)
    • 92 small units (1,337 lines of code)
    • 193 very small units (1,039 lines of code)
17% | 13% | 32% | 20% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts43% | 25% | 15% | 5% | 10%
js6% | 7% | 40% | 27% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/cdk/lib43% | 25% | 15% | 5% | 10%
application/resources/libs14% | 9% | 37% | 16% | 21%
application/resources/js0% | 12% | 22% | 42% | 22%
infrastructure/cdk/lambdas0% | 7% | 60% | 23% | 8%
application/game/js0% | 6% | 39% | 35% | 18%
application/scoreboard/js0% | 0% | 36% | 44% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
createAPIGateway()
in infrastructure/cdk/lib/layer/ingestionConsumptionLayer.ts
712 1 1
ClientImpl.prototype._handleMessage = function()
in application/resources/libs/paho-mqtt.js
161 48 1
WireMessage.prototype.encode = function()
in application/resources/libs/paho-mqtt.js
136 39 0
createKinesis()
in infrastructure/cdk/lib/layer/ingestionConsumptionLayer.ts
120 3 1
private getScoreboardFunction()
in infrastructure/cdk/lib/layer/processingLayer.ts
98 6 0
updateUsersRoles()
in infrastructure/cdk/lib/layer/ingestionConsumptionLayer.ts
91 1 1
buildResources()
in infrastructure/cdk/lib/layer/mainLayer.ts
68 5 0
ClientImpl.prototype._disconnected = function()
in application/resources/libs/paho-mqtt.js
66 19 2
function decodeMessage()
in application/resources/libs/paho-mqtt.js
65 16 2
private getDeallocateGamerFunction()
in infrastructure/cdk/lib/layer/processingLayer.ts
64 4 0
private createBucket()
in infrastructure/cdk/lib/layer/storageLayer.ts
62 5 1
private getAllocateGamerFunction()
in infrastructure/cdk/lib/layer/processingLayer.ts
62 4 0
constructor()
in application/resources/js/awsfacade.js
60 2 1
const allocateSeatForGamer = function()
in infrastructure/cdk/lambdas/allocateGamer/index.js
56 10 4
function Game()
in application/game/js/alienattack.js
54 2 0
function bnModPow()
in application/resources/libs/jsbn2.js
52 21 2
private createUserPool()
in infrastructure/cdk/lib/layer/securityLayer.ts
51 3 0
const deallocateUsers = function()
in infrastructure/cdk/lambdas/scoreboard/index.js
50 4 3
retrieveData()
in application/scoreboard/js/scoreboard.kinesisinherited.js
50 10 1
private getWebSocketConnectFunction()
in infrastructure/cdk/lib/layer/websocketLayer.ts
47 3 0