microsoft / MCW-Migrating-Oracle-to-Azure-SQL-and-PostgreSQL
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 1,095 units with 13,307 lines of code in units (77.8% of code).
    • 4 very long units (804 lines of code)
    • 8 long units (479 lines of code)
    • 154 medium size units (4,571 lines of code)
    • 280 small units (4,037 lines of code)
    • 649 very small units (3,416 lines of code)
6% | 3% | 34% | 30% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs41% | 0% | 15% | 22% | 20%
js2% | 3% | 36% | 31% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lab-files/starter-project/NorthwindMVC/Data90% | 0% | 0% | 0% | 9%
lab-files/starter-project/NorthwindMVC/wwwroot/lib2% | 3% | 36% | 31% | 26%
lab-files/starter-project/NorthwindMVC/Controllers0% | 0% | 25% | 45% | 28%
lab-files/starter-project/NorthwindMVC0% | 0% | 53% | 0% | 46%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected override void OnModelCreating()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/Data/DataContext.cs
450 1 1
_computeLabelItems()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
141 31 1
_computeGridLineItems()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
111 18 1
function drawPoint()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
102 19 4
function generateTicks$1()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
84 30 2
_drawColorBox()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
65 7 5
update()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
60 7 4
buildOrUpdateScales()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
59 11 0
constructor()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
56 10 2
function minMaxDecimation()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
53 13 4
update()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
51 9 3
function pathArc()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
51 10 5
constructor()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
50 1 1
_calculateBarValuePixels()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
50 13 1
fill: decodeFill()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
50 12 3
function getTooltipSize()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
50 6 2
x: horizontal ?()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
47 8 1
drawGrid()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
46 9 1
function lttbDecimation()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
46 7 5
const drawLegendBox = function()
in Hands-on lab/lab-files/starter-project/NorthwindMVC/wwwroot/lib/Chart.js/chart.js
46 8 3