microsoft / landcover
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 642 units with 7,583 lines of code in units (64.3% of code).
    • 3 very long units (495 lines of code)
    • 8 long units (605 lines of code)
    • 82 medium size units (2,402 lines of code)
    • 139 small units (2,007 lines of code)
    • 410 very small units (2,074 lines of code)
6% | 7% | 31% | 26% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js7% | 7% | 28% | 26% | 29%
py4% | 8% | 36% | 26% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
web_tool/js7% | 7% | 28% | 26% | 29%
training52% | 25% | 13% | 5% | 2%
ROOT0% | 37% | 21% | 16% | 24%
utils0% | 18% | 53% | 16% | 11%
web_tool0% | 0% | 39% | 32% | 27%
training/models0% | 0% | 32% | 35% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function drawPicker()
in web_tool/js/jscolor.js
205 9 0
jscolor : function()
in web_tool/js/jscolor.js
148 26 2
def main()
in training/train_unsupervised.py
142 20 0
96 11 3
value: function show()
in web_tool/js/noty.js
91 24 0
80 11 0
def pred_tile()
in server.py
74 8 0
def main()
in server.py
70 1 0
def rolling_window()
in training/train_unsupervised.py
67 18 2
_initLayout: function()
in web_tool/js/leaflet-slider.js
67 16 0
def main()
in utils/create_shapefile_from_files.py
60 9 0
def run_model_on_tile()
in web_tool/ModelSessionPytorchSolar.py
48 5 3
def run_model_on_tile()
in web_tool/ModelSessionPyTorchSegmentationModel.py
47 5 3
redrawPosition : function()
in web_tool/js/jscolor.js
47 18 0
46 13 0
createPalette : function()
in web_tool/js/jscolor.js
45 3 0
def run_model_on_tile()
in web_tool/ModelSessionPyTorchExample.py
44 5 3
43 20 3
this.fromString = function()
in web_tool/js/jscolor.js
42 14 2
def main()
in utils/reproject_data.py
41 5 0