tensorflow / runtime
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,749 units with 38,277 lines of code in units (25.6% of code).
    • 1 very complex units (97 lines of code)
    • 7 complex units (878 lines of code)
    • 89 medium complex units (5,161 lines of code)
    • 209 simple units (6,503 lines of code)
    • 3,443 very simple units (25,638 lines of code)
<1% | 2% | 13% | 16% | 66%
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
cc<1% | 1% | 14% | 19% | 63%
h0% | 4% | 9% | 8% | 77%
py0% | 0% | 18% | 0% | 81%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/bef_converter4% | 6% | 20% | 20% | 47%
backends/common0% | 14% | 10% | 21% | 53%
backends/gpu0% | 2% | 6% | 12% | 79%
lib/core_runtime0% | 3% | 29% | 25% | 41%
lib/distributed_runtime0% | 0% | 27% | 27% | 44%
lib/basic_kernels0% | 0% | 37% | 16% | 45%
lib/data0% | 0% | 19% | 19% | 61%
backends/jitrt0% | 0% | 15% | 19% | 64%
lib/bef_executor0% | 0% | 33% | 32% | 34%
include/tfrt0% | 0% | 5% | 2% | 92%
backends/cpu0% | 0% | 12% | 21% | 66%
lib/bef_executor_driver0% | 0% | 52% | 44% | 3%
lib/tensor0% | 0% | 8% | 14% | 76%
lib/compiler0% | 0% | 21% | 32% | 45%
tools/code_size_test_app0% | 0% | 90% | 0% | 9%
lib/support0% | 0% | 13% | 28% | 57%
lib/host_context0% | 0% | 0% | 27% | 72%
tools/btf_info_tool0% | 0% | 0% | 83% | 16%
lib/bef0% | 0% | 0% | 73% | 26%
lib/io0% | 0% | 0% | 36% | 63%
lib/tracing0% | 0% | 0% | 17% | 82%
mlir_tests/bef_perf0% | 0% | 0% | 0% | 100%
cpp_tests/core_runtime0% | 0% | 0% | 0% | 100%
lib/utils0% | 0% | 0% | 0% | 100%
cpp_tests/tracing0% | 0% | 0% | 0% | 100%
lib0% | 0% | 0% | 0% | 100%
tools/bef_executor0% | 0% | 0% | 0% | 100%
lib/dtype0% | 0% | 0% | 0% | 100%
mlir_tests0% | 0% | 0% | 0% | 100%
lib/metrics0% | 0% | 0% | 0% | 100%
cpp_tests/include0% | 0% | 0% | 0% | 100%
tools/tfrt_opt0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
BEFAttributeType BefAttrEmitter::GetBefAttributeType()
in lib/bef_converter/mlir_to_bef/bef_attr_emitter.cc
97 63 1
Expected Parse()
in backends/gpu/lib/wrapper/cublas_enums.cc
54 45 1
EIGEN_DONT_INLINE void operator()
in backends/common/include/tfrt/common/compat/eigen/spatial_convolution_data_mapper.h
138 39 0
EIGEN_DONT_INLINE void operator()
in backends/common/include/tfrt/common/compat/eigen/spatial_convolution_data_mapper.h
145 39 0
LogicalResult EntityTable::Collect()
in lib/bef_converter/mlir_to_bef/mlir_to_bef.cc
128 35 2
EIGEN_ALWAYS_INLINE void packStandardPatches()
in backends/common/include/tfrt/common/compat/eigen/spatial_convolution_data_mapper.h
129 31 4
static llvm::Expected ComputeConvGpuOp()
in backends/gpu/lib/ops/tf/dnn_ops.cc
201 31 5
static void PrintElement()
in lib/core_runtime/op_attrs.cc
83 26 3
int RunBefExecutor()
in lib/bef_executor_driver/bef_executor_driver.cc
140 25 3
static mlir::Type DecodeTypeAttribute()
in lib/bef_converter/bef_to_mlir/bef_attr_reader.cc
53 24 2
OpAttrType GetOpAttrTypeFromDType()
in lib/core_runtime/op_attrs.cc
53 24 1
mlir::Attribute BefAttrReader::ReadAttribute()
in lib/bef_converter/bef_to_mlir/bef_attr_reader.cc
92 22 2
size_t BefAttrEmitter::EmitAttribute()
in lib/bef_converter/mlir_to_bef/bef_attr_emitter.cc
63 21 2
llvm::Error operator()
in backends/gpu/lib/ops/tf/dnn_ops.cu.cc
90 21 0
91 20 3
Error SyncBEFFunction::Init()
in lib/bef_executor/bef_file.cc
64 20 0
void RequestHandler::HandleRemoteExecute()
in lib/distributed_runtime/request_handler_impl.cc
138 20 3
void ExecuteWithResultMetadataResolved()
in include/tfrt/core_runtime/dispatch_utils.h
69 19 11
std::pair GetHostSizeAndAlignment()
in lib/core_runtime/op_attrs.cc
43 19 2
size_t GetAlignmentPaddingSize()
in lib/core_runtime/op_attrs.cc
61 19 3