microsoft / rushstack
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:
    • 63,765 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 6,383 duplicated lines
  • 1,525 duplicates
system10% (6,383 lines)
Duplication per Extension
yaml20% (3,491 lines)
ts5% (2,693 lines)
js25% (199 lines)
Duplication per Component (primary)
common/config20% (3,466 lines)
apps/rush-lib3% (587 lines)
apps/api-extractor6% (411 lines)
heft-plugins/heft-webpack4-plugin86% (231 lines)
heft-plugins/heft-webpack5-plugin78% (231 lines)
libraries/node-core-library6% (198 lines)
apps/api-documenter6% (183 lines)
heft-plugins/heft-jest-plugin13% (154 lines)
apps/heft2% (148 lines)
libraries/ts-command-line11% (111 lines)
eslint/eslint-config26% (106 lines)
rush-plugins/rush-amazon-s3-build-cache-plugin24% (94 lines)
common/scripts25% (93 lines)
apps/api-extractor-model3% (56 lines)
libraries/rig-package24% (56 lines)
eslint/eslint-plugin-packlets9% (47 lines)
eslint/eslint-patch29% (40 lines)
eslint/eslint-plugin10% (39 lines)
libraries/debug-certificate-manager8% (36 lines)
rush-plugins/rush-azure-storage-build-cache-plugin8% (26 lines)
common/autoinstallers10% (25 lines)
libraries/rushell5% (22 lines)
apps/rundown5% (16 lines)
eslint/eslint-plugin-security12% (7 lines)
apps/rush0% (0 lines)
heft-plugins/heft-dev-cert-plugin0% (0 lines)
heft-plugins/heft-sass-plugin0% (0 lines)
heft-plugins/heft-storybook-plugin0% (0 lines)
libraries/heft-config-file0% (0 lines)
libraries/load-themed-styles0% (0 lines)
libraries/package-deps-hash0% (0 lines)
libraries/rush-sdk0% (0 lines)
libraries/stream-collator0% (0 lines)
libraries/terminal0% (0 lines)
libraries/tree-pattern0% (0 lines)
libraries/typings-generator0% (0 lines)
repo-scripts/doc-plugin-rush-stack0% (0 lines)
repo-scripts/generate-api-docs0% (0 lines)
repo-scripts/repo-toolbox0% (0 lines)
repo-scripts/tombstone0% (0 lines)
rush-plugins/rush-litewatch-plugin0% (0 lines)
rush-plugins/rush-serve-plugin0% (0 lines)

Duplication Between Components (50+ lines)

