aws-samples / aws-open-source-rover-challenge
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 144 units with 3,097 lines of code in units (47.3% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (268 lines of code)
    • 10 medium complex units (858 lines of code)
    • 12 simple units (492 lines of code)
    • 119 very simple units (1,479 lines of code)
0% | 8% | 27% | 15% | 47%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 18% | 4% | 9% | 68%
cpp0% | 4% | 45% | 19% | 31%
h0% | 0% | 0% | 15% | 84%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
rl-agent/markov/environments0% | 26% | 0% | 3% | 69%
rover/hector_gazebo_plugins/src0% | 4% | 42% | 20% | 32%
rover/message_to_tf/src0% | 0% | 66% | 13% | 20%
rl-agent/markov0% | 0% | 12% | 22% | 64%
rover/hector_gazebo_plugins/include0% | 0% | 0% | 15% | 84%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def reward_function()
in simulation_ws/src/rl-agent/markov/environments/mars_env.py
114 44 1
def reward_function()
in simulation_ws/src/rl-agent/markov/environments/training_env.py
77 34 1
void ServoPlugin::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/src/servo_plugin.cpp
77 26 2
void DiffDrivePlugin6W::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/src/diffdrive_plugin_6w.cpp
63 21 2
void GazeboRosDiffDriveMultiWheel::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/src/diffdrive_plugin_multi_wheel.cpp
148 21 2
void GazeboRosIMU::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/src/gazebo_ros_imu.cpp
122 19 2
void GazeboRosGps::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/src/gazebo_ros_gps.cpp
83 17 2
void GazeboRosForceBasedMove::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/src/gazebo_ros_force_based_move.cpp
129 14 2
void ServoPlugin::Update()
in simulation_ws/src/rover/hector_gazebo_plugins/src/servo_plugin.cpp
64 14 0
void GazeboRosMagnetic::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/src/gazebo_ros_magnetic.cpp
69 14 2
void sendTransform()
in simulation_ws/src/rover/message_to_tf/src/message_to_tf.cpp
62 13 3
def load_from_store()
in simulation_ws/src/rl-agent/markov/s3_boto_data_store.py
43 12 2
int main()
in simulation_ws/src/rover/message_to_tf/src/message_to_tf.cpp
75 12 2
def save_to_store()
in simulation_ws/src/rl-agent/markov/s3_boto_data_store.py
42 9 1
void GazeboRosGps::dynamicReconfigureCallback()
in simulation_ws/src/rover/hector_gazebo_plugins/src/gazebo_ros_gps.cpp
24 9 2
def call_reward_function()
in simulation_ws/src/rl-agent/markov/environments/mars_env.py
28 7 2
void GazeboRosSonar::Update()
in simulation_ws/src/rover/hector_gazebo_plugins/src/gazebo_ros_sonar.cpp
37 7 0
void SensorModel_::Load()
in simulation_ws/src/rover/hector_gazebo_plugins/include/hector_gazebo_plugins/sensor_model.h
23 7 2
def _download_directory()
in simulation_ws/src/rl-agent/markov/s3_boto_data_store.py
19 6 4
def _wait_for_ip_upload()
in simulation_ws/src/rl-agent/markov/s3_boto_data_store.py
16 6 2