openai / openai-guardrails-js
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
  • 3% duplication:
    • 6,879 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 264 duplicated lines
  • 19 duplicates
system3% (264 lines)
dependency graphs: 2D graph | 2D graph (with duplicates)... | 3D graph | 3D graph (with duplicates)...
Duplication per Extension
ts3% (264 lines)
Duplication per Component (primary)
src3% (264 lines)
Longest Duplicates
The list of 19 longest duplicates.
See data for all 19 duplicates...
Size#FoldersFilesLinesCode
21 x 2 src
src
90:114 (17%)
180:204 (17%)
view
19 x 2 src/resources/chat
src/resources/responses
113:135 (23%)
116:137 (20%)
view
12 x 2 src/resources/chat
src/resources/responses
95:111 (14%)
98:114 (12%)
view
10 x 2 src
src
656:666 (2%)
719:729 (2%)
view
9 x 2 src/checks
src/checks
192:200 (6%)
248:256 (6%)
view
9 x 2 src/checks
src/checks
518:532 (2%)
213:227 (2%)
view
9 x 2 src/checks
src/checks
180:189 (6%)
193:203 (6%)
view
9 x 2 src/evals/core
src/evals/core
15:27 (16%)
14:26 (12%)
view
8 x 2 src/checks
src/checks
180:187 (5%)
249:256 (5%)
view
7 x 2 src/resources/chat
src/resources/responses
71:77 (8%)
74:80 (7%)
view
7 x 2 src
src
49:56 (7%)
93:100 (7%)
view
6 x 2 src/checks
src/checks
749:755 (<1%)
768:774 (<1%)
view
6 x 2 src/resources/responses
src/resources/responses
123:128 (6%)
132:137 (6%)
view
6 x 2 src/checks
src/checks
51:56 (2%)
47:52 (1%)
view
6 x 2 src/checks
src/checks
271:276 (1%)
282:287 (1%)
view
6 x 2 src/resources/chat
src/resources/responses
120:125 (7%)
132:137 (6%)
view
6 x 2 src/resources/chat
src/resources/responses
130:135 (7%)
123:128 (6%)
view
6 x 2 src
src
616:624 (1%)
682:690 (1%)
view
6 x 2 src/resources/chat
src/resources/chat
120:125 (7%)
130:135 (7%)
view
Most Frequent Duplicates
The list of 4 most frequently found duplicates.
Size#FoldersFilesLinesCode
6 x 4 src/resources/chat
src/resources/responses
src/resources/chat
src/resources/responses
120:125 (7%)
123:128 (6%)
130:135 (7%)
132:137 (6%)
view
6 x 3 src/checks
src/checks
src/checks
182:187 (4%)
195:200 (4%)
251:256 (4%)
view
6 x 3 src/checks
src/checks
src/checks
180:185 (4%)
193:198 (4%)
249:254 (4%)
view
6 x 3 src/checks
src/checks
src/checks
181:186 (4%)
194:199 (4%)
250:255 (4%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
11 x 2 src/checks
src/checks
117:130 
506:519 
view
9 x 2 src/evals/core
src/evals/core
14:27 
15:28 
view