microsoft / AirSim
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 5,798 units with 73,012 lines of code in units (44.1% of code).
    • 42 very long units (9,078 lines of code)
    • 124 long units (8,435 lines of code)
    • 588 medium size units (17,914 lines of code)
    • 1,121 small units (16,271 lines of code)
    • 3,923 very small units (21,314 lines of code)
12% | 11% | 24% | 22% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hpp23% | 8% | 19% | 17% | 30%
cpp5% | 11% | 25% | 27% | 29%
cs9% | 17% | 31% | 20% | 22%
h12% | 14% | 25% | 16% | 30%
py0% | 10% | 33% | 15% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
MavLinkCom16% | 10% | 21% | 24% | 27%
AirLib15% | 8% | 20% | 19% | 35%
LogViewer9% | 19% | 33% | 19% | 19%
DroneShell19% | 23% | 30% | 11% | 14%
ros10% | 7% | 32% | 32% | 17%
ros29% | 0% | 36% | 31% | 21%
SGM14% | 48% | 26% | 8% | 2%
HelloDrone100% | 0% | 0% | 0% | 0%
Unreal0% | 15% | 27% | 28% | 29%
PythonClient0% | 9% | 30% | 15% | 44%
DroneServer0% | 100% | 0% | 0% | 0%
HelloSpawnedDrones0% | 68% | 31% | 0% | 0%
HelloCar0% | 100% | 0% | 0% | 0%
Unity0% | 0% | 22% | 24% | 52%
GazeboDrone0% | 0% | 83% | 16% | 0%
docker0% | 0% | 75% | 0% | 24%
azure0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest 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
void MavLinkVehicleImpl::handleMessage()
in MavLinkCom/src/impl/MavLinkVehicleImpl.cpp
294 39 2
MAVLINK_HELPER uint8_t mavlink_frame_char_buffer()
in MavLinkCom/mavlink/mavlink_helpers.h
228 55 5
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
static basic_json from_msgpack_internal()
in AirLib/include/common/common_utils/json.hpp
197 34 2
bool ParseCommandLine()
in MavLinkCom/MavLinkTest/main.cpp
197 56 2
static basic_json from_msgpack_internal()
in MavLinkCom/common_utils/json.hpp
197 34 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
basic_json patch()
in AirLib/include/common/common_utils/json.hpp
189 31 1
static void to_msgpack_internal()
in MavLinkCom/common_utils/json.hpp
189 39 2
basic_json patch()
in MavLinkCom/common_utils/json.hpp
189 31 1
void ReceiveThread()
in LogViewer/Networking/Mavlink/MavlinkChannel.cs
186 33 0
int console()
in MavLinkCom/MavLinkTest/main.cpp
177 35 1
private void GenerateMessages()
in MavLinkCom/MavLinkComGenerator/MavLinkGenerator.cs
176 25 0