google / perfetto
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 6,922 units with 102,377 lines of code in units (42.6% of code).
    • 10 very complex units (2,834 lines of code)
    • 31 complex units (4,117 lines of code)
    • 281 medium complex units (17,756 lines of code)
    • 593 simple units (18,964 lines of code)
    • 6,007 very simple units (58,706 lines of code)
2% | 4% | 17% | 18% | 57%
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
cc3% | 5% | 20% | 18% | 52%
ts1% | 1% | 12% | 17% | 66%
h0% | 1% | 5% | 13% | 80%
py0% | 0% | 13% | 29% | 56%
js0% | 0% | 17% | 25% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src3% | 4% | 19% | 18% | 53%
ui1% | 1% | 12% | 18% | 66%
tools0% | 9% | 18% | 25% | 46%
infra0% | 0% | 17% | 25% | 56%
include0% | 0% | 1% | 8% | 90%
gn0% | 0% | 21% | 33% | 45%
python0% | 0% | 0% | 38% | 61%
ROOT0% | 0% | 0% | 25% | 74%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
440 116 2
export function genConfig()
in ui/src/controller/record_controller.ts
418 99 2
util::Status FtraceParser::ParseFtraceEvent()
in src/trace_processor/importers/ftrace/ftrace_parser.cc
304 73 2
void FuchsiaTraceParser::ParseTracePacket()
in src/trace_processor/importers/fuchsia/fuchsia_trace_parser.cc
373 64 2
util::Status ExportSlices()
in src/trace_processor/export_json.cc
227 59 0
bool SetTranslationStrategy()
in src/traced/probes/ftrace/event_info_constants.cc
69 59 3
base::Status TracingServiceImpl::EnableTracing()
in src/tracing/core/tracing_service_impl.cc
314 59 3
void FuchsiaTraceTokenizer::ParseRecord()
in src/trace_processor/importers/fuchsia/fuchsia_trace_tokenizer.cc
329 58 1
util::Status SystraceLineParser::ParseLine()
in src/trace_processor/importers/systrace/systrace_line_parser.cc
211 54 1
void Parse()
in src/perfetto_cmd/pbtxt_to_pb.cc
149 52 2
void JsonTraceParser::ParseTracePacket()
in src/trace_processor/importers/json/json_trace_parser.cc
236 45 2
util::Status ParseTrackAssociation()
in src/trace_processor/importers/proto/track_event_parser.cc
155 45 0
int Main()
in tools/proto_filter/proto_filter.cc
193 43 2
int Main()
in tools/trace_to_text/main.cc
124 41 2
bool CppObjGenerator::Generate()
in src/protozero/protoc_plugin/cppgen_plugin.cc
185 40 4
util::Status JsonTraceTokenizer::ParseInternal()
in src/trace_processor/importers/json/json_trace_tokenizer.cc
137 40 3
bool InferFtraceType()
in src/traced/probes/ftrace/proto_translation_table.cc
94 39 4
util::Status ExportMemorySnapshots()
in src/trace_processor/export_json.cc
190 36 0
util::Status SystraceTraceParser::Parse()
in src/trace_processor/importers/systrace/systrace_trace_parser.cc
116 36 1
void __attribute__()
in src/base/subprocess_posix.cc
89 35 1