microsoft / devops-project-samples
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 2,413 units with 27,022 lines of code in units (28.6% of code).
    • 13 very long units (3,025 lines of code)
    • 36 long units (2,034 lines of code)
    • 271 medium size units (7,547 lines of code)
    • 384 small units (5,603 lines of code)
    • 1,709 very small units (8,813 lines of code)
11% | 7% | 27% | 20% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js15% | 10% | 29% | 17% | 27%
cs0% | 0% | 29% | 34% | 35%
java0% | 0% | 31% | 3% | 64%
py0% | 0% | 6% | 29% | 64%
php0% | 0% | 0% | 13% | 86%
go0% | 0% | 0% | 31% | 68%
rb0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
node39% | 0% | 8% | 20% | 30%
dotnet8% | 3% | 32% | 23% | 31%
github9% | 9% | 26% | 19% | 33%
python3% | 16% | 33% | 18% | 27%
java0% | 0% | 29% | 3% | 67%
php0% | 0% | 0% | 13% | 86%
go0% | 0% | 0% | 31% | 68%
ruby0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
module.exports = function()
in dotnet/aspnet/servicefabric/VotingWeb/wwwroot/lib/bootstrap/Gruntfile.js
418 8 1
module.exports = function()
in dotnet/aspnetcore/servicefabric/Application/VotingWeb/wwwroot/lib/bootstrap/Gruntfile.js
418 8 1
module.exports = function()
in github/node/sail.js/containerCosmosDBWithTests/Application/tasks/config/sails-linker.js
229 1 1
module.exports = function()
in github/node/sail.js/containerWithTests/Application/tasks/config/sails-linker.js
229 1 1
module.exports = function()
in node/sail.js/container/Application/tasks/config/sails-linker.js
229 1 1
module.exports = function()
in node/sail.js/containerCosmosDBWithTests/Application/tasks/config/sails-linker.js
229 1 1
module.exports = function()
in node/sail.js/containerWithTests/Application/tasks/config/sails-linker.js
229 1 1
module.exports = function()
in node/sail.js/kubernetes/Application/tasks/config/sails-linker.js
229 1 1
module.exports = function()
in node/sail.js/kubernetesCosmosDB/Application/tasks/config/sails-linker.js
229 1 1
module.exports = function()
in node/sail.js/webapp/Application/tasks/config/sails-linker.js
229 1 1
(function()()
in github/python/django/linuxWebappWithTests/Application/app/static/admin/js/urlify.js
119 1 1
(function()()
in python/django/webapp/Application/static/admin/js/urlify.js
119 1 1
(function()()
in python/django/webappWithTests/Application/static/admin/js/urlify.js
119 1 1
init: function()
in github/python/django/linuxWebappWithTests/Application/app/static/admin/js/SelectFilter2.js
73 4 3
init: function()
in python/django/webapp/Application/static/admin/js/SelectFilter2.js
73 4 3
init: function()
in python/django/webappWithTests/Application/static/admin/js/SelectFilter2.js
73 4 3
$.fn.formset = function()
in github/python/django/linuxWebappWithTests/Application/app/static/admin/js/inlines.js
57 13 1
$.fn.formset = function()
in python/django/webapp/Application/static/admin/js/inlines.js
57 13 1
$.fn.formset = function()
in python/django/webappWithTests/Application/static/admin/js/inlines.js
57 13 1
applyMedia = function()
in dotnet/aspnet/mssqldb/Application/SampleWebApplication/Scripts/respond.js
55 27 1