firebase / grpc-SwiftPM
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 12,649 units with 113,366 lines of code in units (43.3% of code).
    • 6 very complex units (1,737 lines of code)
    • 13 complex units (2,120 lines of code)
    • 179 medium complex units (11,389 lines of code)
    • 545 simple units (17,269 lines of code)
    • 11,906 very simple units (80,851 lines of code)
1% | 1% | 10% | 15% | 71%
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
cc2% | 2% | 14% | 20% | 59%
py0% | 4% | 10% | 11% | 73%
c0% | 0% | 6% | 13% | 80%
cs0% | 0% | 2% | 9% | 88%
h0% | 0% | <1% | 4% | 95%
go0% | 0% | 16% | 10% | 72%
rb0% | 0% | 0% | 15% | 84%
pxi0% | 0% | 0% | 4% | 95%
php0% | 0% | 0% | 5% | 94%
m0% | 0% | 0% | 0% | 100%
pyx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src1% | 1% | 10% | 16% | 70%
tools0% | 8% | 17% | 14% | 60%
include0% | 0% | 0% | 5% | 94%
spm-cpp-include0% | 0% | 0% | 5% | 94%
ROOT0% | 0% | 0% | 77% | 22%
spm-core-include0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
JsonReader::Status JsonReader::Run()
in src/core/lib/json/json_reader.cc
484 218 0
static bool op_can_be_run()
in src/core/ext/transport/cronet/transport/cronet_transport.cc
142 73 4
static grpc_call_error call_start_batch()
in src/core/lib/surface/call.cc
374 60 5
void perform_stream_op()
in src/core/ext/transport/inproc/inproc_transport.cc
148 59 3
void op_state_machine_locked()
in src/core/ext/transport/inproc/inproc_transport.cc
233 58 2
static enum e_op_result execute_stream_op()
in src/core/ext/transport/cronet/transport/cronet_transport.cc
356 58 1
std::unique_ptr ServerBuilder::BuildAndStart()
in src/cpp/server/server_builder.cc
155 42 0
static void perform_stream_op_locked()
in src/core/ext/transport/chttp2/transport/chttp2_transport.cc
270 40 2
void PrintHeaderService()
in src/compiler/cpp_generator.cc
201 36 3
183 35 10
def main()
in tools/buildgen/mako_renderer.py
123 33 1
def mako_plugin()
in tools/buildgen/plugins/expand_filegroups.py
94 33 1
static bool gzip_flate()
in src/core/lib/compression/stream_compression_gzip.cc
91 33 7
void CallData::AddSubchannelBatchesForPendingBatches()
in src/core/ext/filters/client_channel/client_channel.cc
89 33 3
def massage_qps_stats()
in tools/run_tests/performance/massage_qps_stats.py
490 30 1
std::unique_ptr ParseRetryPolicy()
in src/core/ext/filters/client_channel/resolver_result_parsing.cc
107 30 2
static bool read_channel_args()
in src/core/ext/transport/chttp2/transport/chttp2_transport.cc
152 29 3
130 27 10
static size_t parse_pchar()
in src/core/lib/uri/uri_parser.cc
35 26 2
127 25 2