facebookresearch / torcharrow
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,878 units with 6,925 lines of code in units (64.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (118 lines of code)
    • 64 medium size units (1,948 lines of code)
    • 90 small units (1,378 lines of code)
    • 1,722 very small units (3,481 lines of code)
0% | 1% | 28% | 19% | 50%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 10% | 57% | 24% | 8%
h0% | 6% | 36% | 17% | 39%
py0% | 0% | 29% | 24% | 45%
pyi0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
csrc/velox0% | 5% | 16% | 13% | 64%
torcharrow/velox_rt0% | 0% | 35% | 30% | 34%
torcharrow0% | 0% | 21% | 18% | 60%
csrc/velox/functions0% | 0% | 89% | 0% | 10%
ROOT0% | 0% | 41% | 41% | 16%
tools/codegen0% | 0% | 100% | 0% | 0%
torcharrow/benchmark0% | 0% | 0% | 0% | 100%
tutorial0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
65 8 1
static velox::TypeKind promote()
in csrc/velox/column.h
53 5 3
def select()
in torcharrow/velox_rt/dataframe_cpu.py
49 21 3
std::string opCodeToFunctionName()
in csrc/velox/column.cpp
48 14 1
def dtype_of_type()
in torcharrow/dtypes.py
46 23 2
if constexpr()
in csrc/velox/lib.cpp
41 10 1
def dtype_of_velox_type()
in torcharrow/dtypes.py
41 13 1
bool call()
in csrc/velox/functions/string_functions.h
40 7 2
def append()
in torcharrow/velox_rt/dataframe_cpu.py
38 9 4
37 6 1
def common_dtype()
in torcharrow/dtypes.py
35 27 2
def _py_arithmetic_op()
in torcharrow/icolumn.py
35 18 4
def __str__()
in torcharrow/expression.py
35 16 1
def create_dispatch_wrapper()
in torcharrow/velox_rt/functional.py
35 9 1
def __add__()
in torcharrow/velox_rt/dataframe_cpu.py
35 4 2
def __sub__()
in torcharrow/velox_rt/dataframe_cpu.py
35 4 2
def __rsub__()
in torcharrow/velox_rt/dataframe_cpu.py
35 4 2
def __mul__()
in torcharrow/velox_rt/dataframe_cpu.py
35 4 2
def __rmul__()
in torcharrow/velox_rt/dataframe_cpu.py
35 4 2
def __floordiv__()
in torcharrow/velox_rt/dataframe_cpu.py
35 4 2