G heft-plugins/heft-webpack4-plugin heft-plugins/heft-webpack4-plugin heft-plugins/heft-webpack5-plugin heft-plugins/heft-webpack5-plugin heft-plugins/heft-webpack4-plugin--heft-plugins/heft-webpack5-plugin 462 apps/api-documenter apps/api-documenter apps/api-extractor apps/api-extractor apps/api-documenter--apps/api-extractor 150 apps/rush-lib apps/rush-lib rush-plugins/rush-amazon-s3-build-cache-plugin rush-plugins/rush-amazon-s3-build-cache-plugin apps/rush-lib--rush-plugins/rush-amazon-s3-build-cache-plugin 136 common/scripts common/scripts apps/rush-lib--common/scripts 102 rush-plugins/rush-azure-storage-build-cache-plugin rush-plugins/rush-azure-storage-build-cache-plugin rush-plugins/rush-amazon-s3-build-cache-plugin--rush-plugins/rush-azure-storage-build-cache-plugin 52 common/autoinstallers common/autoinstallers common/config common/config common/autoinstallers--common/config 50

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 1,525 duplicates...
Size#FoldersFilesLinesCode
72 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
5079:5150 (<1%)
5172:5243 (<1%)
view
68 x 2 apps/rush-lib/src/utilities
rush-plugins/rush-amazon-s3-build-cache-plugin/src
WebClient.ts
WebClient.ts
15:136 (100%)
18:139 (100%)
view
65 x 2 heft-plugins/heft-webpack4-plugin/src
heft-plugins/heft-webpack5-plugin/src
WebpackPlugin.ts
WebpackPlugin.ts
9:96 (34%)
12:99 (29%)
view
60 x 2 heft-plugins/heft-webpack4-plugin/src
heft-plugins/heft-webpack5-plugin/src
WebpackConfigurationLoader.ts
WebpackConfigurationLoader.ts
14:91 (100%)
14:91 (100%)
view
42 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
5546:5587 (<1%)
5611:5652 (<1%)
view
41 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
5747:5787 (<1%)
5808:5848 (<1%)
view
39 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
18092:18130 (<1%)
18140:18178 (<1%)
view
34 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
18280:18313 (<1%)
18317:18350 (<1%)
view
33 x 2 heft-plugins/heft-webpack4-plugin/src
heft-plugins/heft-webpack5-plugin/src
WebpackPlugin.ts
WebpackPlugin.ts
108:148 (17%)
113:153 (15%)
view
31 x 2 apps/api-documenter/src/utils
apps/api-extractor/src/generators
IndentedWriter.ts
IndentedWriter.ts
122:196 (36%)
157:231 (31%)
view
27 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
1253:1279 (<1%)
1282:1308 (<1%)
view
27 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
1224:1250 (<1%)
1282:1308 (<1%)
view
27 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
1224:1250 (<1%)
1253:1279 (<1%)
view
26 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
810:835 (<1%)
838:863 (<1%)
view
25 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
5080:5104 (<1%)
5451:5475 (<1%)
view
25 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
5173:5197 (<1%)
5451:5475 (<1%)
view
21 x 2 apps/api-extractor/src/generators
apps/api-extractor/src/generators
ApiReportGenerator.ts
DtsRollupGenerator.ts
167:197 (7%)
186:216 (8%)
view
21 x 2 apps/api-documenter/src/utils
apps/api-extractor/src/generators
IndentedWriter.ts
IndentedWriter.ts
56:115 (24%)
93:154 (21%)
view
21 x 2 common/scripts
common/scripts
install-run-rush.js
install-run.js
1:23 (35%)
1:23 (6%)
view
19 x 2 common/config/rush
common/config/rush
pnpm-lock.yaml
pnpm-lock.yaml
17109:17127 (<1%)
17135:17153 (<1%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 22 unit duplicates...
Size#FoldersFilesLinesCode
45 x 2 apps/rush-lib/src/utilities
rush-plugins/rush-amazon-s3-build-cache-plugin/src
WebClient.ts
WebClient.ts
81:137 
84:140 
view
39 x 2 heft-plugins/heft-webpack4-plugin/src
heft-plugins/heft-webpack5-plugin/src
WebpackConfigurationLoader.ts
WebpackConfigurationLoader.ts
31:77 
31:77 
view
19 x 2 apps/api-documenter/src/utils
apps/api-extractor/src/generators
IndentedWriter.ts
IndentedWriter.ts
157:180 
192:215 
view
15 x 2 heft-plugins/heft-webpack4-plugin/src
heft-plugins/heft-webpack5-plugin/src
WebpackPlugin.ts
WebpackPlugin.ts
46:62 
49:65 
view
14 x 2 heft-plugins/heft-webpack4-plugin/src
heft-plugins/heft-webpack5-plugin/src
WebpackConfigurationLoader.ts
WebpackConfigurationLoader.ts
79:93 
79:93 
view
12 x 2 apps/api-documenter/src/cli
apps/api-extractor/src/enhancers
BaseAction.ts
DocCommentEnhancer.ts
120:134 
233:247 
view
10 x 2 apps/api-documenter/src/utils
apps/api-extractor/src/generators
IndentedWriter.ts
IndentedWriter.ts
140:150 
175:185 
view
10 x 4 apps/rush-lib/src/cli/actions
apps/rush-lib/src/cli/actions
apps/rush-lib/src/cli/actions
apps/rush-lib/src/cli/actions
InitAutoinstallerAction.ts
InitDeployAction.ts
PublishAction.ts
UnlinkAction.ts
16:26 
21:31 
58:68 
11:21 
view
10 x 2 heft-plugins/heft-jest-plugin/src
heft-plugins/heft-jest-plugin/src
JestUtils.ts
JestUtils.ts
67:77 
94:104 
view
10 x 2 rush-plugins/rush-amazon-s3-build-cache-plugin/src
rush-plugins/rush-azure-...-build-cache-plugin/src
AmazonS3BuildCacheProvider.ts
AzureStorageBuildCacheProvider.ts
137:147 
233:243 
view
10 x 2 rush-plugins/rush-amazon-s3-build-cache-plugin/src
rush-plugins/rush-azure-...-build-cache-plugin/src
AmazonS3BuildCacheProvider.ts
AzureStorageBuildCacheProvider.ts
158:168 
260:270 
view
9 x 2 apps/rush-lib/src/cli/actions
apps/rush-lib/src/cli/actions
PublishAction.ts
PublishAction.ts
538:548 
550:560 
view
8 x 4 apps/api-documenter/src/cli
apps/api-documenter/src/cli
apps/rundown/src/cli
apps/rundown/src/cli
GenerateAction.ts
MarkdownAction.ts
InspectAction.ts
SnapshotAction.ts
15:23 
9:17 
12:20 
9:17 
view
8 x 2 apps/rush-lib/src/cli/actions
apps/rush-lib/src/cli/actions
InitAutoinstallerAction.ts
UpdateAutoinstallerAction.ts
28:36 
22:30 
view
7 x 2 apps/rush-lib/src/cli/actions
apps/rush-lib/src/cli/actions
UpdateAutoinstallerAction.ts
VersionAction.ts
13:20 
35:42 
view
7 x 2 libraries/ts-command-line/src/parameters
libraries/ts-command-line/src/parameters
CommandLineChoiceListParameter.ts
CommandLineStringListParameter.ts
94:101 
71:78 
view
6 x 2 apps/api-documenter/src/documenters
apps/api-documenter/src/documenters
OfficeYamlDocumenter.ts
YamlDocumenter.ts
66:73 
123:129 
view
6 x 2 apps/api-extractor/src/cli
apps/rush-lib/src/cli
ApiExtractorCommandLine.ts
RushCommandLineParser.ts
29:36 
162:168 
view
6 x 2 apps/api-extractor/src/cli
repo-scripts/repo-toolbox/src
RunAction.ts
RecordVersionsAction.ts
27:33 
12:18 
view
6 x 2 apps/heft/src/utilities
heft-plugins/heft-sass-plugin/src/utilities
HeftAsync.ts
Async.ts
7:13 
7:13 
view