facebookresearch / video-nonlocal-net
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 150 units with 3,590 lines of code in units (70.3% of code).
    • 3 very long units (528 lines of code)
    • 21 long units (1,503 lines of code)
    • 21 medium size units (626 lines of code)
    • 36 small units (525 lines of code)
    • 69 very small units (408 lines of code)
14% | 41% | 17% | 14% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc30% | 54% | 4% | 8% | 2%
py10% | 29% | 27% | 15% | 16%
h0% | 72% | 0% | 22% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
caffe2_customized_ops/video20% | 60% | 3% | 12% | 3%
lib/models29% | 27% | 24% | 7% | 11%
lib/utils0% | 23% | 28% | 21% | 26%
process_data/kinetics0% | 51% | 22% | 26% | 0%
tools0% | 62% | 37% | 0% | 0%
lib/core0% | 0% | 37% | 48% | 13%
process_data/convert_models0% | 0% | 54% | 0% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
cc
void CustomVideoDecoder::decodeLoop()
in caffe2_customized_ops/video/customized_video_decoder.cc
298 60 6
def create_model()
in lib/models/resnet_video.py
115 16 4
def create_model()
in lib/models/resnet_video_org.py
115 16 4
void CustomizedVideoInputOp::DecodeAndTransform()
in caffe2_customized_ops/video/customized_video_input_op.h
95 12 11
def spacetime_nonlocal()
in lib/models/nonlocal_helper.py
95 13 9
bool CustomizedVideoInputOp::Prefetch()
in caffe2_customized_ops/video/customized_video_input_op.h
94 16 0
OperatorBase::template GetSingleArgument()
in caffe2_customized_ops/video/customized_video_input_op.h
91 8 2
def initialize_master_gpu_model_params()
in lib/utils/checkpoints.py
91 19 3
def train()
in tools/train_net_video.py
85 1 1
cc
bool ReadClipFromVideoSequential()
in caffe2_customized_ops/video/customized_video_io.cc
79 15 7
cc
bool ReadClipFromVideoLazzy()
in caffe2_customized_ops/video/customized_video_io.cc
75 14 7
bool CustomizedVideoInputOp::GetClipAndLabelFromDBValue()
in caffe2_customized_ops/video/customized_video_input_op.h
70 9 6
cc
void ScaleTransform()
in caffe2_customized_ops/video/customized_video_io.cc
68 8 11
cc
void ClipTransformFlex()
in caffe2_customized_ops/video/customized_video_io.cc
67 12 16
cc
bool DecodeClipFromVideoFileFlex()
in caffe2_customized_ops/video/customized_video_io.cc
66 7 9
cc
bool DecodeClipFromMemoryBuffer()
in caffe2_customized_ops/video/customized_video_io.cc
64 10 9
cc
bool DecodeClipFromMemoryBufferFlex()
in caffe2_customized_ops/video/customized_video_io.cc
63 8 9
def get_flops_params()
in lib/utils/misc.py
58 19 1
def obtain_arc()
in lib/models/resnet_video.py
58 7 1
def obtain_arc()
in lib/models/resnet_video_org.py
58 7 1