opensearch-project / security-dashboards-plugin
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
  • 14% duplication:
    • 9,661 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,431 duplicated lines
  • 175 duplicates
system14% (1,431 lines)
Duplication per Extension
tsx12% (840 lines)
ts19% (591 lines)
Duplication per Component (primary)
public/apps12% (840 lines)
server/auth25% (348 lines)
server/routes40% (153 lines)
server/backend23% (68 lines)
server7% (22 lines)
ROOT0% (0 lines)
common0% (0 lines)
public0% (0 lines)
public/utils0% (0 lines)
public/services0% (0 lines)
build_tools0% (0 lines)
server/multitenancy0% (0 lines)
server/errors0% (0 lines)
server/session0% (0 lines)
server/utils0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 175 duplicates...
Size#FoldersFilesLinesCode
24 x 2 server/auth/types/saml
server/auth/types/saml
routes.ts
routes.ts
121:147 (12%)
178:205 (12%)
view
16 x 2 server/routes
server/routes
index.ts
index.ts
421:437 (4%)
465:481 (4%)
view
15 x 2 public/apps/configuration/panels/permission-list
public/apps/configuration/panels
permission-list.tsx
role-list.tsx
158:175 (4%)
229:246 (6%)
view
15 x 2 server/auth/types/jwt
server/auth/types/saml
jwt_auth.ts
saml_auth.ts
110:128 (17%)
94:112 (18%)
view
14 x 2 public/apps/configuration/panels/tenant-list
public/apps/configuration/panels
tenant-list.tsx
user-list.tsx
17:30 (4%)
17:30 (6%)
view
14 x 2 server/backend
server/backend
opensearch_security_configuration_plu...
opensearch_security_configuration_plu...
130:143 (11%)
150:163 (11%)
view
14 x 2 server/backend
server/backend
opensearch_security_configuration_plu...
opensearch_security_configuration_plu...
78:91 (11%)
150:163 (11%)
view
14 x 2 server/backend
server/backend
opensearch_security_configuration_plu...
opensearch_security_configuration_plu...
78:91 (11%)
130:143 (11%)
view
12 x 2 server/auth/types/basic
server/auth/types/basic
routes.ts
routes.ts
112:125 (7%)
196:209 (7%)
view
11 x 2 server/routes
server/routes
index.ts
index.ts
240:250 (2%)
379:389 (2%)
view
11 x 2 public/apps/configuratio...nels/internal-user-edit
public/apps/configuratio...nels/internal-user-edit
attribute-panel.tsx
backend-role-panel.tsx
17:31 (11%)
17:30 (15%)
view
11 x 2 server/routes
server/routes
index.ts
index.ts
345:355 (2%)
379:389 (2%)
view
11 x 2 public/apps/configuration/panels/auth-view
public/apps/configuration/panels/auth-view
authentication-sequence-panel.tsx
authorization-panel.tsx
54:67 (12%)
37:50 (13%)
view
11 x 2 server/routes
server/routes
index.ts
index.ts
240:250 (2%)
345:355 (2%)
view
11 x 2 server
server
index.ts
index.ts
91:101 (5%)
177:187 (5%)
view
11 x 2 public/apps/configuration/panels/permission-list
public/apps/configuration/panels/role-view
permission-list.tsx
index-permission-panel.tsx
127:138 (3%)
160:171 (6%)
view
11 x 2 public/apps/configuration/panels/role-edit
public/apps/configuration/panels/role-edit
cluster-permission-panel.tsx
index-permission-panel.tsx
52:62 (27%)
153:163 (4%)
view
10 x 2 server/routes
server/routes
index.ts
index.ts
525:534 (2%)
604:614 (2%)
view
10 x 2 server/routes
server/routes
index.ts
index.ts
393:415 (2%)
441:456 (2%)
view
10 x 2 server/backend
server/backend
opensearch_security_configuration_plu...
opensearch_security_configuration_plu...
51:60 (7%)
106:115 (7%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 server/backend
server/backend
opensearch_security_client.ts
opensearch_security_client.ts
120:128 
138:146 
view
7 x 2 server/auth/types/saml
server/auth/types/jwt
saml_auth.ts
jwt_auth.ts
100:107 
116:123 
view