-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathMostlySimilarFile.qhelp
25 lines (20 loc) · 1.02 KB
/
MostlySimilarFile.qhelp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!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 less easy 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 its own module and import that module into the original.</p>
</recommendation>
<references>
<li>E. Juergens, F. Deissenboeck, B. Hummel and S. Wagner, <em>Do Code Clones Matter?</em>, 2009. (<a href="https://wwwbroy.in.tum.de/~juergens/publications/ICSE2009_RP_0110_juergens.pdf">available online</a>).</li>
</references>
</qhelp>