-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathTLinesOfCode.qhelp
More file actions
52 lines (40 loc) · 1.11 KB
/
TLinesOfCode.qhelp
File metadata and controls
52 lines (40 loc) · 1.11 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
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
This metric measures the number of lines of code for each type.
</p>
<p>
Large types can be problematic:
</p>
<ul>
<li>
They can be hard to understand and maintain, even with good tool support.
</li>
<li>
They often arise as a result of bundling many unrelated things into the same
type, and so can be a symptom of weak type cohesion.
</li>
</ul>
</overview>
<recommendation>
<p>
Types are generally too large because they are taking on more responsibilities
than they should (see [Martin] for more on responsibilities). In general, the
solution is to identify each of the different responsibilities the class is
taking on, and split them out into multiple classes, e.g. using the 'Extract
Class' refactoring from [Fowler].
</p>
</recommendation>
<references>
<li>
M. Fowler. <em>Refactoring</em> pp. 65, 122-5. Addison-Wesley, 1999.
</li>
<li>
R. Martin. <em>Agile Software Development: Principles, Patterns, and Practices</em>
Chapter 8 - SRP: The Single-Responsibility Principle. Pearson Education, 2003.
</li>
</references>
</qhelp>