microsoft / AirSim
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 5,798 units with 73,012 lines of code in units (44.1% of code).
    • 7 very complex units (3,701 lines of code)
    • 25 complex units (3,897 lines of code)
    • 138 medium complex units (8,987 lines of code)
    • 308 simple units (10,377 lines of code)
    • 5,320 very simple units (46,050 lines of code)
5% | 5% | 12% | 14% | 63%
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
hpp12% | 9% | 9% | 11% | 56%
h12% | 0% | 8% | 21% | 57%
cpp<1% | 3% | 11% | 13% | 71%
cs0% | 3% | 21% | 18% | 56%
py0% | 0% | 11% | 18% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
MavLinkCom7% | 6% | 12% | 11% | 61%
AirLib7% | 6% | 8% | 12% | 65%
DroneShell13% | 12% | 14% | 21% | 37%
LogViewer0% | 4% | 22% | 20% | 51%
Unreal0% | 3% | 12% | 17% | 67%
PythonClient0% | 0% | 10% | 19% | 69%
ros0% | 0% | 15% | 7% | 76%
SGM0% | 0% | 30% | 36% | 32%
ros20% | 0% | 10% | 6% | 83%
Unity0% | 0% | <1% | 8% | 91%
HelloDrone0% | 0% | 0% | 100% | 0%
DroneServer0% | 0% | 0% | 100% | 0%
HelloCar0% | 0% | 0% | 100% | 0%
docker0% | 0% | 0% | 75% | 24%
HelloSpawnedDrones0% | 0% | 0% | 0% | 100%
GazeboDrone0% | 0% | 0% | 0% | 100%
azure0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
token_type scan()
in AirLib/include/common/common_utils/json.hpp
1040 170 0
token_type scan()
in MavLinkCom/common_utils/json.hpp
1040 170 0
static basic_json from_cbor_internal()
in AirLib/include/common/common_utils/json.hpp
414 169 2
static basic_json from_cbor_internal()
in MavLinkCom/common_utils/json.hpp
414 169 2
inline void InterpretEscSeq()
in DroneShell/include/linenoise.hpp
368 134 1
bool ParseCommandLine()
in MavLinkCom/MavLinkTest/main.cpp
197 56 2
MAVLINK_HELPER uint8_t mavlink_frame_char_buffer()
in MavLinkCom/mavlink/mavlink_helpers.h
228 55 5
inline int linenoiseEdit()
in DroneShell/include/linenoise.hpp
156 49 5
void GenerateLogEntryClass()
in LogViewer/LogViewer/Utilities/PX4BinaryLog.cs
174 46 2
public bool Read()
in LogViewer/LogViewer/Utilities/XmlCsvReader.cs
62 43 0
static void to_cbor_internal()
in AirLib/include/common/common_utils/json.hpp
215 42 2
static void to_cbor_internal()
in MavLinkCom/common_utils/json.hpp
215 42 2
void model()
in AirLib/include/vehicles/multirotor/firmwares/simple_flight/firmware/AdaptiveController.hpp
194 41 3
static void to_msgpack_internal()
in AirLib/include/common/common_utils/json.hpp
189 39 2
static void to_msgpack_internal()
in MavLinkCom/common_utils/json.hpp
189 39 2
void MavLinkVehicleImpl::handleMessage()
in MavLinkCom/src/impl/MavLinkVehicleImpl.cpp
294 39 2
int console()
in MavLinkCom/MavLinkTest/main.cpp
177 35 1
static basic_json from_msgpack_internal()
in AirLib/include/common/common_utils/json.hpp
197 34 2
static basic_json from_msgpack_internal()
in MavLinkCom/common_utils/json.hpp
197 34 2
void ReceiveThread()
in LogViewer/Networking/Mavlink/MavlinkChannel.cs
186 33 0