tensorflow / tflite-micro
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 3,006 units with 43,306 lines of code in units (65.6% of code).
    • 5 very complex units (2,658 lines of code)
    • 1 complex units (216 lines of code)
    • 83 medium complex units (5,682 lines of code)
    • 166 simple units (6,953 lines of code)
    • 2,751 very simple units (27,797 lines of code)
6% | <1% | 13% | 16% | 64%
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
h10% | 0% | 11% | 12% | 64%
cc2% | <1% | 13% | 17% | 64%
py0% | 0% | 20% | 22% | 57%
c0% | 0% | 11% | 24% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow/lite/schema21% | 0% | 1% | 4% | 73%
tensorflow/lite/core36% | 0% | 4% | 3% | 56%
tensorflow/lite/micro0% | <1% | 13% | 18% | 66%
tensorflow/lite/kernels0% | 0% | 25% | 23% | 50%
tensorflow/lite/tools0% | 0% | 45% | 6% | 47%
tensorflow/lite/experimental0% | 0% | 11% | 27% | 61%
tensorflow/lite/c0% | 0% | 0% | 29% | 70%
tensorflow/lite0% | 0% | 0% | 0% | 100%
tensorflow/lite/python0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
TfLiteStatus ParseOpDataTfLite()
in tensorflow/lite/core/api/flatbuffer_conversions.cc
660 185 5
inline bool VerifyBuiltinOptions()
in tensorflow/lite/schema/schema_generated.h
472 118 3
inline flatbuffers::Offset BuiltinOptionsUnion::Pack()
in tensorflow/lite/schema/schema_generated.h
469 117 2
inline BuiltinOptionsUnion::BuiltinOptionsUnion()
in tensorflow/lite/schema/schema_generated.h
470 117 1
inline void BuiltinOptionsUnion::Reset()
in tensorflow/lite/schema/schema_generated.h
587 117 0
TfLiteStatus CheckInputTensorDimensions()
in tensorflow/lite/micro/kernels/xtensa/unidirectional_sequence_lstm.cc
216 33 7
inline void ShuffledFullyConnected()
in tensorflow/lite/kernels/internal/reference/fully_connected.h
111 23 10
TfLiteStatus PrepareQuantizeReference()
in tensorflow/lite/micro/kernels/quantize_common.cc
44 22 2
bool Verify()
in tensorflow/lite/schema/schema_generated.h
24 22 1
inline bool QuantizedMeanOrSum()
in tensorflow/lite/kernels/internal/reference/reduce.h
77 21 17
inline bool ProcessBroadcastShapes()
in tensorflow/lite/kernels/internal/reference/process_broadcast_shapes.h
74 21 3
def gdb_log_parser()
in tensorflow/lite/micro/kernels/vexriscv/utils/log_parser.py
47 20 5
int FilterbankPopulateState()
in tensorflow/lite/experimental/microfrontend/lib/filterbank_util.c
114 20 4
inline void PadImpl()
in tensorflow/lite/kernels/internal/reference/pad.h
70 20 6
TfLiteStatus AllocationInfoBuilder::AddTensors()
in tensorflow/lite/micro/micro_allocator.cc
56 19 3
TfLiteStatus EvalMean()
in tensorflow/lite/micro/kernels/reduce.cc
113 19 2
inline void TransposeConv()
in tensorflow/lite/kernels/internal/reference/transpose_conv.h
74 18 11
void GreedyMemoryPlanner::CalculateOffsetsIfNeeded()
in tensorflow/lite/micro/memory_planner/greedy_memory_planner.cc
96 17 0
TfLiteStatus EvalMliQuantizedPerChannel()
in tensorflow/lite/micro/kernels/arc_mli/conv.cc
142 17 8
bool Verify()
in tensorflow/lite/schema/schema_generated.h
19 17 1