tensorflow / tflite-micro-arduino-examples
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 2,601 units with 32,420 lines of code in units (67.0% of code).
    • 5 very complex units (2,658 lines of code)
    • 0 complex units (0 lines of code)
    • 67 medium complex units (4,043 lines of code)
    • 128 simple units (4,601 lines of code)
    • 2,401 very simple units (21,118 lines of code)
8% | 0% | 12% | 14% | 65%
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
h11% | 0% | 12% | 12% | 63%
cpp4% | 0% | 12% | 15% | 67%
c0% | 0% | 15% | 22% | 62%
py0% | 0% | 6% | 22% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/tensorflow/lite/schema21% | 0% | 1% | 4% | 73%
src/tensorflow/lite/core/api36% | 0% | 4% | 3% | 56%
src/tensorflow/lite/kernels/internal0% | 0% | 26% | 24% | 49%
src/tensorflow/lite/micro/kernels0% | 0% | 12% | 17% | 70%
src/tensorflow/lite/micro0% | 0% | 13% | 10% | 76%
src/tensorflow/lite/micro/memory_planner0% | 0% | 39% | 9% | 51%
src/tensorflow/lite/experimental/microfrontend0% | 0% | 15% | 25% | 58%
src/tensorflow/lite/kernels0% | 0% | 14% | 15% | 69%
scripts0% | 0% | 6% | 22% | 70%
src/tensorflow/lite/c0% | 0% | 0% | 29% | 70%
src/tensorflow/lite0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
TfLiteStatus ParseOpDataTfLite()
in src/tensorflow/lite/core/api/flatbuffer_conversions.cpp
660 185 5
inline bool VerifyBuiltinOptions()
in src/tensorflow/lite/schema/schema_generated.h
472 118 3
inline flatbuffers::Offset BuiltinOptionsUnion::Pack()
in src/tensorflow/lite/schema/schema_generated.h
469 117 2
inline BuiltinOptionsUnion::BuiltinOptionsUnion()
in src/tensorflow/lite/schema/schema_generated.h
470 117 1
inline void BuiltinOptionsUnion::Reset()
in src/tensorflow/lite/schema/schema_generated.h
587 117 0
inline void ShuffledFullyConnected()
in src/tensorflow/lite/kernels/internal/reference/fully_connected.h
111 23 10
TfLiteStatus PrepareQuantizeReference()
in src/tensorflow/lite/micro/kernels/quantize_common.cpp
41 22 2
bool Verify()
in src/tensorflow/lite/schema/schema_generated.h
24 22 1
inline bool QuantizedMeanOrSum()
in src/tensorflow/lite/kernels/internal/reference/reduce.h
77 21 17
inline bool ProcessBroadcastShapes()
in src/tensorflow/lite/kernels/internal/reference/process_broadcast_shapes.h
74 21 3
int FilterbankPopulateState()
in src/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.c
114 20 4
inline void PadImpl()
in src/tensorflow/lite/kernels/internal/reference/pad.h
70 20 6
TfLiteStatus AllocationInfoBuilder::AddTensors()
in src/tensorflow/lite/micro/micro_allocator.cpp
56 19 3
TfLiteStatus EvalMean()
in src/tensorflow/lite/micro/kernels/reduce.cpp
113 19 2
inline void TransposeConv()
in src/tensorflow/lite/kernels/internal/reference/transpose_conv.h
74 18 11
void GreedyMemoryPlanner::CalculateOffsetsIfNeeded()
in src/tensorflow/lite/micro/memory_planner/greedy_memory_planner.cpp
96 17 0
bool Verify()
in src/tensorflow/lite/schema/schema_generated.h
19 17 1
TfLiteStatus ConvertTensorType()
in src/tensorflow/lite/core/api/flatbuffer_conversions.cpp
58 17 3
inline void TransposeConv()
in src/tensorflow/lite/kernels/internal/reference/transpose_conv.h
90 17 12
inline void TransposeConv()
in src/tensorflow/lite/kernels/internal/reference/integer_ops/transpose_conv.h
87 17 14