-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathMostlySimilarFile.qhelp
More file actions
24 lines (19 loc) · 928 Bytes
/
MostlySimilarFile.qhelp
File metadata and controls
24 lines (19 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>This rule identifies two files that have a lot of the same lines but with different variable and method
names. This makes it difficult to make changes in future and makes the code harder to read.</p>
</overview>
<recommendation>
<p>It is important to determine why there are small differences in the files. Sometimes the files might have
been duplicates but an update was only applied to one copy. If this is the case it should be simple to merge
the files, preserving any changes.</p>
<p>If the files are intentionally different then it could be a good idea to consider extracting some of the
shared code into a superclass or a separate utility class.</p>
</recommendation>
<references>
<li>Elmar Juergens, Florian Deissenboeck, Benjamin Hummel and Stefan Wagner. <em>Do Code Clones Matter?</em>. 2009.</li>
</references>
</qhelp>