microsoft / node-native-keymap
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 54 units with 712 lines of code in units (59.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (60 lines of code)
    • 11 medium size units (354 lines of code)
    • 6 small units (92 lines of code)
    • 36 very small units (206 lines of code)
0% | 8% | 49% | 12% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc0% | 11% | 45% | 17% | 25%
mm0% | 0% | 86% | 0% | 13%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 9% | 54% | 14% | 22%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
napi_value _GetKeyMap()
in src/keyboard_x.cc
60 5 2
napi_value _GetKeyMap()
in src/keyboard_mac.mm
50 10 2
void Initialize()
in src/keyboard_x.cc
48 16 1
std::pair ConvertKeyCodeToText()
in src/keyboard_mac.mm
46 11 3
std::string UTF16to8()
in src/string_conversion.cc
32 9 1
napi_value _GetKeyMap()
in src/keyboard_win.cc
30 4 2
int XStateFromKeyMod()
in src/keyboard_x.cc
27 10 1
std::string GetStrFromKeyPress()
in src/keyboard_win.cc
26 10 5
26 8 2
napi_value Init()
in src/keymapping.cc
25 1 2
22 6 2
void StartListening()
in src/keyboard_win.cc
22 4 0
19 1 2
std::string UTF16toUTF8()
in src/string_conversion.cc
17 4 2
16 2 2
void readKbState()
in src/keyboard_x.cc
15 4 2
std::string GetStringRegKey()
in src/keyboard_win.cc
14 3 2
11 1 7
void StopListening()
in src/keyboard_win.cc
10 3 0
std::string GetStrFromXEvent()
in src/keyboard_x.cc
10 2 1