facebookresearch / theseus
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 366 units with 1,957 lines of code in units (45.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 14 medium size units (400 lines of code)
    • 20 small units (272 lines of code)
    • 332 very small units (1,285 lines of code)
0% | 0% | 20% | 13% | 65%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 18% | 14% | 67%
cpp0% | 0% | 72% | 0% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
theseus/core0% | 0% | 31% | 11% | 57%
theseus/geometry0% | 0% | 10% | 8% | 81%
theseus/optimizer/autograd0% | 0% | 100% | 0% | 0%
theseus/optimizer0% | 0% | 30% | 6% | 63%
theseus/extlib0% | 0% | 72% | 0% | 27%
theseus/embodied/collision0% | 0% | 19% | 32% | 48%
theseus/embodied/motionmodel0% | 0% | 12% | 10% | 76%
theseus/optimizer/nonlinear0% | 0% | 0% | 44% | 55%
theseus/utils0% | 0% | 0% | 64% | 35%
theseus/embodied/measurements0% | 0% | 0% | 23% | 76%
theseus/optimizer/linear0% | 0% | 0% | 14% | 85%
theseus/embodied/misc0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
theseus0% | 0% | 0% | 0% | 100%
theseus/embodied/kinematics0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def add()
in theseus/core/objective.py
43 9 2
def update()
in theseus/core/objective.py
40 12 3
def copy()
in theseus/core/objective.py
38 14 1
def backward()
in theseus/optimizer/autograd/sparse_autograd.py
30 5 2
std::vector CusolverLUSolver::factor()
in theseus/extlib/cusolver_lu_solver.cpp
29 4 1
def exp_map()
in theseus/geometry/se2.py
29 4 1
def _linearize_jacobian_impl()
in theseus/optimizer/sparse_linearization.py
26 3 1
def _linearize_jacobian_impl()
in theseus/optimizer/dense_linearization.py
26 3 1
def _log_map_impl()
in theseus/geometry/se2.py
26 3 1
def erase()
in theseus/core/objective.py
24 3 2
def forward()
in theseus/optimizer/autograd/sparse_autograd.py
24 2 3
def update_data()
in theseus/embodied/collision/signed_distance_field.py
23 10 4
void CusolverLUSolver::solve()
in theseus/extlib/cusolver_lu_solver.cpp
21 2 1
def _compute_cost_weight()
in theseus/embodied/motionmodel/double_integrator.py
21 1 1
def _compute()
in theseus/utils/utils.py
20 5 1
def jacobians()
in theseus/embodied/motionmodel/double_integrator.py
18 1 1
def jacobians()
in theseus/core/cost_function.py
17 5 1
def jacobians()
in theseus/embodied/measurements/moving_frame_between.py
16 1 1
def _error_from_distances()
in theseus/embodied/collision/eff_obj_contact.py
15 2 2
def vee()
in theseus/geometry/se2.py
15 3 1