facebookresearch / EGG
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 660 units with 7,579 lines of code in units (70.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (137 lines of code)
    • 7 medium complex units (630 lines of code)
    • 26 simple units (946 lines of code)
    • 626 very simple units (5,866 lines of code)
0% | 1% | 8% | 12% | 77%
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% | 1% | 8% | 12% | 77%
pl0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
egg/zoo/basic_games0% | 42% | 0% | 7% | 50%
egg/zoo/compo_vs_generalization0% | 0% | 36% | 3% | 59%
egg/zoo/objects_game0% | 0% | 26% | 18% | 55%
egg/core0% | 0% | 6% | 11% | 82%
egg/zoo/emcom_as_ssl0% | 0% | 9% | 9% | 81%
egg/zoo/language_bottleneck0% | 0% | 6% | 27% | 66%
egg/zoo/channel0% | 0% | 0% | 33% | 66%
egg/zoo/simclr0% | 0% | 0% | 12% | 87%
egg/nest0% | 0% | 0% | 40% | 59%
egg/zoo/signal_game0% | 0% | 0% | 14% | 85%
egg/zoo/compositional_efficiency0% | 0% | 0% | 4% | 95%
egg/zoo/dsprites_bvae0% | 0% | 0% | 0% | 100%
egg/zoo/simple_autoenc0% | 0% | 0% | 0% | 100%
egg/zoo/external_game0% | 0% | 0% | 0% | 100%
egg/zoo/summation0% | 0% | 0% | 0% | 100%
egg/zoo/mnist_vae0% | 0% | 0% | 0% | 100%
egg/zoo/template0% | 0% | 0% | 0% | 100%
egg/zoo/mnist_autoenc0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in egg/zoo/basic_games/play.py
137 43 1
def from_iterable()
in egg/core/interaction.py
40 19 1
def train_epoch()
in egg/core/trainers.py
48 15 1
def main()
in egg/zoo/objects_game/train.py
148 15 1
def train()
in egg/core/trainers.py
34 13 2
def main()
in egg/zoo/compo_vs_generalization/train.py
199 12 1
def intervention_message()
in egg/zoo/language_bottleneck/intervention.py
69 12 2
def main()
in egg/zoo/emcom_as_ssl/train.py
92 11 1
def _verify_batch_sizes()
in egg/core/reinforce_wrappers.py
25 10 3
def step()
in egg/zoo/simclr/LARC.py
25 10 1
def step()
in egg/zoo/emcom_as_ssl/LARC.py
25 10 1
def parse_json_sweep()
in egg/nest/common.py
20 10 1
def save_vision_model()
in egg/zoo/simclr/game_callbacks.py
17 9 2
def enumerate_attribute_value()
in egg/zoo/compositional_efficiency/dataset.py
11 9 3
def get_iterators()
in egg/zoo/objects_game/features.py
62 9 1
def main()
in egg/zoo/language_bottleneck/mnist_overfit/train.py
57 9 1
def intervention_input()
in egg/zoo/language_bottleneck/intervention.py
40 9 2
def validation()
in egg/zoo/language_bottleneck/intervention.py
29 9 2
def main()
in egg/zoo/language_bottleneck/guess_number/train.py
153 9 1
def forward()
in egg/core/reinforce_wrappers.py
39 8 3