facebookresearch / FLSim
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 937 units with 5,278 lines of code in units (52.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (144 lines of code)
    • 19 simple units (457 lines of code)
    • 913 very simple units (4,677 lines of code)
0% | 0% | 2% | 8% | 88%
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% | 2% | 8% | 88%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts0% | 0% | 25% | 40% | 33%
flsim/data0% | 0% | 11% | 0% | 88%
flsim/utils0% | 0% | <1% | 1% | 98%
flsim/active_user_selectors0% | 0% | 0% | 34% | 65%
flsim/optimizers0% | 0% | 0% | 8% | 91%
flsim/common0% | 0% | 0% | 11% | 88%
flsim/privacy0% | 0% | 0% | 9% | 90%
flsim/reducers0% | 0% | 0% | 4% | 95%
flsim/trainers0% | 0% | 0% | 0% | 100%
flsim/channels0% | 0% | 0% | 0% | 100%
flsim/servers0% | 0% | 0% | 0% | 100%
flsim/clients0% | 0% | 0% | 0% | 100%
flsim/interfaces0% | 0% | 0% | 0% | 100%
flsim/secure_aggregation0% | 0% | 0% | 0% | 100%
flsim/metrics_reporter0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _handle_aggregator()
in scripts/old_config_converter.py
34 25 1
def _handle_async_weight()
in scripts/old_config_converter.py
40 16 1
def fl_train_set()
in flsim/data/dataset_data_loader.py
30 12 2
def _handle_active_user_selector()
in scripts/old_config_converter.py
25 11 1
def _maybe_set_up_user_private_modules()
in flsim/utils/fl/personalized_model.py
15 11 2
def _handle_timeout_simulator()
in scripts/old_config_converter.py
32 10 1
def _handle_aggregator_reducer()
in scripts/old_config_converter.py
33 10 1
def step()
in flsim/optimizers/local_optimizers.py
32 10 2
def _handle_duration_distribution_generator()
in scripts/old_config_converter.py
21 9 1
11 9 2
def _handle_lr_scheduler()
in scripts/old_config_converter.py
19 8 1
def _handle_trainer_to_client_params()
in scripts/old_config_converter.py
22 8 1
def _get_metrics_of_interest()
in flsim/common/diversity_metrics.py
20 8 2
def get_user_indices()
in flsim/active_user_selectors/diverse_user_selector.py
61 8 2
def _handle_lr_scheduler_in_client()
in scripts/old_config_converter.py
17 7 1
def assertAlmostEqual()
in flsim/common/pytest_helper.py
18 7 5
def get_user_indices()
in flsim/active_user_selectors/diverse_user_selector.py
50 7 2
def get_user_indices()
in flsim/active_user_selectors/diverse_user_selector.py
45 7 2
def _check_boundaries()
in flsim/reducers/weighted_dp_round_reducer.py
12 7 1
def _handle_optimizer()
in scripts/old_config_converter.py
15 6 1