microsoft / mwt-ds
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,053 units with 30,887 lines of code in units (66.8% of code).
    • 38 very long units (5,830 lines of code)
    • 88 long units (5,879 lines of code)
    • 225 medium size units (7,037 lines of code)
    • 413 small units (5,925 lines of code)
    • 1,289 very small units (6,216 lines of code)
18% | 19% | 22% | 19% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js27% | 18% | 15% | 16% | 20%
py14% | 13% | 23% | 22% | 25%
cs3% | 21% | 36% | 22% | 15%
cpp0% | 0% | 64% | 0% | 35%
ts0% | 0% | 0% | 44% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mc26% | 19% | 17% | 16% | 20%
DataScience19% | 15% | 21% | 19% | 24%
AzureDataLake45% | 0% | 14% | 26% | 13%
Experimentation19% | 24% | 36% | 16% | 3%
client0% | 16% | 36% | 25% | 22%
Crawl0% | 33% | 36% | 18% | 10%
HostedExamples0% | 45% | 25% | 24% | 4%
ExperimentationConsole0% | 61% | 38% | 0% | 0%
ExperimentationTest0% | 70% | 0% | 20% | 8%
ContextExplorer0% | 6% | 31% | 32% | 29%
provisioning0% | 0% | 71% | 10% | 18%
LogCookig0% | 0% | 64% | 0% | 35%
JavascriptClient0% | 0% | 40% | 46% | 13%
hosted.js0% | 0% | 0% | 44% | 55%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function chart()
in mc/Scripts/nv.d3.js
278 61 1
function chart()
in mc/Scripts/nv.d3.js
272 47 1
function chart()
in mc/Scripts/nv.d3.js
263 67 1
color: color()
in mc/Scripts/nv.d3.js
246 20 2
function chart()
in mc/Scripts/nv.d3.js
237 38 1
def download_container()
in DataScience/LogDownloader.py
236 94 20
function chart()
in mc/Scripts/nv.d3.js
223 41 1
function chart()
in mc/Scripts/nv.d3.js
199 26 1
function chart()
in mc/Scripts/nv.d3.js
196 35 1
function chart()
in mc/Scripts/nv.d3.js
196 32 1
function chart()
in mc/Scripts/nv.d3.js
179 26 1
function chart()
in mc/Scripts/nv.d3.js
165 32 1
152 5 0
function chart()
in mc/Scripts/nv.d3.js
150 23 1
function chart()
in mc/Scripts/nv.d3.js
146 40 1
function chart()
in mc/Scripts/nv.d3.js
136 22 1
function chart()
in mc/Scripts/nv.d3.js
136 22 1
function chart()
in mc/Scripts/nv.d3.js
133 19 1
132 6 0
public IRow ParseEvent()
in AzureDataLake/DecisionServiceExtractor/CbParser.cs
129 30 2