facebookresearch / ReAgent
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 2,129 units with 17,277 lines of code in units (52.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (67 lines of code)
    • 22 medium complex units (1,341 lines of code)
    • 81 simple units (2,327 lines of code)
    • 2,025 very simple units (13,542 lines of code)
0% | <1% | 7% | 13% | 78%
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% | 6% | 12% | 80%
scala0% | 0% | 35% | 9% | 54%
cpp0% | 0% | 13% | 27% | 59%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
serving/reagent0% | 4% | 8% | 22% | 63%
reagent/training0% | 0% | 15% | 17% | 66%
reagent/gym0% | 0% | 11% | 9% | 78%
preprocessing/src0% | 0% | 35% | 9% | 54%
reagent/ope0% | 0% | 7% | 22% | 69%
reagent/replay_memory0% | 0% | 14% | 19% | 65%
reagent/evaluation0% | 0% | 3% | 19% | 76%
reagent/core0% | 0% | 2% | 22% | 75%
reagent/preprocessing0% | 0% | 0% | 7% | 92%
reagent/lite0% | 0% | 0% | 7% | 92%
reagent/model_managers0% | 0% | 0% | 3% | 96%
reagent/optimizer0% | 0% | 0% | 25% | 74%
reagent/mab0% | 0% | 0% | 7% | 92%
reagent/data0% | 0% | 0% | 4% | 95%
reagent/workflow0% | 0% | 0% | 5% | 94%
reagent/models0% | 0% | 0% | <1% | 99%
reagent/reporting0% | 0% | 0% | 0% | 100%
reagent/prediction0% | 0% | 0% | 0% | 100%
reagent/net_builder0% | 0% | 0% | 0% | 100%
reagent/model_utils0% | 0% | 0% | 0% | 100%
reagent/publishers0% | 0% | 0% | 0% | 100%
reagent/scripts0% | 0% | 0% | 0% | 100%
reagent/samplers0% | 0% | 0% | 0% | 100%
reagent/validators0% | 0% | 0% | 0% | 100%
serving/scripts0% | 0% | 0% | 0% | 100%
serving0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _value_to_json()
in serving/reagent/serving/config/serialize.py
67 30 2
def create_for_env()
in reagent/gym/preprocessors/replay_buffer_inserters.py
78 19 2
def __call__()
in reagent/gym/preprocessors/replay_buffer_inserters.py
36 19 3
def _see_ghost()
in reagent/gym/envs/pomdp/pocman.py
35 19 2
def run()
in preprocessing/src/main/scala/com/facebook/spark/rl/Timeline.scala
199 19 2
def sample_transition_batch()
in reagent/replay_memory/circular_replay_buffer.py
58 18 3
def train_step_gen()
in reagent/training/sac_trainer.py
136 17 3
def _state_value()
in reagent/ope/trainers/rl_tabular_trainers.py
39 15 2
def evaluate()
in reagent/ope/estimators/sequential_estimators.py
101 15 3
void constant_value_to_json()
in serving/reagent/serving/core/Containers.cpp
36 13 2
def training_step()
in reagent/training/ranking/seq2slate_trainer.py
84 13 3
def step()
in reagent/gym/envs/pomdp/pocman.py
44 13 2
def add()
in reagent/replay_memory/circular_replay_buffer.py
26 13 2
ConstantValue json_to_constant_value()
in serving/reagent/serving/core/Containers.cpp
38 12 1
def __getattr__()
in reagent/core/types.py
26 12 2
def evaluate()
in reagent/ope/estimators/estimator.py
37 12 1
StringOperatorDataMap OperatorRunner::run()
in serving/reagent/serving/core/OperatorRunner.cpp
58 11 4
def _simulated_training_input()
in reagent/training/ranking/seq2slate_sim_trainer.py
66 11 2
def train_step_gen()
in reagent/training/c51_trainer.py
60 11 3
def train_step_gen()
in reagent/training/slate_q_trainer.py
58 11 3