mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Update Python and C# help for commented-out code to use common qhelp
This commit is contained in:
@@ -3,5 +3,6 @@
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
<include src="CommentedOutCodeQuery.qhelp" />
|
||||
<include src="CommentedOutCodeCommon.qhelp" />
|
||||
<include src="CommentedOutCodeExample.qhelp" />
|
||||
<include src="CommentedOutCodeReferences.qhelp" />
|
||||
</qhelp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @name Commented out code
|
||||
* @description Commented out code causes visual clutter as it is neither code nor comment.
|
||||
* @name Commented-out code
|
||||
* @description Commented-out code makes the remaining code more difficult to read.
|
||||
* @kind problem
|
||||
* @tags maintainability
|
||||
* readability
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<!DOCTYPE qhelp PUBLIC
|
||||
"-//Semmle//qhelp//EN"
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
<recommendation>
|
||||
|
||||
<p>
|
||||
Remove the commented-out code, or reinstate it if necessary. If you want to include a snippet
|
||||
of example code in a comment, consider adding an <code>@example</code> tag or enclosing the code
|
||||
in a <code>code</code> or <code>pre</code> element.
|
||||
</p>
|
||||
|
||||
</recommendation>
|
||||
<example>
|
||||
<p>
|
||||
In the following example, a <code>print</code> statement, originally used
|
||||
for debugging, is left in the code, but commented out. It should be removed altogether.
|
||||
</p>
|
||||
|
||||
<sample src="CommentedOutCode.py" />
|
||||
|
||||
</example>
|
||||
<references>
|
||||
|
||||
<li>Los Techies: <a href="http://lostechies.com/rodpaddock/2010/12/29/commented-code-technical-debt">Commented Code == Technical Debt</a>.</li>
|
||||
|
||||
</references>
|
||||
</qhelp>
|
||||
16
python/ql/src/Lexical/CommentedOutCodeExample.qhelp
Normal file
16
python/ql/src/Lexical/CommentedOutCodeExample.qhelp
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE qhelp PUBLIC
|
||||
"-//Semmle//qhelp//EN"
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
|
||||
<example>
|
||||
<p>
|
||||
In the following example, a <code>print</code> statement, originally used
|
||||
for debugging, is left in the code, but commented out. It should be removed altogether.
|
||||
</p>
|
||||
|
||||
<sample src="CommentedOutCode.py" />
|
||||
|
||||
</example>
|
||||
|
||||
</qhelp>
|
||||
Reference in New Issue
Block a user