-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathFLinesOfCode.qhelp
More file actions
33 lines (26 loc) · 1.3 KB
/
FLinesOfCode.qhelp
File metadata and controls
33 lines (26 loc) · 1.3 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
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>This metric measures the number of lines of code in each file. Files with a large number of
lines can be difficult to understand. They can also cause problems with version control systems by
increasing the likelihood that two developers work on the same file at once. A large number of
lines of code in a single file can be an indication that the file suffers from poor code
organization.</p>
</overview>
<recommendation>
<p>If the file has been automatically generated by a tool then it is generally best to leave it as
it is, even if it is very long.</p>
<p>If the file contains multiple classes they should be moved into separate files, especially if
they are unrelated.</p>
<p>If the file contains nested classes they could be put in separate files by turning the class
they are contained in into a partial class.</p>
<p>If the main class in a file is too big then consideration should be given as to whether it can be
refactored into smaller classes.</p>
</recommendation>
<references>
<li>MSDN. C# Programming Guide. <a href="http://msdn.microsoft.com/en-us/library/wa80x488%28VS.80%29.aspx">Partial Class Definitions</a>.</li>
<li>Martin Fowler. <em>Refactoring</em>. Addison-Wesley. 1999.</li>
</references>
</qhelp>