microsoft / projection-grid
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 511 units with 6,500 lines of code in units (71.4% of code).
    • 3 very long units (330 lines of code)
    • 11 long units (691 lines of code)
    • 87 medium size units (2,654 lines of code)
    • 82 small units (1,214 lines of code)
    • 328 very small units (1,611 lines of code)
5% | 10% | 40% | 18% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js5% | 10% | 40% | 18% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
spec/integrated10% | 9% | 52% | 13% | 14%
js/vnext7% | 10% | 33% | 19% | 28%
js/projection0% | 19% | 45% | 17% | 17%
js/layout0% | 14% | 31% | 29% | 24%
spec/unit0% | 0% | 27% | 37% | 34%
js/factory0% | 0% | 30% | 14% | 55%
js0% | 0% | 31% | 8% | 60%
js/popup-editor0% | 0% | 31% | 0% | 68%
spec/util0% | 0% | 0% | 25% | 74%
ROOT0% | 0% | 0% | 0% | 100%
js/schema0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
initialize()
in js/vnext/grid-view.js
119 13 5
it()
in spec/integrated/vnext-spec/grid-view-api-spec.js
110 1 2
it()
in spec/integrated/non-vnext-spec/unencapsulating-projection-spec.js
101 3 2
it()
in spec/integrated/vnext-spec/grid-view-api-spec.js
87 3 2
update: function()
in js/projection/row-checkbox.js
69 10 1
constructor()
in js/vnext/projection/column-group.js
68 11 1
it()
in spec/integrated/vnext-spec/grid-view-api-spec.js
65 1 2
update: function()
in js/projection/row.js
62 10 1
draw()
in js/layout/renderer/fixed-header.js
60 7 2
_hookUpStickyHeader()
in js/vnext/layout/table-view.js
59 11 1
update: function()
in js/projection/jsdata.js
57 13 0
function selectionProjectionHandler()
in js/vnext/projection/selection.js
56 6 9
it()
in spec/integrated/vnext-spec/selection-spec.js
56 2 2
update: function()
in js/projection/odata.js
52 10 0
function translateRow()
in js/vnext/projection/cells.js
50 7 5
update: function()
in js/projection/row-tri-state-checkbox.js
48 7 1
it()
in spec/integrated/vnext-spec/selection-spec.js
48 1 2
it()
in spec/integrated/vnext-spec/selection-spec.js
47 1 2
update: function()
in js/layout/table.js
45 10 1
update: function()
in js/projection/column-shifter.js
45 5 1