microsoft / federalist
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 257 units with 3,311 lines of code in units (60.7% of code).
    • 1 very long units (229 lines of code)
    • 3 long units (186 lines of code)
    • 31 medium size units (914 lines of code)
    • 77 small units (1,141 lines of code)
    • 145 very small units (841 lines of code)
6% | 5% | 27% | 34% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js6% | 5% | 27% | 34% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tasks/config62% | 0% | 12% | 14% | 10%
api/services0% | 21% | 38% | 28% | 10%
assets/app0% | 4% | 24% | 43% | 28%
api/controllers0% | 0% | 52% | 22% | 24%
api/hooks0% | 0% | 35% | 29% | 34%
api/policies0% | 0% | 37% | 36% | 25%
migrations0% | 0% | 29% | 23% | 47%
ROOT0% | 0% | 42% | 29% | 27%
api/models0% | 0% | 0% | 62% | 37%
tasks/register0% | 0% | 0% | 30% | 69%
config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
module.exports = function()
in tasks/config/sails-linker.js
229 1 1
passport.connect = function()
in api/services/passport.js
67 20 4
clone: function clone()
in assets/app/models/Github.js
61 10 3
addJob: function()
in api/services/SQS.js
58 11 1
update: function()
in assets/app/views/editor/edit-main.js
50 8 0
exports.register = function()
in api/services/protocols/local.js
49 10 3
exports.login = function()
in api/services/protocols/local.js
45 8 4
passport.loadStrategies = function()
in api/services/passport.js
41 10 0
forkRepository: function()
in api/services/GitHub.js
38 6 3
render: function()
in assets/app/views/editor/breadcrumb.js
38 4 0
provider: function()
in api/controllers/AuthController.js
35 6 2
module.exports = function()
in api/policies/filterCurrentUser.js
35 10 3
clone: function cloneSite()
in api/controllers/SiteController.js
34 6 2
useAsset: function()
in assets/app/views/editor/add-image.js
33 3 1
initialize: function()
in assets/app/views/editor/edit-file.js
33 2 1
exports.up = function()
in migrations/20151015171458-merge-sites.js
32 2 2
(function()()
in app.js
29 4 1
saveDocument: function()
in assets/app/views/editor/edit-file.js
26 6 3
render: function()
in assets/app/views/site/builds.js
26 8 0
function tryAgain()
in api/controllers/AuthController.js
25 10 1