microsoft / ApplicationInsights-node.js-native-metrics
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 28 units with 215 lines of code in units (44.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (47 lines of code)
    • 5 small units (62 lines of code)
    • 21 very small units (106 lines of code)
0% | 0% | 21% | 28% | 49%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc0% | 0% | 72% | 0% | 27%
hh0% | 0% | 0% | 42% | 57%
ts0% | 0% | 0% | 40% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 31% | 24% | 44%
lib0% | 0% | 0% | 40% | 60%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
v8::Local ResourceProfiler::_toJSON()
in src/ResourceProfiler.cc
24 1 1
void ResourceProfiler::_read()
in src/ResourceProfiler.cc
23 1 0
public getGCData()
in lib/main.ts
15 4 0
v8::Local toJSON()
in src/Metric.hh
14 1 0
private _start()
in lib/main.ts
11 3 1
static NAN_MODULE_INIT()
in src/GcProfiler.hh
11 1 1
static NAN_MODULE_INIT()
in src/LoopProfiler.hh
11 1 1
constructor()
in lib/main.ts
10 2 1
private _stop()
in lib/main.ts
10 2 0
private _emitUsage()
in lib/main.ts
9 3 1
static NAN_MODULE_INIT()
in src/ResourceProfiler.hh
9 1 1
uint64_t _getUsage()
in src/LoopProfiler.cc
8 1 0
public enable()
in lib/main.ts
7 2 2
6 1 1
static NAN_GC_CALLBACK()
in src/GcProfiler.hh
5 2 1
static NAN_GC_CALLBACK()
in src/GcProfiler.hh
5 2 1
static NAN_METHOD()
in src/LoopProfiler.hh
5 1 1
static NAN_METHOD()
in src/ResourceProfiler.hh
5 1 1
void GcProfiler::_gcDone()
in src/GcProfiler.cc
4 1 1
static void _start()
in src/GcProfiler.hh
4 1 0