Duplication Overall
- 12% duplication:
- 8,543 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
- 1,077 duplicated lines
- 244 duplicates
Duplication per Extension
Duplication per Component (primary)
Longest Duplicates
The list of 50 longest duplicates.
| Size | # | Folders | Files | Lines | Code |
|---|---|---|---|---|---|
| 17 | x 2 | printerprinter | 30:50 (80%)30:50 (80%) | view | |
| 16 | x 2 | labd/controlapilabd/controlapi | 130:151 (10%)168:189 (10%) | view | |
| 16 | x 2 | labd/controlapilabd/controlapi | 96:117 (14%)134:155 (14%) | view | |
| 15 | x 2 | labd/controlapilabd/controlapi | 87:107 (16%)124:144 (16%) | view | |
| 15 | x 2 | labd/controlapilabd/controlapi | 90:110 (15%)126:146 (15%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 59:72 (7%)76:89 (7%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 198:216 (7%)223:241 (7%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 74:87 (7%)60:73 (8%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 208:226 (7%)186:204 (8%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 59:72 (7%)60:73 (8%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 74:87 (7%)76:89 (7%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 59:72 (7%)74:87 (7%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 76:89 (7%)60:73 (8%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 198:216 (7%)258:276 (6%) | view | |
| 13 | x 2 | cmd/labctl/commandcmd/labctl/command | 223:241 (7%)258:276 (6%) | view | |
| 12 | x 2 | labd/routers/benchmarkrouterlabd/routers/experimentrouter | 193:206 (7%)193:206 (7%) | view | |
| 12 | x 2 | labd/controlapilabd/controlapi | 251:268 (7%)93:110 (17%) | view | |
| 11 | x 2 | labd/controlapilabd/controlapi | 84:100 (7%)43:59 (11%) | view | |
| 11 | x 2 | cmd/labctl/commandcmd/labctl/command | 128:144 (11%)263:279 (5%) | view | |
| 10 | x 2 | cmd/labctl/commandcmd/labctl/command | 148:161 (5%)238:251 (5%) | view | |
| 10 | x 2 | scenariosscenarios | 71:85 (11%)108:123 (11%) | view | |
| 10 | x 2 | cmd/labctl/commandcmd/labctl/command | 178:193 (5%)156:171 (6%) | view | |
| 10 | x 2 | labagent/agentapilabapp/appapi | 73:87 (25%)91:105 (21%) | view | |
| 10 | x 2 | labd/controlapilabd/controlapi | 51:65 (8%)86:100 (6%) | view | |
| 10 | x 2 | labd/controlapilabd/controlapi | 51:65 (8%)45:59 (10%) | view | |
| 10 | x 2 | cmd/labctl/commandcmd/labctl/command | 128:141 (10%)228:241 (5%) | view | |
| 10 | x 2 | cmd/labctl/commandcmd/labctl/command | 203:216 (5%)128:141 (10%) | view | |
| 10 | x 2 | cmd/labctl/commandcmd/labctl/command | 184:197 (4%)191:204 (6%) | view | |
| 10 | x 2 | cmd/labctl/commandcmd/labctl/command | 213:226 (5%)184:197 (4%) | view | |
| 9 | x 2 | labd/controlapilabd/controlapi | 44:56 (9%)61:73 (9%) | view | |
| 9 | x 2 | scenariosscenarios | 87:99 (10%)126:138 (10%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 185:197 (4%)264:276 (4%) | view | |
| 9 | x 2 | labd/controlapilabd/controlapi | 34:46 (15%)76:88 (15%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 204:216 (5%)192:204 (6%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 214:226 (5%)229:241 (5%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 204:216 (5%)214:226 (5%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 229:241 (5%)192:204 (6%) | view | |
| 9 | x 2 | labd/controlapilabd/controlapi | 87:100 (8%)54:67 (13%) | view | |
| 9 | x 2 | labd/controlapilabd/controlapi | 121:134 (5%)78:91 (9%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 129:141 (9%)185:197 (4%) | view | |
| 9 | x 2 | labd/controlapilabd/controlapi | 87:100 (8%)81:94 (9%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 214:226 (5%)129:141 (9%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 129:141 (9%)192:204 (6%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 204:216 (5%)185:197 (4%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 229:241 (5%)185:197 (4%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 264:276 (4%)192:204 (6%) | view | |
| 9 | x 2 | labd/controlapilabd/controlapi | 81:94 (9%)54:67 (13%) | view | |
| 9 | x 2 | cmd/labctl/commandcmd/labctl/command | 214:226 (5%)264:276 (4%) | view | |
| 8 | x 2 | cmd/labctl/commandcmd/labctl/command | 72:81 (7%)147:156 (7%) | view | |
| 8 | x 2 | labd/controlapilabd/controlapi | 63:72 (11%)97:106 (11%) | view |
Most Frequent Duplicates
The list of 47 most frequently found duplicates.
| Size | # | Folders | Files | Lines | Code |
|---|---|---|---|---|---|
| 6 | x 14 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command... | 68:77 (5%)114:122 (3%)106:115 (3%)173:182 (3%)111:120 (4%)124:133 (2%)158:167 (3%)184:193 (3%)148:157 (3%)174:183 (3%)... | view | |
| 6 | x 9 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 88:95 (5%)183:190 (3%)105:112 (3%)223:230 (3%)161:168 (4%)258:265 (2%)173:180 (3%)198:205 (3%)237:244 (3%) | view | |
| 6 | x 7 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 205:212 (3%)230:237 (3%)193:200 (4%)130:137 (6%)186:193 (2%)215:222 (3%)265:272 (2%) | view | |
| 6 | x 7 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 67:74 (5%)157:164 (3%)147:154 (3%)172:179 (3%)135:142 (4%)123:130 (2%)117:124 (5%) | view | |
| 6 | x 7 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 204:211 (3%)229:236 (3%)192:199 (4%)129:136 (6%)185:192 (2%)214:221 (3%)264:271 (2%) | view | |
| 6 | x 7 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 208:213 (3%)233:238 (3%)196:201 (4%)133:138 (6%)189:194 (2%)218:223 (3%)268:273 (2%) | view | |
| 6 | x 7 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 209:216 (3%)234:241 (3%)197:204 (4%)134:141 (6%)190:197 (2%)219:226 (3%)269:276 (2%) | view | |
| 6 | x 6 | labd/controlapilabd/controlapilabd/controlapilabd/controlapilabd/controlapilabd/controlapi | 130:138 (5%)93:101 (8%)120:128 (6%)164:172 (3%)122:130 (6%)251:259 (3%) | view | |
| 6 | x 5 | metadatametadatametadatametadatametadata | 143:152 (6%)290:299 (2%)276:285 (2%)268:277 (2%)287:296 (1%) | view | |
| 6 | x 5 | metadatametadatametadatametadatametadata | 226:233 (2%)219:226 (2%)243:250 (2%)214:221 (2%)219:226 (1%) | view | |
| 6 | x 5 | metadatametadatametadatametadatametadata | 227:234 (2%)220:227 (2%)244:251 (2%)215:222 (2%)220:227 (1%) | view | |
| 6 | x 5 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 66:72 (3%)83:89 (3%)67:73 (4%)55:61 (2%)81:87 (3%) | view | |
| 6 | x 5 | metadatametadatametadatametadatametadata | 228:235 (2%)221:228 (2%)245:252 (2%)216:223 (2%)221:228 (1%) | view | |
| 6 | x 5 | labd/controlapilabd/controlapilabd/controlapilabd/controlapilabd/controlapi | 90:98 (5%)57:65 (8%)81:89 (6%)124:132 (3%)84:92 (6%) | view | |
| 6 | x 5 | labd/controlapilabd/controlapilabd/controlapilabd/controlapilabd/controlapi | 89:97 (5%)56:64 (8%)80:88 (6%)123:131 (3%)83:91 (6%) | view | |
| 6 | x 5 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 65:71 (3%)82:88 (3%)66:72 (4%)54:60 (2%)80:86 (3%) | view | |
| 6 | x 5 | labd/controlapilabd/controlapilabd/controlapilabd/controlapilabd/controlapi | 92:100 (5%)59:67 (8%)83:91 (6%)126:134 (3%)86:94 (6%) | view | |
| 6 | x 5 | metadatametadatametadatametadatametadata | 142:151 (6%)289:298 (2%)275:284 (2%)267:276 (2%)286:295 (1%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 60:65 (3%)77:82 (3%)61:66 (4%)75:80 (3%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 64:69 (3%)81:86 (3%)65:70 (4%)79:84 (3%) | view | |
| 6 | x 4 | cmd/labagentcmd/labctlcmd/labappcmd/labd | 28:39 (60%)28:39 (60%)28:39 (60%)28:39 (60%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 149:158 (3%)174:183 (3%)69:78 (5%)239:248 (3%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 61:66 (3%)78:83 (3%)62:67 (4%)76:81 (3%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 59:64 (3%)76:81 (3%)60:65 (4%)74:79 (3%) | view | |
| 6 | x 4 | cmd/labagentcmd/labctlcmd/labappcmd/labd | 35:42 (60%)35:42 (60%)35:42 (60%)35:42 (60%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 63:68 (3%)80:85 (3%)64:69 (4%)78:83 (3%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 62:67 (3%)79:84 (3%)63:68 (4%)77:82 (3%) | view | |
| 6 | x 4 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 203:210 (3%)228:235 (3%)128:135 (6%)263:270 (2%) | view | |
| 6 | x 4 | cmd/labagentcmd/labctlcmd/labappcmd/labd | 32:41 (60%)32:41 (60%)32:41 (60%)32:41 (60%) | view | |
| 6 | x 3 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 199:208 (3%)224:233 (3%)259:268 (2%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 86:93 (3%)45:52 (6%)51:58 (5%) | view | |
| 6 | x 3 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 263:270 (3%)198:205 (3%)258:265 (3%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 90:96 (3%)49:55 (6%)55:61 (5%) | view | |
| 6 | x 3 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 200:209 (3%)225:234 (3%)260:269 (2%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 257:264 (3%)65:72 (8%)99:106 (8%) | view | |
| 6 | x 3 | labagent/agentapilabd/controlapilabapp/appapi | 79:87 (15%)205:213 (3%)97:105 (12%) | view | |
| 6 | x 3 | labagent/agentapilabd/controlapilabapp/appapi | 77:83 (15%)203:209 (3%)95:101 (12%) | view | |
| 6 | x 3 | metadatametadatametadata | 244:251 (2%)237:244 (2%)237:244 (1%) | view | |
| 6 | x 3 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 264:273 (3%)199:208 (3%)259:268 (3%) | view | |
| 6 | x 3 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 167:176 (2%)241:250 (2%)281:290 (2%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 255:262 (3%)63:70 (8%)97:104 (8%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 92:100 (3%)51:59 (6%)57:65 (5%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 87:94 (3%)46:53 (6%)52:59 (5%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 87:96 (5%)54:63 (8%)81:90 (6%) | view | |
| 6 | x 3 | cmd/labctl/commandcmd/labctl/commandcmd/labctl/command | 213:220 (3%)191:198 (4%)184:191 (2%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 256:263 (3%)64:71 (8%)98:105 (8%) | view | |
| 6 | x 3 | labd/controlapilabd/controlapilabd/controlapi | 88:95 (3%)47:54 (6%)53:60 (5%) | view |
Duplicated Units
The list of top 8 duplicated units.
| Size | # | Folders | Files | Lines | Code |
|---|---|---|---|---|---|
| 20 | x 2 | printerprinter | 29:51 29:51 | view | |
| 9 | x 2 | cmd/ocigetcmd/s3download | 43:54 37:48 | view | |
| 9 | x 3 | cmd/s3uploadcmd/ociaddcmd/s3build | 36:47 40:51 39:50 | view | |
| 8 | x 4 | cmd/labctlcmd/labagentcmd/labdcmd/labapp | 35:46 35:46 35:46 35:46 | view | |
| 8 | x 2 | labd/controlapilabd/controlapi | 158:169 149:160 | view | |
| 7 | x 2 | labagentlabapp | 74:82 59:67 | view | |
| 7 | x 2 | labddaemon | 134:142 52:60 | view | |
| 6 | x 2 | daemonpkg/httputil | 133:140 62:69 | view |
About This Analysis
- 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...
- To learn more about duplications and techniques for eliminating duplication, Sokrates recommends the following resources:
- Avoid Repetition, MartinFlower.com (IEEE Software article)
- Refactoring duplicated code, sourcemaking.com
- Beck Design Rules, MartinFowler.com
- DRY (Don't Repeat Yourself) Principle, Wikipedia
- The Cut-and-Paste Programming Software Development Anti-Pattern, sourcemaking.com
- Code Smells / Duplicated Code, Jeff Atwood, codinghorror.com:
- "Duplicated code is the bane of software development. Stamp out duplication whenever possible. You should always be on the lookout for more subtle cases of near-duplication, too. Don't Repeat Yourself!"
- Reducing Coupling, MartinFlower.com (IEEE Software article):
- "There are several ways to describe coupling, but it boils down to this: If changing one module in a program requires changing another module, then coupling exists. ... Duplication always implies coupling, because changing one piece of duplicate code implies changing the other."