tensorflow / agents
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 1,917 units with 23,702 lines of code in units (84.0% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (500 lines of code)
    • 64 medium complex units (3,791 lines of code)
    • 138 simple units (4,861 lines of code)
    • 1,710 very simple units (14,550 lines of code)
0% | 2% | 15% | 20% | 61%
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% | 2% | 15% | 20% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tf_agents/agents0% | 5% | 19% | 19% | 54%
tf_agents/networks0% | 7% | 13% | 19% | 59%
tf_agents/utils0% | 4% | 16% | 21% | 57%
tf_agents/bandits0% | 0% | 16% | 20% | 62%
tf_agents/policies0% | 0% | 16% | 28% | 55%
tf_agents/replay_buffers0% | 0% | 22% | 13% | 64%
tf_agents/environments0% | 0% | 11% | 19% | 69%
tf_agents/keras_layers0% | 0% | 28% | 9% | 62%
tf_agents/train0% | 0% | 11% | 27% | 60%
tf_agents/benchmark0% | 0% | 20% | 3% | 75%
tf_agents/distributions0% | 0% | 11% | 12% | 76%
tf_agents/metrics0% | 0% | 6% | 7% | 86%
tf_agents/trajectories0% | 0% | 7% | 45% | 47%
tf_agents/drivers0% | 0% | 0% | 30% | 69%
ROOT0% | 0% | 0% | 29% | 70%
tools0% | 0% | 0% | 14% | 85%
tf_agents/eval0% | 0% | 0% | 40% | 60%
tf_agents/system0% | 0% | 0% | 11% | 88%
tf_agents/experimental0% | 0% | 0% | 0% | 100%
tf_agents0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def prune_extra_keys()
in tf_agents/utils/nest_utils.py
42 29 2
def _train()
in tf_agents/agents/ppo/ppo_agent.py
159 29 3
def _loss()
in tf_agents/agents/categorical_dqn/categorical_dqn_agent.py
134 28 7
def __init__()
in tf_agents/networks/encoding_network.py
104 26 14
def is_batched_nested_tensors()
in tf_agents/utils/nest_utils.py
61 26 5
def _distribution()
in tf_agents/bandits/policies/boltzmann_reward_prediction_policy.py
92 23 3
def get_outer_rank()
in tf_agents/utils/nest_utils.py
49 22 2
def __init__()
in tf_agents/policies/samplers/cem_actions_sampler_continuous_and_one_hot.py
69 21 6
def soft_variables_update()
in tf_agents/utils/common.py
40 21 5
def aggregate_losses()
in tf_agents/utils/common.py
42 20 4
def _single_deterministic_pass_dataset()
in tf_agents/replay_buffers/tf_uniform_replay_buffer.py
78 19 5
def tf_summaries()
in tf_agents/metrics/tf_metric.py
39 19 3
def __init__()
in tf_agents/agents/qtopt/qtopt_agent.py
117 18 32
def assert_matching_dtypes_and_inner_shapes()
in tf_agents/utils/nest_utils.py
51 17 6
def spec_from_gym_space()
in tf_agents/environments/gym_wrapper.py
64 16 5
def __init__()
in tf_agents/environments/wrappers.py
33 16 3
def mlp_layers()
in tf_agents/networks/utils.py
56 16 7
def _as_dataset()
in tf_agents/replay_buffers/episodic_replay_buffer.py
82 15 5
def __init__()
in tf_agents/bandits/policies/neural_linucb_policy.py
114 15 12
def __init__()
in tf_agents/bandits/policies/boltzmann_reward_prediction_policy.py
85 15 10