aws-samples / aws-iot-greengrass-opcua-adapter
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 29 units with 569 lines of code in units (77.5% of code).
    • 1 very long units (123 lines of code)
    • 2 long units (151 lines of code)
    • 2 medium size units (80 lines of code)
    • 11 small units (158 lines of code)
    • 13 very small units (57 lines of code)
21% | 26% | 14% | 27% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js21% | 26% | 14% | 27% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
greengrass-opcua-adapter-nodejs21% | 26% | 14% | 27% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function configInit()
in greengrass-opcua-adapter-nodejs/config_agent.js
123 22 2
monitorNodes()
in greengrass-opcua-adapter-nodejs/subscriber.js
93 9 0
function updateConfig()
in greengrass-opcua-adapter-nodejs/index.js
58 13 0
createSession()
in greengrass-opcua-adapter-nodejs/subscriber.js
45 9 0
function sendDataToCloud()
in greengrass-opcua-adapter-nodejs/subscriber.js
35 7 2
createSubscription()
in greengrass-opcua-adapter-nodejs/subscriber.js
20 1 0
function checkFileLoop()
in greengrass-opcua-adapter-nodejs/config_agent.js
19 5 1
constructor()
in greengrass-opcua-adapter-nodejs/subscriber.js
16 1 4
connect()
in greengrass-opcua-adapter-nodejs/subscriber.js
14 3 0
disconnect()
in greengrass-opcua-adapter-nodejs/subscriber.js
14 3 0
function connectServer()
in greengrass-opcua-adapter-nodejs/index.js
13 3 3
var convertOPCUASubscriberSetToMap = function()
in greengrass-opcua-adapter-nodejs/index.js
13 2 1
function updateOPCUASubscriberSetStatus()
in greengrass-opcua-adapter-nodejs/index.js
13 5 0
function reportSystemStatus()
in greengrass-opcua-adapter-nodejs/config_agent.js
12 2 0
var compareWithTrustCert = function()
in greengrass-opcua-adapter-nodejs/config_agent.js
12 4 1
var convertSerConfigToMap = function()
in greengrass-opcua-adapter-nodejs/index.js
12 2 1
function dumpServerInfo()
in greengrass-opcua-adapter-nodejs/index.js
8 1 1
function confirmFileExist()
in greengrass-opcua-adapter-nodejs/config_agent.js
7 3 1
function confirmFilePath()
in greengrass-opcua-adapter-nodejs/config_agent.js
6 6 0
function isEmptyObject()
in greengrass-opcua-adapter-nodejs/subscriber.js
6 2 1