microsoft / node-pty
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 83 units with 1,231 lines of code in units (50.7% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (385 lines of code)
    • 12 medium size units (381 lines of code)
    • 12 small units (181 lines of code)
    • 54 very small units (284 lines of code)
0% | 31% | 30% | 14% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc0% | 40% | 43% | 9% | 7%
ts0% | 24% | 20% | 15% | 40%
js0% | 0% | 0% | 81% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/win0% | 44% | 40% | 9% | 5%
src0% | 24% | 20% | 15% | 39%
src/unix0% | 0% | 80% | 0% | 19%
scripts0% | 0% | 0% | 81% | 18%
src/shared0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static NAN_METHOD()
in src/win/winpty.cc
96 19 1
static NAN_METHOD()
in src/win/conpty.cc
90 14 1
constructor()
in src/unixTerminal.ts
86 28 3
static NAN_METHOD()
in src/win/conpty.cc
58 13 1
constructor()
in src/windowsTerminal.ts
55 17 3
export function argsToCommandLine()
in src/windowsPtyAgent.ts
50 15 2
int main()
in src/unix/spawn-helper.cc
42 11 2
public static open()
in src/unixTerminal.ts
42 11 1
39 8 8
std::wstring get_shell_path()
in src/win/path_util.cc
33 7 1
static NAN_METHOD()
in src/win/conpty.cc
28 8 1
static NAN_METHOD()
in src/win/conpty.cc
28 6 1
static NAN_METHOD()
in src/win/conpty_console_list.cc
26 7 1
public kill()
in src/windowsPtyAgent.ts
25 4 0
static NAN_METHOD()
in src/win/winpty.cc
24 7 1
bool createDataServerPipe()
in src/win/conpty.cc
22 1 5
static NAN_METHOD()
in src/win/winpty.cc
22 5 1
function getNextBetaVersion()
in scripts/publish.js
20 4 0
public get event()
in src/eventEmitter2.ts
19 4 0
static NAN_METHOD()
in src/win/winpty.cc
19 5 1