facebookresearch / pyrobot
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 606 units with 7,014 lines of code in units (43.9% of code).
    • 2 very long units (250 lines of code)
    • 20 long units (1,395 lines of code)
    • 61 medium size units (1,854 lines of code)
    • 110 small units (1,628 lines of code)
    • 413 very small units (1,887 lines of code)
3% | 19% | 26% | 23% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp11% | 41% | 23% | 15% | 8%
py1% | 14% | 26% | 25% | 31%
cc0% | 32% | 41% | 18% | 7%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
robots/LoCoBot/locobot_control12% | 39% | 17% | 16% | 14%
src/pyrobot/utils0% | 31% | 23% | 17% | 27%
robots/LoCoBot/locobot_calibration0% | 31% | 9% | 33% | 25%
src/pyrobot0% | 19% | 18% | 19% | 43%
robots/LoCoBot/locobot_navigation0% | 9% | 35% | 36% | 18%
src/pyrobot/habitat0% | 22% | 13% | 19% | 44%
src/pyrobot/locobot0% | 3% | 43% | 25% | 27%
robots/LoCoBot/locobot_gazebo0% | 0% | 40% | 30% | 28%
pyrobot_bridge/nodes0% | 0% | 28% | 54% | 17%
src/pyrobot/vrep_locobot0% | 0% | 25% | 5% | 69%
src/pyrobot/allegro_hand0% | 0% | 26% | 30% | 42%
robots/LoCoBot/turtlebot_controller0% | 0% | 81% | 0% | 18%
src/pyrobot/ur50% | 0% | 0% | 48% | 51%
src/pyrobot/kinect20% | 0% | 0% | 60% | 40%
src/pyrobot/sawyer0% | 0% | 0% | 0% | 100%
src/pyrobot/cfg0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
src/pyrobot/azure_kinect0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void LoCoBotController::publishCallback()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
148 19 1
def run()
in robots/LoCoBot/locobot_control/scripts/locobot_control/teleoperation.py
102 36 1
void LoCoBotController::readCallback()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
93 11 1
void LoCoBotController::hardwareStatusPublish()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
92 17 1
def collect_data()
in robots/LoCoBot/locobot_calibration/scripts/collect_calibration_data.py
90 18 2
bool LoCoBotController::jointCommandMsgCallback()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
84 21 2
def ik()
in robots/LoCoBot/locobot_control/scripts/locobot_control/analytic_ik.py
79 24 4
def compute_ik()
in src/pyrobot/core.py
78 10 5
void LoCoBotController::gripperController()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
76 17 1
def moveToPose()
in src/pyrobot/utils/move_group_interface.py
73 11 5
def get_plan()
in robots/LoCoBot/locobot_control/nodes/pointrobot3factor_ros_server.py
70 11 6
int main()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
69 10 2
def motionPlanToPose()
in src/pyrobot/utils/move_group_interface.py
67 11 5
def pix_to_3dpt()
in src/pyrobot/utils/util.py
63 17 7
cc
void run()
in robots/LoCoBot/locobot_navigation/orb_slam2_ros/src/gen_cfg_file.cc
62 4 0
def __init__()
in robots/LoCoBot/locobot_control/scripts/locobot_control/teleoperation.py
61 6 2
bool LoCoBotController::initSDKHandlers()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
61 9 1
def execute_cb()
in robots/LoCoBot/locobot_control/nodes/pointrobot3factor_ros_server.py
57 7 2
void LoCoBotController::execute_joint_trajectory()
in robots/LoCoBot/locobot_control/src/locobot_controller.cpp
56 10 1
def make_cfg()
in src/pyrobot/habitat/sim_utils.py
56 6 1