facebookresearch / stochastic_gradient_push
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 161 units with 2,442 lines of code in units (85.4% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (164 lines of code)
    • 14 medium complex units (728 lines of code)
    • 17 simple units (629 lines of code)
    • 128 very simple units (921 lines of code)
0% | 6% | 29% | 25% | 37%
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% | 6% | 29% | 25% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 19% | 27% | 30% | 21%
gossip0% | 0% | 34% | 31% | 33%
visualization0% | 0% | 36% | 12% | 51%
experiment_utils0% | 0% | 15% | 0% | 84%
gossip/utils0% | 0% | 0% | 7% | 92%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def parse_args()
in gossip_sgd.py
81 33 0
def parse_args()
in gossip_sgd_adpsgd.py
83 30 0
def __init__()
in gossip/distributed.py
122 25 15
def _gossip_target()
in gossip/ad_psgd.py
87 19 9
def parse_transformer_out()
in visualization/plotting.py
54 17 4
def __make_backward_hook()
in gossip/distributed.py
35 16 1
def train()
in gossip_sgd.py
71 15 11
def save_checkpoint()
in experiment_utils/cluster_manager.py
26 14 3
def plot_scaling()
in visualization/plotting.py
51 13 1
def __make_backward_hook()
in gossip/ad_psgd.py
25 12 1
def _make_graph()
in gossip/graph_manager.py
15 12 1
def main()
in gossip_sgd_adpsgd.py
135 12 0
def _query_gossip_queue()
in gossip/distributed.py
36 11 2
def _make_graph()
in gossip/graph_manager.py
11 11 1
def mix()
in gossip/gossiper.py
35 11 2
def update_learning_rate()
in gossip_sgd_adpsgd.py
25 11 5
def mix()
in gossip/gossiper.py
40 10 4
def main()
in gossip_sgd.py
143 10 0
def _sync_params()
in gossip/ad_psgd.py
16 9 1
def _sync_params()
in gossip/distributed.py
16 9 1