aws / sagemaker-tensorflow-extensions
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 93 units with 867 lines of code in units (45.1% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (140 lines of code)
    • 11 medium size units (317 lines of code)
    • 10 small units (143 lines of code)
    • 70 very small units (267 lines of code)
0% | 16% | 36% | 16% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 26% | 32% | 14% | 26%
cpp0% | 0% | 49% | 23% | 27%
h0% | 0% | 0% | 0% | 100%
hpp0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
benchmarking/pipemode_benchmark0% | 37% | 34% | 11% | 17%
src/pipemode_op/RecordReader0% | 0% | 53% | 18% | 27%
src/pipemode_op/Dataset/src0% | 0% | 52% | 24% | 22%
src/sagemaker_tensorflow0% | 0% | 52% | 0% | 47%
ROOT0% | 0% | 53% | 0% | 46%
benchmarking/pipemode_benchmark/docker0% | 0% | 0% | 49% | 50%
src/pipemode_op/PipeStateManager0% | 0% | 0% | 47% | 52%
src/pipemode_op/include0% | 0% | 0% | 0% | 100%
src/pipemode_op/include/tensorflow0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def benchmark()
in benchmarking/pipemode_benchmark/benchmark.py
76 14 6
def main()
in benchmarking/pipemode_benchmark/benchmark.py
64 5 1
def main()
in benchmarking/pipemode_benchmark/local_benchmark.py
39 4 1
bool TFRecordReader::ReadRecord()
in src/pipemode_op/RecordReader/TFRecordReader.cpp
36 7 1
def repository()
in benchmarking/pipemode_benchmark/repo_helper.py
35 3 1
Status GetNextInternal()
in src/pipemode_op/Dataset/src/pipemode_dataset_op_kernel.cpp
31 5 3
def build()
in benchmarking/pipemode_benchmark/script.py
30 2 2
bool TextLineRecordReader::ReadRecord()
in src/pipemode_op/RecordReader/TextLineRecordReader.cpp
30 9 1
void MakeDataset()
in src/pipemode_op/Dataset/src/pipemode_dataset_op_kernel.cpp
27 3 2
def _upload_to_s3()
in benchmarking/pipemode_benchmark/dataset.py
24 5 1
def __init__()
in src/sagemaker_tensorflow/pipemode.py
22 5 9
22 3 2
bool RecordIOReader::ReadRecord()
in src/pipemode_op/RecordReader/RecordIOReader.cpp
21 4 1
def _input_fn()
in benchmarking/pipemode_benchmark/docker/input_only_script.py
18 3 0
std::size_t RecordReader::Read()
in src/pipemode_op/RecordReader/RecordReader.cpp
18 5 2
explicit Iterator()
in src/pipemode_op/Dataset/src/pipemode_dataset_op_kernel.cpp
16 3 8
def get_role_arn()
in benchmarking/pipemode_benchmark/benchmark.py
15 5 1
def _input_fn()
in benchmarking/pipemode_benchmark/docker/gpu_pipeline_script.py
15 3 0
def bucket()
in benchmarking/pipemode_benchmark/bucket_helper.py
14 3 1
def validate_record_file()
in benchmarking/pipemode_benchmark/recordio_utils.py
13 1 2