-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathFAfferentCoupling.qhelp
More file actions
55 lines (43 loc) · 1.55 KB
/
FAfferentCoupling.qhelp
File metadata and controls
55 lines (43 loc) · 1.55 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>This metric measures, for each file, how many other files depend on it.</p>
<p>A file depends on another file if:</p>
<ul>
<li>It calls a function in that file</li>
<li>It reads or writes a variable declared in that file</li>
<li>It uses a type declared in that file</li>
</ul>
<p>Many incoming dependencies can be good or bad, depending on the nature of the file.</p>
<p>A large number of incoming dependencies is good for:</p>
<ul>
<li>files containing logging functions</li>
<li>files containing system-wide utility functions</li>
</ul>
<p>A large number of incoming dependencies may be a problem for:</p>
<ul>
<li>files that should be internal to a particular component</li>
<li>files containing functions or classes with unstable interfaces</li>
</ul>
<p>A file with many dependencies on it is risky to change, since large parts of a system
may be affected. Such files should be well documented and have clean APIs.</p>
</overview>
<recommendation>
<p>Group widely used utility functions together. Replace calls to a component's internals
with uses of its public API (augmenting it if necessary).</p>
<p>Ensure that the public API is well-documented.</p>
</recommendation>
<references>
<li>
M. Fowler. <em>Refactoring</em>. Addison-Wesley, 1999.
</li>
<li>
<a href="https://en.wikipedia.org/wiki/Code_refactoring">Wikipedia: Code refactoring</a>
</li>
<li>
<a href="http://www.jot.fm/issues/issue_2005_01/column1/">Refactoring as Meta Programming?</a>
</li>
</references>
</qhelp>