facebookresearch / fbpcp
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 241 units with 1,646 lines of code in units (47.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (211 lines of code)
    • 7 simple units (210 lines of code)
    • 230 very simple units (1,225 lines of code)
0% | 0% | 12% | 12% | 74%
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
py0% | 0% | 12% | 12% | 74%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fbpcp/service0% | 0% | 20% | 2% | 77%
pce/validator0% | 0% | 28% | 30% | 40%
onedocker/script0% | 0% | 0% | 31% | 68%
fbpcp/decorator0% | 0% | 0% | 51% | 48%
fbpcp/error0% | 0% | 0% | 40% | 59%
fbpcp/gateway0% | 0% | 0% | 0% | 100%
fbpcp/mapper0% | 0% | 0% | 0% | 100%
fbpcp/util0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
onedocker/repository0% | 0% | 0% | 0% | 100%
pce/gateway0% | 0% | 0% | 0% | 100%
onedocker/common0% | 0% | 0% | 0% | 100%
fbpcp/metrics0% | 0% | 0% | 0% | 100%
fbpcp/repository0% | 0% | 0% | 0% | 100%
pce/mapper0% | 0% | 0% | 0% | 100%
fbpcp/entity0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def copy()
in fbpcp/service/storage_gcs.py
59 15 4
def validate_firewall()
in pce/validator/validation_suite.py
56 12 2
def validate_route_table()
in pce/validator/validation_suite.py
44 12 2
def copy()
in fbpcp/service/storage_s3.py
52 11 4
def main()
in onedocker/script/cli/onedocker_cli.py
47 8 0
def validate_cluster_definition()
in pce/validator/validation_suite.py
56 7 2
def validate_roles()
in pce/validator/validation_suite.py
48 7 2
def error_counter()
in fbpcp/decorator/metrics.py
20 6 1
def error_handler()
in fbpcp/decorator/error_handler.py
16 6 1
def _get_instance_status()
in fbpcp/service/mpc.py
12 6 2
def map_k8s_error()
in fbpcp/error/mapper/k8s.py
11 6 1
def validate_subnets()
in pce/validator/validation_suite.py
18 5 2
def validate_network_and_compute()
in pce/validator/validation_suite.py
25 5 2
18 5 2
def map_ec2route_to_route()
in fbpcp/mapper/aws.py
15 5 2
def update_instance()
in fbpcp/service/mpc.py
18 5 2
def _get_network()
in fbpcp/service/pce_aws.py
22 5 2
def _get_compute()
in fbpcp/service/pce_aws.py
16 5 2
def summarize_errors()
in pce/validator/validation_suite.py
11 4 2
def main()
in scripts/compare_package_version.py
14 4 0