facebookresearch / fbpcs
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 815 units with 9,107 lines of code in units (42.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (122 lines of code)
    • 7 medium complex units (605 lines of code)
    • 53 simple units (2,175 lines of code)
    • 754 very simple units (6,205 lines of code)
0% | 1% | 6% | 23% | 68%
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
cpp0% | 3% | 7% | 37% | 51%
py0% | 0% | 13% | 12% | 74%
hpp0% | 0% | 0% | 32% | 67%
h0% | 0% | 0% | 3% | 96%
java0% | 0% | 0% | 8% | 91%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fbpcs/emp_games0% | 2% | 0% | 30% | 66%
fbpcs/data_processing0% | 0% | 19% | 27% | 53%
fbpcs/private_computation_cli0% | 0% | 65% | 0% | 34%
fbpcs/pl_coordinator0% | 0% | 13% | 15% | 71%
fbpcs/infra0% | 0% | 4% | 18% | 77%
fbpcs/pid0% | 0% | 9% | 4% | 85%
fbpcs/scripts0% | 0% | 0% | 47% | 52%
fbpcs/private_computation0% | 0% | 0% | 0% | 100%
fbpcs/utils0% | 0% | 0% | 0% | 100%
fbpcs/performance_tools0% | 0% | 0% | 0% | 100%
fbpcs/stage_flow0% | 0% | 0% | 0% | 100%
fbpcs/common0% | 0% | 0% | 0% | 100%
fbpcs/experimental0% | 0% | 0% | 0% | 100%
fbpcs/post_processing_handler0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void InputData::addFromCSV()
in fbpcs/emp_games/lift/calculator/InputData.cpp
122 48 2
def main()
in fbpcs/private_computation_cli/private_computation_cli.py
224 17 1
def validate_line()
in fbpcs/infra/cloud_bridge/data_validation/validation_utility/validation.py
44 14 3
void LiftIdSpineFileCombiner::combineFile()
in fbpcs/data_processing/lift_id_combiner/LiftIdSpineFileCombiner.cpp
118 14 0
void groupBy()
in fbpcs/data_processing/id_combiner/GroupBy.cpp
74 12 4
void sortIntegralValues()
in fbpcs/data_processing/id_combiner/SortIntegralValues.cpp
72 12 4
def wait_stage_complete()
in fbpcs/pl_coordinator/pl_instance_runner.py
46 12 2
def update_instance()
in fbpcs/pid/service/pid_service/pid.py
27 11 2
virtual Aggregation reveal()
in fbpcs/emp_games/attribution/Aggregator.cpp
45 10 0
void AggMetrics::mergeWithViaAddition()
in fbpcs/emp_games/attribution/shard_aggregator/AggMetrics.cpp
53 10 1
AggregationOutputMetrics computeAggregations()
in fbpcs/emp_games/attribution/decoupled_aggregation/Aggregation.hpp
72 10 2
public void validate()
in fbpcs/infra/cloud_bridge/server/src/main/java/com/facebook/business/cloudbridge/pl/server/DeploymentParams.java
32 10 0
def get_valid_stage()
in fbpcs/pl_coordinator/pl_instance_runner.py
17 10 1
void OutputMetrics::calculateValue()
in fbpcs/emp_games/lift/calculator/OutputMetrics.hpp
77 9 4
def create()
in fbpcs/infra/cloud_bridge/deployment_helper/aws/aws_deployment_helper_tool.py
41 9 1
void idSwap()
in fbpcs/data_processing/id_combiner/IdSwap.cpp
66 9 3
void GenericSharder::shard()
in fbpcs/data_processing/sharding/GenericSharder.cpp
64 9 0
int main()
in fbpcs/emp_games/attribution/decoupled_attribution/main.cpp
92 8 2
static const std::vector parseTouchpointMetadata()
in fbpcs/emp_games/attribution/decoupled_aggregation/AggregationMetrics.cpp
47 8 3
int main()
in fbpcs/emp_games/attribution/decoupled_aggregation/main.cpp
108 8 2