microsoft / ros_azure_iothub
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 18 units with 508 lines of code in units (77.0% of code).
    • 1 very long units (123 lines of code)
    • 1 long units (79 lines of code)
    • 6 medium size units (212 lines of code)
    • 5 small units (61 lines of code)
    • 5 very small units (33 lines of code)
24% | 15% | 41% | 12% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp24% | 15% | 41% | 12% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
roscpp_azure_iothub/src25% | 16% | 43% | 10% | 5%
dynamic_tutorials/src0% | 0% | 0% | 64% | 35%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
static void deviceTwinCallback()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
123 23 4
void topicCallback()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
79 8 6
static int device_method_callback()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
43 5 6
static bool InitializeAzureIoTHub()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
42 6 1
static IOTHUBMESSAGE_DISPOSITION_RESULT receive_msg_callback()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
41 6 2
static bool InitializeX509Certificate()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
35 5 2
static bool ReadKeyFromFile()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
30 4 2
static bool IsTopicAvailableForSubscribe()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
21 4 1
static void connection_status_callback()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
13 2 3
void sendMsgToAzureIoTHub()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
13 1 2
void buildReportedString()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
12 2 2
int main()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
12 2 2
int main()
in dynamic_tutorials/src/server.cpp
11 1 2
static void subscribeTopic()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
10 1 2
void callback()
in dynamic_tutorials/src/server.cpp
6 1 2
static void send_confirm_callback()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
6 1 2
static void DeinitializeAzureIoTHub()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
6 1 1
static void reportedStateCallback()
in roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp
5 1 2