microsoft / envoy
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 4,993 units with 41,686 lines of code in units (41.7% of code).
    • 0 very complex units (0 lines of code)
    • 11 complex units (1,160 lines of code)
    • 105 medium complex units (5,401 lines of code)
    • 283 simple units (7,832 lines of code)
    • 4,594 very simple units (27,293 lines of code)
0% | 2% | 12% | 18% | 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
cc0% | 3% | 13% | 20% | 62%
py0% | 0% | 24% | 27% | 47%
h0% | 0% | 2% | 1% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/common0% | 2% | 13% | 19% | 64%
source/extensions0% | 3% | 12% | 17% | 66%
source/server0% | 0% | 10% | 20% | 69%
tools0% | 0% | 23% | 31% | 45%
tools/protodoc0% | 0% | 22% | 23% | 53%
restarter0% | 0% | 53% | 0% | 46%
tools/deprecate_version0% | 0% | 71% | 0% | 28%
api/tools0% | 0% | 0% | 48% | 51%
bazel0% | 0% | 0% | 72% | 27%
tools/envoy_collect0% | 0% | 0% | 22% | 77%
include/envoy0% | 0% | 0% | 4% | 95%
source/exe0% | 0% | 0% | 0% | 100%
configs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
long HessianUtils::peekLong()
in source/extensions/filters/network/dubbo_proxy/hessian_utils.cc
81 50 3
std::string HessianUtils::peekString()
in source/extensions/filters/network/dubbo_proxy/hessian_utils.cc
83 45 3
void HttpGrpcAccessLog::log()
in source/extensions/access_loggers/http_grpc/grpc_access_log_impl.cc
168 41 4
void DecoderImpl::parseSlice()
in source/extensions/filters/network/redis_proxy/codec_impl.cc
181 35 1
void ConnectionManagerImpl::ActiveStream::encodeHeaders()
in source/common/http/conn_manager_impl.cc
93 33 3
void RdsJson::translateRoute()
in source/common/config/rds_json.cc
122 30 2
void ConnectionManagerImpl::ActiveStream::decodeHeaders()
in source/common/http/conn_manager_impl.cc
105 30 2
int HessianUtils::peekInt()
in source/extensions/filters/network/dubbo_proxy/hessian_utils.cc
56 30 3
104 28 7
void Filter::onUpstreamReset()
in source/common/router/router.cc
69 26 2
bool BaseDynamicClusterImpl::updateDynamicHostList()
in source/common/upstream/upstream_impl.cc
98 26 6
InstanceConstSharedPtr peerAddressFromFd()
in source/common/network/address_impl.cc
212 23 1
std::string HessianUtils::peekByte()
in source/extensions/filters/network/dubbo_proxy/hessian_utils.cc
53 23 3
bool RetryStateImpl::wouldRetryFromHeaders()
in source/common/router/retry_state_impl.cc
46 22 1
bool Filter::readProxyHeader()
in source/extensions/filters/listener/proxy_protocol/proxy_protocol.cc
94 22 1
void CdsJson::translateCluster()
in source/common/config/cds_json.cc
112 21 4
void ConnectionManagerUtility::mutateXfccRequestHeader()
in source/common/http/conn_manager_utility.cc
63 20 3
void Field::buildRapidJsonDocument()
in source/common/json/json_loader.cc
73 20 3
bool ListenerManagerImpl::addOrUpdateListener()
in source/server/listener_manager_impl.cc
90 20 3
uint64_t Utility::grpcToHttpStatus()
in source/common/grpc/status.cc
41 19 1