facebookresearch / polymetis
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 213 units with 1,729 lines of code in units (12.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (76 lines of code)
    • 17 medium size units (530 lines of code)
    • 28 small units (397 lines of code)
    • 167 very small units (726 lines of code)
0% | 4% | 30% | 22% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hpp0% | 85% | 0% | 14% | 0%
cpp0% | 0% | 49% | 25% | 24%
py0% | 0% | 23% | 23% | 53%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
polymetis/include0% | 73% | 0% | 12% | 13%
polymetis/python/scripts0% | 0% | 79% | 7% | 13%
polymetis/src/clients0% | 0% | 71% | 28% | 0%
polymetis/src0% | 0% | 59% | 27% | 12%
polymetis/python/polysim0% | 0% | 26% | 41% | 32%
polymetis/python/polymetis0% | 0% | 14% | 15% | 70%
polymetis/src/torchscript_operators0% | 0% | 12% | 21% | 65%
polymetis/python/torchcontrol0% | 0% | 0% | 19% | 80%
polymetis/include/polymetis0% | 0% | 0% | 0% | 100%
polymetis/python/hydra_plugins0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int create_real_time_thread()
in polymetis/include/real_time.hpp
76 12 1
def main()
in polymetis/python/scripts/viz.py
42 4 1
void FrankaTorqueControlClient::checkStateLimits()
in polymetis/src/clients/franka_panda_client/franka_panda_client.cpp
42 5 2
def main()
in polymetis/python/scripts/launch_robot.py
39 4 1
def initialize_graphs()
in polymetis/python/scripts/viz.py
36 9 2
void FrankaTorqueControlClient::run()
in polymetis/src/clients/franka_panda_client/franka_panda_client.cpp
36 6 0
36 5 3
Status PolymetisControllerServerImpl::SetController()
in polymetis/src/polymetis_server.cpp
33 5 3
int main()
in polymetis/src/run_server.cpp
33 6 2
void FrankaTorqueControlClient::computeSafetyReflex()
in polymetis/src/clients/franka_panda_client/franka_panda_client.cpp
32 8 8
Status PolymetisControllerServerImpl::InitRobotClient()
in polymetis/src/polymetis_server.cpp
31 3 3
def run()
in polymetis/python/polysim/grpc_sim_client.py
30 7 2
void FrankaTorqueControlClient::updateServerCommand()
in polymetis/src/clients/franka_panda_client/franka_panda_client.cpp
27 5 2
def reset_then_step()
in polymetis/python/polysim/envs/bullet_locomotor.py
24 7 3
def run()
in polymetis/python/polymetis/robot_client/executable_robot_client.py
23 3 1
def process_queue()
in polymetis/python/scripts/viz.py
22 8 1
def apply_joint_torques()
in polymetis/python/polysim/envs/bullet_manipulator.py
22 2 2
c10::List forward_kinematics()
in polymetis/src/torchscript_operators/pinocchio.cpp
22 2 1
def _get_states()
in polymetis/python/polysim/envs/bullet_locomotor.py
20 4 1
def __init__()
in polymetis/python/polysim/envs/bullet_locomotor.py
19 1 0