awslabs / sagemaker-battlesnake-ai
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
  • 10% duplication:
    • 8,633 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 892 duplicated lines
  • 68 duplicates
system10% (892 lines)
Duplication per Extension
py10% (808 lines)
yaml8% (84 lines)
Duplication per Component (primary)
source/RLlibEnv/training10% (550 lines)
source/MXNetEnv/training11% (95 lines)
source/BattlesnakeGym/battlesnake_gym7% (80 lines)
deployment/CloudFormation6% (52 lines)
source/MXNetEnv22% (42 lines)
source/RLlibEnv/inference13% (34 lines)
source/RLlibEnv21% (25 lines)
source/MXNetEnv/inference14% (14 lines)
source/BattlesnakeGym0% (0 lines)
source0% (0 lines)
deployment/LambdaGateway/src0% (0 lines)
deployment/CloudFormation/solution-assistant0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 68 duplicates...
Size#FoldersFilesLinesCode
23 x 2 source/RLlibEnv/training...trator/workflow/manager
source/RLlibEnv/training...trator/workflow/manager
experiment_manager.py
experiment_manager.py
1481:1507 (1%)
1578:1604 (1%)
view
18 x 2 source/RLlibEnv/training...trator/workflow/manager
source/RLlibEnv/training...trator/workflow/manager
experiment_manager.py
experiment_manager.py
1314:1333 (1%)
1396:1415 (1%)
view
16 x 2 source/RLlibEnv/training...gemaker_rl/orchestrator
source/RLlibEnv/training...trator/workflow/manager
resource_manager.py
join_manager.py
521:540 (4%)
178:197 (4%)
view
14 x 2 source/MXNetEnv/training/training_src/networks
source/MXNetEnv/training/training_src/networks
qnetworks.py
qnetworks.py
196:211 (6%)
290:305 (6%)
view
14 x 2 source/RLlibEnv/training...trator/workflow/manager
source/RLlibEnv/training...trator/workflow/manager
experiment_manager.py
experiment_manager.py
1453:1469 (1%)
1556:1571 (1%)
view
13 x 2 deployment/CloudFormation
deployment/CloudFormation
endpoint.yaml
endpoint.yaml
154:166 (4%)
176:188 (4%)
view
12 x 2 source/MXNetEnv/training/training_src/networks
source/RLlibEnv/training/training_src
utils.py
utils.py
29:43 (30%)
26:41 (37%)
view
11 x 2 source/MXNetEnv
source/RLlibEnv
heuristics_utils.py
heuristics_utils.py
215:227 (6%)
121:133 (9%)
view
11 x 2 source/MXNetEnv
source/RLlibEnv/inference/inference_src
heuristics_utils.py
heuristics.py
19:31 (6%)
33:45 (9%)
view
11 x 2 source/BattlesnakeGym/battlesnake_gym
source/BattlesnakeGym/battlesnake_gym
snake.py
snake.py
186:198 (2%)
218:230 (2%)
view
10 x 2 source/MXNetEnv/training/training_src/networks
source/MXNetEnv/training/training_src/networks
qnetworks.py
qnetworks.py
169:178 (4%)
263:272 (4%)
view
10 x 2 source/BattlesnakeGym/battlesnake_gym
source/BattlesnakeGym/battlesnake_gym
snake.py
snake.py
391:402 (2%)
410:421 (2%)
view
10 x 2 source/MXNetEnv/training/training_src/networks
source/MXNetEnv/training/training_src/networks
qnetworks.py
qnetworks.py
90:102 (4%)
223:236 (4%)
view
10 x 2 source/BattlesnakeGym/battlesnake_gym
source/BattlesnakeGym/battlesnake_gym
snake.py
snake.py
376:386 (2%)
395:405 (2%)
view
9 x 2 source/BattlesnakeGym/battlesnake_gym
source/BattlesnakeGym/battlesnake_gym
snake.py
snake.py
414:423 (2%)
441:450 (2%)
view
9 x 2 source/RLlibEnv/training...ator/workflow/datatypes
source/RLlibEnv/training...trator/workflow/manager
join_job_record.py
join_manager.py
10:18 (13%)
28:36 (2%)
view
9 x 2 source/MXNetEnv
source/RLlibEnv/inference/inference_src
heuristics_utils.py
heuristics.py
41:50 (4%)
92:101 (8%)
view
9 x 2 source/RLlibEnv/training...gemaker_rl/orchestrator
source/RLlibEnv/training...trator/workflow/manager
resource_manager.py
join_manager.py
509:519 (2%)
166:176 (2%)
view
9 x 2 source/RLlibEnv/training...trator/workflow/manager
source/RLlibEnv/training...trator/workflow/manager
join_manager.py
join_manager.py
503:511 (2%)
604:612 (2%)
view
9 x 2 source/MXNetEnv/training/training_src/networks
source/RLlibEnv/training/training_src
utils.py
utils.py
16:26 (22%)
14:24 (28%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
8 x 2 source/RLlibEnv/training...rchestrator/clients/ddb
source/RLlibEnv/training...rchestrator/clients/ddb
model_db_client.py
join_db_client.py
0:0 
0:0 
view