aws-samples / cdk-neptune-knowledge-graph
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 96 units with 1,689 lines of code in units (59.6% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (311 lines of code)
    • 21 medium size units (720 lines of code)
    • 29 small units (412 lines of code)
    • 42 very small units (246 lines of code)
0% | 18% | 42% | 24% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 18% | 42% | 24% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
web/js0% | 17% | 38% | 26% | 17%
lib0% | 31% | 65% | 0% | 2%
lambda0% | 0% | 36% | 51% | 11%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function viewNode()
in web/js/node-view.js
90 17 2
constructor()
in lib/api-construct.js
87 3 3
function initEvents()
in web/js/main.js
72 2 1
function move()
in web/js/input.js
62 21 2
async function verify()
in lambda/jwt-get.js
50 9 1
49 12 2
function drawEdge()
in web/js/render.js
45 5 2
addLambda()
in lib/api-construct.js
44 6 3
constructor()
in lib/ui-construct.js
42 2 3
42 15 3
function viewGrid()
in web/js/main.js
42 9 1
async function init()
in web/js/main.js
42 10 0
async function viewEdge()
in web/js/edge-view.js
38 8 2
constructor()
in lib/knowledge-graph-stack.js
36 1 3
constructor()
in lib/cluster-construct.js
34 1 3
async function deleteNode()
in web/js/node-view.js
30 9 2
function drawNode()
in web/js/render.js
29 4 2
28 9 3
function down()
in web/js/input.js
28 10 2
async function search()
in web/js/main.js
27 2 1