microsoft / azureimds
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 32 units with 433 lines of code in units (64.7% of code).
    • 1 very long units (116 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (123 lines of code)
    • 6 small units (96 lines of code)
    • 20 very small units (98 lines of code)
26% | 0% | 28% | 22% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp95% | 0% | 0% | 0% | 4%
java0% | 0% | 49% | 18% | 31%
cs0% | 0% | 43% | 28% | 28%
js0% | 0% | 89% | 0% | 10%
go0% | 0% | 0% | 100% | 0%
py0% | 0% | 0% | 34% | 65%
vb0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT26% | 0% | 28% | 22% | 22%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void GetMetadata()
in IMDSSample-windows.cpp
116 20 3
27 5 3
25 4 3
function JsonQueryIMDS()
in IMDSSample.js
25 2 2
23 3 1
23 3 1
20 3 1
func main()
in imdssample.go
19 2 0
19 3 1
14 3 1
Sub Main()
in IMDSSample.vb
13 1 0
11 1 2
def main()
in IMDSSample.py
9 1 0
8 1 1
static async Task Main()
in IMDSSample.cs
7 1 1
7 1 1
public static void main()
in imdssample.java
7 1 1
int wmain()
in IMDSSample-windows.cpp
5 1 2
5 1 0
5 3 2