bazelbuild / rules_swift
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 50 units with 791 lines of code in units (6.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (261 lines of code)
    • 5 simple units (179 lines of code)
    • 41 very simple units (351 lines of code)
0% | 0% | 32% | 22% | 44%
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
cc0% | 0% | 35% | 24% | 40%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools/worker0% | 0% | 50% | 21% | 27%
tools/common0% | 0% | 0% | 24% | 75%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void WorkProcessor::ProcessWorkRequest()
in tools/worker/work_processor.cc
106 23 2
bool SwiftRunner::ProcessArgument()
in tools/worker/swift_runner.cc
56 14 3
void OutputFileMap::UpdateForIncremental()
in tools/worker/output_file_map.cc
70 13 1
static std::string Unescape()
in tools/worker/swift_runner.cc
29 11 1
bool MakeDirs()
in tools/common/file_system.cc
31 9 2
std::vector SwiftRunner::ParseArguments()
in tools/worker/swift_runner.cc
29 8 1
int RunSubProcess()
in tools/common/process.cc
37 8 3
int SwiftRunner::Run()
in tools/worker/swift_runner.cc
49 6 2
33 6 2
static std::unique_ptr WriteResponseFile()
in tools/worker/swift_runner.cc
17 5 1
static std::string MakeIncrementalOutputPath()
in tools/worker/output_file_map.cc
22 5 2
std::string ReplaceExtension()
in tools/common/path_utils.cc
22 5 3
std::vector SwiftRunner::ProcessArguments()
in tools/worker/swift_runner.cc
24 4 1
int CompileWithWorker()
in tools/worker/compile_with_worker.cc
26 4 1
17 4 1
bool CopyFile()
in tools/common/file_system.cc
27 4 2
bool ArgumentEnablesWMO()
in tools/worker/swift_runner.cc
4 3 1
static std::unique_ptr Create()
in tools/common/temp_file.h
15 3 1
static std::unique_ptr Create()
in tools/common/temp_file.h
16 3 1
bool BazelPlaceholderSubstitutions::FindAndReplace()
in tools/common/bazel_substitutions.cc
17 3 3