mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Java: Use .inc.qhelp extension for included help files
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<p>
|
||||
Classes that are never used at runtime are redundant and should be removed.
|
||||
</p>
|
||||
<include src="DeadCodeSummary.qhelp"/>
|
||||
<include src="DeadCodeSummary.inc.qhelp"/>
|
||||
<p>
|
||||
Classes are considered dead if at runtime:
|
||||
</p>
|
||||
@@ -26,7 +26,7 @@ fields, methods and nested classes - it is never instantiated, has no public con
|
||||
instance methods. If a class is considered to be a namespace class, then it is live if at least one
|
||||
of the static members of that class is live - including static nested classes.
|
||||
</p>
|
||||
<include src="DeadCodeDetails.qhelp"/>
|
||||
<include src="DeadCodeDetails.inc.qhelp"/>
|
||||
</overview>
|
||||
<recommendation>
|
||||
<p>
|
||||
@@ -48,7 +48,7 @@ if there are some live nested classes within the dead class, the class can be re
|
||||
converting all live nested classes to static members, and removing all instance methods and fields,
|
||||
and all dead static members (see Example 2).
|
||||
</p>
|
||||
<include src="DeadCodeExtraEntryPoints.qhelp"/>
|
||||
<include src="DeadCodeExtraEntryPoints.inc.qhelp"/>
|
||||
</recommendation>
|
||||
<section title="Example 1">
|
||||
<p>
|
||||
@@ -95,5 +95,5 @@ Taking the second approach, this is the final result.
|
||||
</p>
|
||||
<sample src="NamespaceClass2.java" />
|
||||
</section>
|
||||
<include src="DeadCodeReferences.qhelp" />
|
||||
<include src="DeadCodeReferences.inc.qhelp" />
|
||||
</qhelp>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p>
|
||||
Enum constants that are never used at runtime are redundant and should be removed.
|
||||
</p>
|
||||
<include src="DeadCodeSummary.qhelp"/>
|
||||
<include src="DeadCodeSummary.inc.qhelp"/>
|
||||
<p>
|
||||
An enum constant is considered dead if at runtime it is never used, or only used in comparisons. Any
|
||||
enum constant which is not dead is considered to be "live".
|
||||
@@ -17,7 +17,7 @@ An enum constant that is only used in a comparison is considered dead because th
|
||||
always produce the same result. This is because no variable holds the value of the enum constant,
|
||||
so the comparison of any variable against the constant will always return the same result.
|
||||
</p>
|
||||
<include src="DeadCodeDetails.qhelp"/>
|
||||
<include src="DeadCodeDetails.inc.qhelp"/>
|
||||
</overview>
|
||||
<recommendation>
|
||||
<p>
|
||||
@@ -32,7 +32,7 @@ After confirming that the enum constant is not required, remove the enum constan
|
||||
need to remove any references to this enum constant, which may, in turn, require removing other dead
|
||||
code.
|
||||
</p>
|
||||
<include src="DeadCodeExtraEntryPoints.qhelp"/>
|
||||
<include src="DeadCodeExtraEntryPoints.inc.qhelp"/>
|
||||
</recommendation>
|
||||
<example>
|
||||
<p>
|
||||
@@ -51,5 +51,5 @@ stored or returned anywhere in the program. Therefore, <code>ERROR</code> is dea
|
||||
along with the comparison check, and the <code>exit(1);</code>.
|
||||
</p>
|
||||
</example>
|
||||
<include src="DeadCodeReferences.qhelp" />
|
||||
<include src="DeadCodeReferences.inc.qhelp" />
|
||||
</qhelp>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p>
|
||||
Fields that are never read at runtime are unnecessary and should be removed.
|
||||
</p>
|
||||
<include src="DeadCodeSummary.qhelp"/>
|
||||
<include src="DeadCodeSummary.inc.qhelp"/>
|
||||
<p>
|
||||
Fields are considered dead if at runtime they are never read directly or indirectly, for example
|
||||
through a framework or a use of reflection. Any field which is not dead is considered to be "live".
|
||||
@@ -15,7 +15,7 @@ through a framework or a use of reflection. Any field which is not dead is consi
|
||||
<p>
|
||||
Fields are considered to be dead if they are only written to, and never read.
|
||||
</p>
|
||||
<include src="DeadCodeDetails.qhelp"/>
|
||||
<include src="DeadCodeDetails.inc.qhelp"/>
|
||||
</overview>
|
||||
<recommendation>
|
||||
<p>
|
||||
@@ -30,7 +30,7 @@ After confirming that the field is not required, remove the field. You will also
|
||||
references to this field, which may, in turn, require removing other unused classes, methods
|
||||
and fields.
|
||||
</p>
|
||||
<include src="DeadCodeExtraEntryPoints.qhelp"/>
|
||||
<include src="DeadCodeExtraEntryPoints.inc.qhelp"/>
|
||||
</recommendation>
|
||||
<section title="Example 1">
|
||||
<p>
|
||||
@@ -64,5 +64,5 @@ the contents of the object in an XML file, or to construct an instance of the ob
|
||||
file. The field is therefore considered to be read at runtime, which makes the field live.
|
||||
</p>
|
||||
</section>
|
||||
<include src="DeadCodeReferences.qhelp" />
|
||||
<include src="DeadCodeReferences.inc.qhelp" />
|
||||
</qhelp>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p>
|
||||
Methods that are never called at runtime are redundant and should be removed.
|
||||
</p>
|
||||
<include src="DeadCodeSummary.qhelp"/>
|
||||
<include src="DeadCodeSummary.inc.qhelp"/>
|
||||
<p>
|
||||
Methods are considered dead if at runtime they are never called, either directly, by a method call,
|
||||
or indirectly, through a framework or use of reflection. Any method which is not dead is considered
|
||||
@@ -18,7 +18,7 @@ The results can include methods, constructors and initializers. Initializers com
|
||||
instance initializers and static initializers. For each class there will be at most one dead
|
||||
initializer of each type, representing all the initialization of that type in the class.
|
||||
</p>
|
||||
<include src="DeadCodeDetails.qhelp"/>
|
||||
<include src="DeadCodeDetails.inc.qhelp"/>
|
||||
</overview>
|
||||
<recommendation>
|
||||
<p>
|
||||
@@ -47,7 +47,7 @@ and initializers on instance fields are dead. In addition, the lack of instance
|
||||
implies that the class is never constructed, which means that all instance methods and fields are
|
||||
also dead and can be removed. These methods and fields will also be reported separately.
|
||||
</p>
|
||||
<include src="DeadCodeExtraEntryPoints.qhelp"/>
|
||||
<include src="DeadCodeExtraEntryPoints.inc.qhelp"/>
|
||||
</recommendation>
|
||||
<section title="Example 1">
|
||||
<p>
|
||||
@@ -77,5 +77,5 @@ framework when running the tests. <code>testCustomer</code> and <code>setUp</cod
|
||||
considered to be "live".
|
||||
</p>
|
||||
</section>
|
||||
<include src="DeadCodeReferences.qhelp" />
|
||||
<include src="DeadCodeReferences.inc.qhelp" />
|
||||
</qhelp>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
<overview>
|
||||
<include src="DeadCodeSummary.qhelp"/>
|
||||
<include src="DeadCodeDetails.qhelp"/>
|
||||
<include src="DeadCodeSummary.inc.qhelp"/>
|
||||
<include src="DeadCodeDetails.inc.qhelp"/>
|
||||
</overview>
|
||||
<recommendation>
|
||||
<p>
|
||||
@@ -13,5 +13,5 @@ can see which classes, methods and fields contribute to this metric using the ru
|
||||
analysis.
|
||||
</p>
|
||||
</recommendation>
|
||||
<include src="DeadCodeReferences.qhelp" />
|
||||
<include src="DeadCodeReferences.inc.qhelp" />
|
||||
</qhelp>
|
||||
|
||||
@@ -35,5 +35,5 @@ parameter <code>name</code> is not used within the body of the method. The param
|
||||
as useless, and can be removed from the program.
|
||||
</p>
|
||||
</example>
|
||||
<include src="DeadCodeReferences.qhelp" />
|
||||
<include src="DeadCodeReferences.inc.qhelp" />
|
||||
</qhelp>
|
||||
|
||||
Reference in New Issue
Block a user