microsoft / uf2
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 63 units with 1,213 lines of code in units (67.3% of code).
    • 1 very long units (129 lines of code)
    • 5 long units (413 lines of code)
    • 12 medium size units (335 lines of code)
    • 10 small units (138 lines of code)
    • 35 very small units (198 lines of code)
10% | 34% | 27% | 11% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c43% | 0% | 37% | 9% | 9%
js0% | 42% | 22% | 15% | 20%
py0% | 51% | 29% | 4% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
uf2tool49% | 0% | 29% | 10% | 11%
patcher0% | 42% | 22% | 15% | 20%
utils0% | 45% | 36% | 3% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int main()
in uf2tool/tool.c
129 26 2
function patchConfig()
in patcher/patcher.js
96 25 2
function patchHFile()
in patcher/patcher.js
91 24 2
def main()
in utils/uf2conv.py
79 20 0
function readWriteConfig()
in patcher/patcher.js
75 28 2
def convert_from_uf2()
in utils/uf2conv.py
72 32 1
38 13 1
function parsePinName()
in patcher/patcher.js
37 12 2
int main()
in utils/uf2conv.c
35 5 2
function showKV()
in patcher/patcher.js
32 16 4
int recv_hid()
in uf2tool/tool.c
32 11 2
function configkeysH()
in patcher/patcher.js
26 7 0
def get_drives()
in utils/uf2conv.py
26 10 0
void verify()
in uf2tool/tool.c
23 5 4
void send_hid()
in uf2tool/tool.c
22 5 3
def convert_to_uf2()
in utils/uf2conv.py
22 5 1
function applyPatch()
in patcher/web.js
21 4 0
function dropHandler()
in patcher/web.js
21 3 1
void talk_hid()
in uf2tool/tool.c
17 6 4
function pinToString()
in patcher/patcher.js
16 5 2