tensorflow / agents
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 11% duplication:
    • 25,719 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,060 duplicated lines
  • 261 duplicates
system11% (3,060 lines)
Duplication per Extension
py11% (3,060 lines)
Duplication per Component (primary)
tf_agents/bandits23% (1,215 lines)
tf_agents/agents16% (842 lines)
tf_agents/policies9% (287 lines)
tf_agents/networks12% (190 lines)
tf_agents/metrics13% (100 lines)
tf_agents/replay_buffers5% (94 lines)
tf_agents/trajectories15% (91 lines)
tf_agents/utils2% (60 lines)
tf_agents/train6% (54 lines)
tf_agents/environments2% (49 lines)
tf_agents/drivers15% (40 lines)
tf_agents/keras_layers7% (38 lines)
tf_agents/distributions0% (0 lines)
tf_agents/experimental0% (0 lines)
tf_agents0% (0 lines)
tf_agents/system0% (0 lines)
tf_agents/eval0% (0 lines)
tf_agents/typing0% (0 lines)
tf_agents/benchmark0% (0 lines)
ROOT0% (0 lines)
tools0% (0 lines)

Duplication Between Components (50+ lines)

G tf_agents/bandits tf_agents/bandits tf_agents/networks tf_agents/networks tf_agents/bandits--tf_agents/networks 56 tf_agents/agents tf_agents/agents tf_agents/agents--tf_agents/bandits 51 tf_agents/agents--tf_agents/networks 53

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 261 duplicates...
Size#FoldersFilesLinesCode
43 x 2 tf_agents/policies/samplers
tf_agents/policies/samplers
cem_actions_sampler_continuous.py
cem_actions_sampler_continuous_and_on...
122:176 (40%)
380:434 (15%)
view
32 x 2 tf_agents/bandits/environments
tf_agents/bandits/environments
drifting_linear_environment.py
piecewise_stochastic_environment.py
155:191 (24%)
114:150 (25%)
view
25 x 2 tf_agents/bandits/policies
tf_agents/bandits/policies
boltzmann_reward_prediction_policy.py
greedy_reward_prediction_policy.py
191:219 (13%)
150:178 (18%)
view
23 x 2 tf_agents/agents/ppo
tf_agents/agents/ppo
ppo_agent.py
ppo_clip_agent.py
116:138 (2%)
72:94 (31%)
view
22 x 2 tf_agents/bandits/policies
tf_agents/bandits/policies
boltzmann_reward_prediction_policy.py
greedy_reward_prediction_policy.py
141:164 (11%)
105:128 (16%)
view
22 x 2 tf_agents/agents/dqn
tf_agents/agents/qtopt
dqn_agent.py
qtopt_agent.py
393:418 (7%)
499:526 (6%)
view
19 x 2 tf_agents/bandits/networks
tf_agents/networks
heteroscedastic_q_network.py
q_network.py
105:125 (28%)
100:120 (33%)
view
18 x 2 tf_agents/bandits/policies
tf_agents/bandits/policies
greedy_multi_objective_neural_policy.py
greedy_reward_prediction_policy.py
85:147 (9%)
50:100 (13%)
view
17 x 2 tf_agents/agents/cql
tf_agents/agents/sac
cql_sac_agent.py
sac_agent.py
72:88 (3%)
72:88 (3%)
view
17 x 2 tf_agents/bandits/environments
tf_agents/bandits/environments
drifting_linear_environment.py
piecewise_stochastic_environment.py
207:227 (13%)
184:204 (13%)
view
17 x 2 tf_agents/agents/ddpg
tf_agents/agents/td3
ddpg_agent.py
td3_agent.py
243:260 (7%)
289:306 (5%)
view
16 x 2 tf_agents/bandits/agents
tf_agents/bandits/agents
greedy_multi_objective_neural_agent.py
greedy_reward_prediction_agent.py
192:211 (8%)
223:242 (7%)
view
16 x 2 tf_agents/bandits/policies
tf_agents/bandits/policies
boltzmann_reward_prediction_policy.py
greedy_reward_prediction_policy.py
167:184 (8%)
131:148 (11%)
view
15 x 2 tf_agents/metrics
tf_agents/metrics
tf_metrics.py
tf_metrics.py
168:190 (5%)
252:274 (5%)
view
15 x 2 tf_agents/metrics
tf_agents/metrics
tf_metrics.py
tf_metrics.py
168:190 (5%)
210:232 (5%)
view
15 x 2 tf_agents/bandits/agents
tf_agents/bandits/agents
lin_ucb_agent.py
linear_bandit_agent.py
51:65 (35%)
157:171 (4%)
view
15 x 2 tf_agents/agents/sac
tf_agents/agents/td3
sac_agent.py
td3_agent.py
454:472 (3%)
248:264 (4%)
view
15 x 2 tf_agents/bandits/agents
tf_agents/bandits/agents
neural_boltzmann_agent.py
neural_epsilon_greedy_agent.py
127:141 (27%)
136:150 (30%)
view
15 x 2 tf_agents/metrics
tf_agents/metrics
tf_metrics.py
tf_metrics.py
210:232 (5%)
252:274 (5%)
view
15 x 2 tf_agents/agents/cql
tf_agents/agents/sac
cql_sac_agent.py
sac_agent.py
752:771 (3%)
549:568 (3%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
11 x 2 tf_agents/metrics
tf_agents/metrics
tf_metrics.py
tf_metrics.py
0:0 
0:0 
view
7 x 2 tf_agents/bandits/environments
tf_agents/bandits/environments
piecewise_stochastic_environment.py
drifting_linear_environment.py
0:0 
0:0 
view
6 x 2 tf_agents/bandits/environments
tf_agents/bandits/environments
piecewise_stochastic_environment.py
drifting_linear_environment.py
0:0 
0:0 
view
6 x 2 tf_agents/replay_buffers
tf_agents/replay_buffers
replay_buffer.py
replay_buffer.py
0:0 
0:0 
view
7 x 2 tf_agents/replay_buffers
tf_agents/replay_buffers
reverb_utils.py
reverb_utils.py
0:0 
0:0 
view
8 x 2 tf_agents/policies/samplers
tf_agents/policies/samplers
cem_actions_sampler.py
cem_actions_sampler.py
0:0 
0:0 
view