microsoft / AcademicContent
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 521 units with 5,958 lines of code in units (55.2% of code).
    • 5 very long units (661 lines of code)
    • 5 long units (308 lines of code)
    • 68 medium size units (1,959 lines of code)
    • 83 small units (1,196 lines of code)
    • 360 very small units (1,834 lines of code)
11% | 5% | 32% | 20% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js11% | 5% | 32% | 19% | 31%
cs0% | 0% | 75% | 25% | 0%
py0% | 0% | 0% | 73% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Events and Hacks/Tech Talks/ContainerDemo15% | 6% | 33% | 20% | 24%
Labs/AI and Machine Learning/Video Indexer0% | 77% | 0% | 0% | 22%
Events and Hacks/Tech Talks/busbot0% | 0% | 64% | 6% | 29%
Educator Resources/Complimentary Course Content/Module20% | 0% | 19% | 31% | 49%
Events and Hacks/Azure University Tour/WebAppHOL0% | 0% | 30% | 12% | 56%
Events and Hacks/Azure Machine Learning Challenge/Client0% | 0% | 61% | 0% | 38%
Labs/Azure Services/Azure Blockchain Service0% | 0% | 100% | 0% | 0%
Events and Hacks/AI Hackathon/Code and Data0% | 0% | 0% | 100% | 0%
Labs/Azure Services/VM Scaling0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
var lex = function()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
156 66 0
(function (global)()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
152 5 1
function has()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
125 44 1
(function (global)()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
114 8 1
var serialize = function()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
114 40 7
var get = function()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
81 24 1
function Socket()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
60 37 2
(function (global)()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
58 3 1
function decodeString()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
56 21 1
$()
in Labs/AI and Machine Learning/Video Indexer/Resources/search.js
53 2 1
function decodeSymbol()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
49 11 0
(function(self)()
in Educator Resources/Complimentary Course Content/Module2/code/lesson7/lab/public/js/fetch.js
47 11 1
Manager.prototype.connect = function()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
43 5 1
exports.decodePayloadAsBinary = function()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
43 10 3
exports.decodePayload = function()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
42 14 3
map()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
39 7 4
function()
in Events and Hacks/Tech Talks/busbot/app.js
38 5 1
function onTransportOpen()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
37 11 0
function()
in Events and Hacks/Tech Talks/busbot/app.js
37 6 2
function url()
in Events and Hacks/Tech Talks/ContainerDemo/example-voting-app/result/views/socket.io.js
36 14 2