mirror of
https://github.com/github/codeql.git
synced 2026-04-05 07:08:31 +02:00
39 lines
1.3 KiB
XML
39 lines
1.3 KiB
XML
<!DOCTYPE qhelp PUBLIC
|
|
"-//Semmle//qhelp//EN"
|
|
"qhelp.dtd">
|
|
<qhelp>
|
|
|
|
|
|
<overview>
|
|
<p>
|
|
This rule looks for two files that share too much information about each other (accessing many operations or variables in both directions).
|
|
It would be better to invert some of the dependencies to reduce the coupling between the two files.
|
|
</p>
|
|
|
|
<p>
|
|
Having two files have too many dependencies on each other makes it difficult to modify one file without requiring modifications to the
|
|
other. This could lead to defects when the programmer forgets to put in the necessary changes to one file when he makes a change to the other.
|
|
</p>
|
|
|
|
</overview>
|
|
<recommendation>
|
|
<p>Move some of the methods and variables from one file to another, so that most of the dependencies go only in one direction. If possible,
|
|
try to make all the dependencies go in one direction.</p>
|
|
|
|
</recommendation>
|
|
<references>
|
|
|
|
<li>W. C. Wake, <em>Refactoring Workbook</em>, pp. 95 – 96. Addison-Wesley Professional, 2004.</li>
|
|
<li>E. Gamma, R. Helm, R. Johnson, J. Vlissides,
|
|
<em>Design patterns: elements of reusable object-oriented software</em>.
|
|
Addison-Wesley Longman Publishing Co., Inc. Boston, MA, 1995.</li>
|
|
<li>
|
|
MSDN Magazine: <a href="http://msdn.microsoft.com/en-us/magazine/cc947917.aspx">Patterns in Practice: Cohesion And Coupling</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</references>
|
|
</qhelp>
|