pytorch / test-infra
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
  • 8% duplication:
    • 6,488 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 556 duplicated lines
  • 86 duplicates
system8% (556 lines)
Duplication per Extension
py8% (245 lines)
tf73% (116 lines)
ts6% (101 lines)
tsx2% (38 lines)
css11% (32 lines)
yml16% (24 lines)
Duplication per Component (primary)
aws/lambda7% (146 lines)
aws/websites35% (140 lines)
torchci/lib7% (90 lines)
tools/self-hosted-runner-utils42% (52 lines)
torchci/pages4% (49 lines)
torchci/log_classifier10% (38 lines)
torchci/components3% (32 lines)
tools/scripts6% (9 lines)
torchci0% (0 lines)
torchci/styles0% (0 lines)
aws/ami0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 86 duplicates...
Size#FoldersFilesLinesCode
32 x 2 aws/websites/auth.pytorch.org
aws/websites/metrics.pytorch.org
provision.tf
provision.tf
34:65 (41%)
38:69 (39%)
view
19 x 2 tools/self-hosted-runner-utils
tools/self-hosted-runner-utils
check_runners_state.py
clear_offline_runners.py
31:51 (27%)
26:46 (35%)
view
12 x 2 aws/websites/auth.pytorch.org
aws/websites/metrics.pytorch.org
provision.tf
provision.tf
1:15 (15%)
1:15 (14%)
view
12 x 2 aws/websites/auth.pytorch.org
aws/websites/metrics.pytorch.org
install.yml
install.yml
1:13 (24%)
1:14 (37%)
view
12 x 2 torchci/lib
torchci/lib
fetchHud.ts
fetchHud.ts
14:29 (14%)
33:48 (14%)
view
11 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
301:311 (1%)
351:361 (1%)
view
11 x 2 torchci/lib
torchci/pages/api/origin...er]/[repoName]/[branch]
fetchHud.ts
[page].ts
33:46 (13%)
14:27 (28%)
view
11 x 2 torchci/lib
torchci/pages/api/origin...er]/[repoName]/[branch]
fetchHud.ts
[page].ts
14:27 (13%)
14:27 (28%)
view
10 x 2 torchci/lib/bot
torchci/lib/bot
mergeBot.ts
mergeBot.ts
17:26 (24%)
33:42 (24%)
view
10 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
446:455 (1%)
459:468 (1%)
view
10 x 2 torchci/log_classifier
torchci/log_classifier
backfill.py
classify_log.py
59:77 (21%)
270:286 (5%)
view
9 x 2 torchci/components
torchci/components
TooltipTarget.module.css
TooltipTarget.module.css
11:20 (32%)
24:33 (32%)
view
9 x 2 aws/lambda/github-status-webhook-handler
tools/scripts
lambda_function.py
update_pending_hud.py
14:27 (8%)
15:27 (7%)
view
8 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
283:290 (1%)
583:590 (1%)
view
8 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
171:178 (1%)
473:480 (1%)
view
8 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
62:69 (1%)
97:104 (1%)
view
8 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
283:290 (1%)
473:480 (1%)
view
8 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
473:480 (1%)
654:661 (1%)
view
8 x 2 aws/lambda/github-webhook-rds-sync
aws/lambda/github-webhook-rds-sync
existing_schema.py
existing_schema.py
62:69 (1%)
283:290 (1%)
view
8 x 2 torchci/lib/bot
torchci/lib/bot
triggerCircleCIWorkflows.ts
triggerCircleCIWorkflows.ts
137:147 (3%)
192:202 (3%)
view