facebookresearch / labgraph
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 1,106 units with 10,209 lines of code in units (54.0% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (517 lines of code)
    • 21 medium complex units (1,123 lines of code)
    • 62 simple units (2,048 lines of code)
    • 1,018 very simple units (6,521 lines of code)
0% | 5% | 11% | 20% | 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
py0% | 6% | 15% | 15% | 63%
hpp0% | 54% | 0% | 0% | 45%
cpp0% | 3% | 8% | 31% | 56%
h0% | 0% | 9% | 11% | 78%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Cthulhu/src0% | 7% | 7% | 23% | 61%
extensions/yaml_support0% | 40% | 15% | 6% | 37%
labgraph/runners0% | 8% | 29% | 20% | 41%
labgraph/messages0% | 13% | 5% | 11% | 69%
Cthulhu/include0% | 0% | 12% | 15% | 72%
labgraph/graphs0% | 0% | 34% | 16% | 49%
labgraph/cpp0% | 0% | 44% | 0% | 55%
labgraph/loggers0% | 0% | 25% | 24% | 50%
Cthulhu/modules0% | 0% | 0% | 46% | 53%
extensions/labgraph_viz0% | 0% | 0% | 22% | 77%
labgraph/websockets0% | 0% | 0% | 13% | 86%
labgraph/_cthulhu0% | 0% | 0% | 24% | 75%
extensions/labgraph_protocol0% | 0% | 0% | 4% | 95%
labgraph/util0% | 0% | 0% | 0% | 100%
labgraph/events0% | 0% | 0% | 0% | 100%
logging/include0% | 0% | 0% | 0% | 100%
extensions/psychopy_example0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
labgraph/zmq_node0% | 0% | 0% | 0% | 100%
Cthulhu0% | 0% | 0% | 0% | 100%
win0% | 0% | 0% | 0% | 100%
labgraph/simulations0% | 0% | 0% | 0% | 100%
labgraph/devices0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
inline void priv_open_or_create()
in Cthulhu/src/boost/interprocess/detail/managed_open_or_create_impl_ashmem.hpp
139 38 6
def visit_ClassDef()
in extensions/yaml_support/yaml_support/_parser/lg_units_parser.py
89 30 2
void SubAligner::processManifests()
in Cthulhu/src/SubAligner.cpp
136 28 3
def __init__()
in labgraph/messages/message.py
72 28 3
def run()
in labgraph/runners/local_runner.py
81 26 1
def _wait_for_startup_phase()
in labgraph/runners/process_manager.py
57 24 2
def _validate_topics()
in labgraph/graphs/graph.py
47 22 1
uint32_t findMemoryTypeIndex()
in Cthulhu/src/VulkanUtil.cpp
49 21 5
def run()
in labgraph/runners/local_runner.py
76 20 1
def get_field_type()
in labgraph/messages/types.py
28 15 1
def _terminate_gracefully()
in labgraph/runners/process_manager.py
26 15 1
void QueueingAligner::align()
in Cthulhu/src/QueueingAligner.cpp
80 14 0
void StreamIPCHybrid::sendSampleIPC()
in Cthulhu/src/StreamRegistryIPCHybrid.cpp
83 14 1
MultiTransformer Context::transform()
in Cthulhu/include/cthulhu/ContextImpl.h
101 13 5
inline void cleanup()
in Cthulhu/include/cthulhu/Framework.h
41 13 2
void Node::bootstrapStream()
in labgraph/cpp/Node.cpp
54 13 2
def _get_class_module()
in labgraph/runners/parallel_runner.py
40 13 2
def validate()
in labgraph/graphs/method.py
35 13 1
def __save_module()
in extensions/yaml_support/yaml_support/model/lg_unit_model.py
35 12 2
def write()
in labgraph/loggers/hdf5/logger.py
45 12 3