awslabs / datawig
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 489 units with 7,277 lines of code in units (62.8% of code).
    • 2 very long units (226 lines of code)
    • 26 long units (1,708 lines of code)
    • 77 medium size units (2,388 lines of code)
    • 103 small units (1,474 lines of code)
    • 281 very small units (1,481 lines of code)
3% | 23% | 32% | 20% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js4% | 25% | 30% | 18% | 21%
py0% | 19% | 38% | 23% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
datawig-js/static/jspsych-6.1.0/plugins6% | 33% | 27% | 17% | 14%
datawig0% | 21% | 35% | 25% | 18%
datawig-js/static/jspsych-6.1.00% | 10% | 36% | 20% | 32%
experiments0% | 0% | 68% | 12% | 19%
datawig-js/static/jspsych-6.1.0/plugins/template0% | 0% | 0% | 0% | 100%
datawig-js/blueprints0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-rdk.js
125 7 2
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-survey-multi-select.js
101 14 2
def __fit_hp()
in datawig/_hpo.py
95 24 7
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-video-button-response.js
84 19 2
def evaluate_and_persist_metrics()
in datawig/evaluation.py
81 16 8
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-survey-multi-choice.js
81 13 2
core.init = function()
in datawig-js/static/jspsych-6.1.0/jspsych.js
76 8 1
function makeDotArray()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-rdk.js
73 17 0
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-survey-text.js
72 16 2
var after_response = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-iat-html.js
70 28 1
var after_response = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-iat-image.js
70 28 1
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-video-keyboard-response.js
68 15 2
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-free-sort.js
67 8 2
def fit_hpo()
in datawig/simple_imputer.py
65 19 25
def __init__()
in datawig/imputer.py
64 27 5
function end_trial()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-rdk.js
63 7 0
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-audio-button-response.js
61 12 2
function updateDots()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-rdk.js
61 24 0
plugin.trial = function()
in datawig-js/static/jspsych-6.1.0/plugins/jspsych-image-button-response.js
59 15 2
def fit()
in datawig/simple_imputer.py
58 7 4