awslabs / sockeye
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 1,070 units with 14,570 lines of code in units (87.4% of code).
    • 8 very long units (1,308 lines of code)
    • 37 long units (2,692 lines of code)
    • 159 medium size units (4,759 lines of code)
    • 183 small units (2,721 lines of code)
    • 683 very small units (3,090 lines of code)
8% | 18% | 32% | 18% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 18% | 32% | 18% | 21%
js0% | 100% | 0% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sockeye9% | 18% | 33% | 18% | 20%
sockeye_contrib0% | 25% | 16% | 27% | 30%
sockeye_contrib/vistools/templates0% | 100% | 0% | 0% | 0%
sockeye_contrib/benchmark0% | 0% | 43% | 0% | 56%
sockeye_contrib/vistools0% | 0% | 37% | 47% | 15%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def add_training_args()
in sockeye/arguments.py
274 1 1
def train()
in sockeye/train.py
171 38 3
def add_model_parameters()
in sockeye/arguments.py
153 1 1
def add_inference_args()
in sockeye/arguments.py
152 1 1
def train()
in sockeye/train_pt.py
147 28 3
141 35 6
138 32 6
def forward()
in sockeye/beam_search.py
132 19 7
def prepare_data()
in sockeye/data_io_pt.py
100 30 20
def prepare_data()
in sockeye/data_io.py
99 30 20
def load_or_create_vocabs()
in sockeye/vocab.py
96 19 13
def forward()
in sockeye/beam_search_pt.py
96 18 5
def run_translate()
in sockeye/translate.py
96 15 1
def load_model()
in sockeye/model.py
94 28 3
def run_translate()
in sockeye/translate_pt.py
93 18 1
def __init__()
in sockeye/inference.py
83 12 26
def get_training_data_iters()
in sockeye/data_io.py
80 6 20
def create_model_config()
in sockeye/train.py
79 20 6
def plot_metrics()
in sockeye_contrib/plot_metrics.py
78 36 1
def get_prepared_data_iters()
in sockeye/data_io.py
78 3 9