microsoft / node-diagnostic-channel
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 48 units with 571 lines of code in units (44.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (64 lines of code)
    • 9 medium size units (264 lines of code)
    • 5 small units (65 lines of code)
    • 33 very small units (178 lines of code)
0% | 11% | 46% | 11% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 12% | 49% | 9% | 28%
js0% | 0% | 0% | 35% | 64%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/diagnostic-channel-publishers/src0% | 14% | 48% | 8% | 27%
src/diagnostic-channel/src0% | 0% | 54% | 11% | 33%
ROOT0% | 0% | 0% | 35% | 64%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function postgres6PatchFunction()
in src/diagnostic-channel-publishers/src/pg.pub.ts
64 10 2
const mongodbPatchFunction: PatchFunction = function()
in src/diagnostic-channel-publishers/src/mongodb.pub.ts
36 6 1
const mongodb330PatchFunction: PatchFunction = function()
in src/diagnostic-channel-publishers/src/mongodb.pub.ts
34 8 1
export function makePatchingRequire()
in src/diagnostic-channel/src/patchRequire.ts
34 8 1
const mongodb3PatchFunction: PatchFunction = function()
in src/diagnostic-channel-publishers/src/mongodb.pub.ts
33 8 1
function patchCallback()
in src/diagnostic-channel-publishers/src/pg.pub.ts
31 10 1
function patchCallback()
in src/diagnostic-channel-publishers/src/pg.pub.ts
28 11 1
const mongodbcorePatchFunction: PatchFunction = function()
in src/diagnostic-channel-publishers/src/mongodb-core.pub.ts
23 4 1
const mongodbcorePatchFunction = function()
in src/diagnostic-channel-publishers/src/mongodb.pub.ts
23 4 1
public publish()
in src/diagnostic-channel/src/channel.ts
22 6 2
function runNpmTask()
in gulpfile.js
15 2 2
public log()
in src/diagnostic-channel-publishers/src/winston.pub.ts
14 6 2
export function enable()
in src/diagnostic-channel-publishers/src/index.ts
13 1 0
public unsubscribe()
in src/diagnostic-channel/src/channel.ts
12 5 3
originalBunyan.prototype._emit = function()
in src/diagnostic-channel-publishers/src/bunyan.pub.ts
11 3 2
10 1 0
function postgresPool1PatchFunction()
in src/diagnostic-channel-publishers/src/pg-pool.pub.ts
10 2 1
function patchedConfigure()
in src/diagnostic-channel-publishers/src/winston.pub.ts
10 6 0
9 1 0
originalConsole[method] = function()
in src/diagnostic-channel-publishers/src/console.pub.ts
9 3 0