[doc] [plsql] Adjust externalInfoUrl properties to new site - Part 8

Note: I also took the chance to fix tab damage
This commit is contained in:
Andreas Dangel
2017-08-15 11:00:05 +02:00
parent 69267eebdd
commit 9eb3aef9d6
5 changed files with 493 additions and 493 deletions

View File

@ -3,15 +3,17 @@
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description> <description>
Rules based on Thomas Kyte's recommendations on http://asktom.oracle.com/ and http://tkyte.blogspot.com/. Rules based on Thomas Kyte's recommendations on http://asktom.oracle.com/ and http://tkyte.blogspot.com/.
</description> </description>
<rule language="plsql" name="TomKytesDespair" <rule name="TomKytesDespair"
language="plsql"
since="5.1" since="5.1"
message="WHEN OTHERS THEN NULL - when you do this, Tom Kyte cries" message="WHEN OTHERS THEN NULL - when you do this, Tom Kyte cries"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/TomKytesDespair.html#TomKytesDespair"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_TomKytesDespair.html#tomkytesdespair">
<description> <description>
"WHEN OTHERS THEN NULL" hides all errors - (Re)RAISE an exception or call RAISE_APPLICATION_ERROR "WHEN OTHERS THEN NULL" hides all errors - (Re)RAISE an exception or call RAISE_APPLICATION_ERROR
</description> </description>
@ -21,7 +23,6 @@
<value> <value>
<![CDATA[ <![CDATA[
//ExceptionHandler[QualifiedName/@Image='OTHERS' and upper-case(Statement/UnlabelledStatement/Expression/@Image)='NULL'] //ExceptionHandler[QualifiedName/@Image='OTHERS' and upper-case(Statement/UnlabelledStatement/Expression/@Image)='NULL']
]]> ]]>
</value> </value>
</property> </property>
@ -71,5 +72,5 @@ END update_planned_hrs;
]]> ]]>
</example> </example>
</rule> </rule>
</ruleset>
</ruleset>

View File

@ -13,7 +13,7 @@ The Code Size ruleset contains rules that find problems related to code size or
since="5.1" since="5.1"
message="The method {0}() has an NPath complexity of {1}" message="The method {0}() has an NPath complexity of {1}"
class="net.sourceforge.pmd.lang.plsql.rule.codesize.NPathComplexityRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.NPathComplexityRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#NPathComplexity"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#npathcomplexity">
<description> <description>
The NPath complexity of a method is the number of acyclic execution paths through that method. The NPath complexity of a method is the number of acyclic execution paths through that method.
A threshold of 200 is generally considered the point where measures should be taken to reduce A threshold of 200 is generally considered the point where measures should be taken to reduce
@ -54,7 +54,6 @@ PROCEDURE bar AS BEGIN -- this is something more complex than it needs to be,
END; END;
END; END;
END; END;
]]> ]]>
</example> </example>
</rule> </rule>
@ -64,7 +63,7 @@ END;
since="5.1" since="5.1"
message="Avoid really long methods ({0} lines found)." message="Avoid really long methods ({0} lines found)."
class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveMethodLengthRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveMethodLengthRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#ExcessiveMethodLength"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#excessivemethodlength">
<description> <description>
When methods are excessively long this usually indicates that the method is doing more than its When methods are excessively long this usually indicates that the method is doing more than its
name/signature might suggest. They also become challenging for others to digest since excessive name/signature might suggest. They also become challenging for others to digest since excessive
@ -80,19 +79,16 @@ PROCEDURE doSomething BEGIN
DBMS_OUTPUT.PUT_LINE("Hello world!"); DBMS_OUTPUT.PUT_LINE("Hello world!");
-- 98 copies omitted for brevity. -- 98 copies omitted for brevity.
END; END;
]]> ]]>
</example> </example>
</rule> </rule>
<rule name="ExcessiveParameterList" <rule name="ExcessiveParameterList"
language="plsql" language="plsql"
since="5.1" since="5.1"
message="Avoid long parameter lists." message="Avoid long parameter lists."
class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveParameterListRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveParameterListRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#ExcessiveParameterList"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#excessiveparameterlist">
<description> <description>
Methods with numerous parameters are a challenge to maintain, especially if most of them share the Methods with numerous parameters are a challenge to maintain, especially if most of them share the
same datatype. These situations usually denote the need for new objects to wrap the numerous parameters. same datatype. These situations usually denote the need for new objects to wrap the numerous parameters.
@ -115,7 +111,6 @@ PROCEDURE addPerson( -- preferred approach
END; END;
]]> ]]>
</example> </example>
</rule> </rule>
<rule name="ExcessiveObjectLength" <rule name="ExcessiveObjectLength"
@ -123,7 +118,7 @@ END;
since="5.1" since="5.1"
message="Avoid really long Oracle object specifications and bodies ({0} lines found)." message="Avoid really long Oracle object specifications and bodies ({0} lines found)."
class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveObjectLengthRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveObjectLengthRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#ExcessiveObjectLength"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#excessiveobjectlength">
<description> <description>
Excessive object line lengths are usually indications that the object may be burdened with excessive Excessive object line lengths are usually indications that the object may be burdened with excessive
responsibilities that could be provided by other objects. In breaking these methods responsibilities that could be provided by other objects. In breaking these methods
@ -159,7 +154,7 @@ END;
since="5.1" since="5.1"
message="Avoid really long Object Type specifications ({0} lines found)." message="Avoid really long Object Type specifications ({0} lines found)."
class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveTypeLengthRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveTypeLengthRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#ExcessiveTypeLength"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#excessivetypelength">
<description> <description>
Excessive class file lengths are usually indications that the class may be burdened with excessive Excessive class file lengths are usually indications that the class may be burdened with excessive
responsibilities that could be provided by external classes or functions. In breaking these methods responsibilities that could be provided by external classes or functions. In breaking these methods
@ -194,7 +189,7 @@ END;
since="5.1" since="5.1"
message="Avoid really long Object Type and Package bodies ({0} lines found)." message="Avoid really long Object Type and Package bodies ({0} lines found)."
class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePackageBodyLengthRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePackageBodyLengthRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#ExcessivePackageBodyLength"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#excessivepackagebodylength">
<description> <description>
Excessive class file lengths are usually indications that the class may be burdened with excessive Excessive class file lengths are usually indications that the class may be burdened with excessive
responsibilities that could be provided by external classes or functions. In breaking these methods responsibilities that could be provided by external classes or functions. In breaking these methods
@ -230,7 +225,7 @@ END;
since="5.1" since="5.1"
message="Avoid really long Package Specifications ({0} lines found)." message="Avoid really long Package Specifications ({0} lines found)."
class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePackageSpecificationLengthRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePackageSpecificationLengthRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#ExcessivePackageSpecificationLength"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#excessivepackagespecificationlength">
<description> <description>
Excessive class file lengths are usually indications that the class may be burdened with excessive Excessive class file lengths are usually indications that the class may be burdened with excessive
responsibilities that could be provided by external classes or functions. In breaking these methods responsibilities that could be provided by external classes or functions. In breaking these methods
@ -239,17 +234,17 @@ apart the code becomes more managable and ripe for reuse.
<priority>3</priority> <priority>3</priority>
<example> <example>
<![CDATA[ <![CDATA[
]]>
CREATE OR REPLACE CREATE OR REPLACE
PACKAGE Foo AS PACKAGE Foo AS
PROCEDURE bar1; PROCEDURE bar1;
PROCEDURE bar2; PROCEDURE bar2;
PROCEDURE bar3; PROCEDURE bar3;
.. ...
PROCEDURE barN; PROCEDURE barN;
END; END;
]]>
</example> </example>
</rule> </rule>
@ -258,14 +253,12 @@ END;
since="5.1" since="5.1"
message = "The {0} ''{1}'' has a Cyclomatic Complexity of {2}." message = "The {0} ''{1}'' has a Cyclomatic Complexity of {2}."
class="net.sourceforge.pmd.lang.plsql.rule.codesize.CyclomaticComplexityRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.CyclomaticComplexityRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#CyclomaticComplexity"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#cyclomaticcomplexity">
<description> <description>
<![CDATA[
Complexity directly affects maintenance costs is determined by the number of decision points in a method Complexity directly affects maintenance costs is determined by the number of decision points in a method
plus one for the method entry. The decision points include 'if', 'while', 'for', and 'case labels' calls. plus one for the method entry. The decision points include 'if', 'while', 'for', and 'case labels' calls.
Generally, numbers ranging from 1-4 denote low complexity, 5-7 denote moderate complexity, 8-10 denote Generally, numbers ranging from 1-4 denote low complexity, 5-7 denote moderate complexity, 8-10 denote
high complexity, and 11+ is very high complexity. high complexity, and 11+ is very high complexity.
]]>
</description> </description>
<priority>3</priority> <priority>3</priority>
<example> <example>
@ -395,7 +388,7 @@ END;
since="5.1" since="5.1"
message="This class has a bunch of public methods and attributes" message="This class has a bunch of public methods and attributes"
class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePublicCountRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePublicCountRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#ExcessivePublicCount"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#excessivepubliccount">
<description> <description>
Classes with large numbers of public methods and attributes require disproportionate testing efforts Classes with large numbers of public methods and attributes require disproportionate testing efforts
since combinational side effects grow rapidly and increase risk. Refactoring these classes into since combinational side effects grow rapidly and increase risk. Refactoring these classes into
@ -426,7 +419,7 @@ public class Foo {
since="5.1" since="5.1"
message="Too many fields" message="Too many fields"
class="net.sourceforge.pmd.lang.plsql.rule.codesize.TooManyFieldsRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.TooManyFieldsRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#TooManyFields"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#toomanyfields">
<description> <description>
Classes that have too many fields can become unwieldy and could be redesigned to have fewer fields, Classes that have too many fields can become unwieldy and could be redesigned to have fewer fields,
possibly through grouping related fields in new objects. For example, a class with individual possibly through grouping related fields in new objects. For example, a class with individual
@ -441,17 +434,16 @@ CREATE OR REPLACE PACKAGE pkg_too_many_fields AS
... ...
C_CHAR_Z CONSTANT CHAR(1 CHAR) := 'Z'; C_CHAR_Z CONSTANT CHAR(1 CHAR) := 'Z';
END pkg_too_many_fields; END pkg_too_many_fields;
]]> ]]>
</example> </example>
</rule> </rule>
<rule name="NcssMethodCount"
<rule name="NcssMethodCount" message="The method {0}() has an NCSS line count of {1}" message="The method {0}() has an NCSS line count of {1}"
language="plsql" language="plsql"
since="5.1" since="5.1"
class="net.sourceforge.pmd.lang.plsql.rule.codesize.NcssMethodCountRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.NcssMethodCountRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#NcssMethodCount"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#ncssmethodcount">
<description> <description>
This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of lines This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of lines
of code for a given method. NCSS ignores comments, and counts actual statements. Using this algorithm, of code for a given method. NCSS ignores comments, and counts actual statements. Using this algorithm,
@ -470,11 +462,12 @@ END;
</example> </example>
</rule> </rule>
<rule name="NcssObjectCount" message="The Oracle object has an NCSS line count of {0}" <rule name="NcssObjectCount"
message="The Oracle object has an NCSS line count of {0}"
language="plsql" language="plsql"
since="5.1" since="5.1"
class="net.sourceforge.pmd.lang.plsql.rule.codesize.NcssObjectCountRule" class="net.sourceforge.pmd.lang.plsql.rule.codesize.NcssObjectCountRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#NcssObjectCount"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#ncssobjectcount">
<description> <description>
This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of lines This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of lines
of code for a given Oracle object. NCSS ignores comments, and counts actual statements. Using this algorithm, of code for a given Oracle object. NCSS ignores comments, and counts actual statements. Using this algorithm,
@ -492,20 +485,18 @@ CREATE OR REPLACE PACKAGE pkg_
END; END;
} }
]]> ]]>
</example></rule> </example>
</rule>
<rule <rule language="plsql"
language="plsql"
name="TooManyMethods" name="TooManyMethods"
since="5.1" since="5.1"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.rule.XPathRule"
message="This object has too many methods, consider refactoring it." message="This object has too many methods, consider refactoring it."
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/codesize.html#TooManyMethods"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_codesize.html#toomanymethods">
<description> <description>
<![CDATA[
A package or type with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to A package or type with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to
have more fine grained objects. have more fine grained objects.
]]>
</description> </description>
<priority>3</priority> <priority>3</priority>
<properties> <properties>

View File

@ -13,7 +13,7 @@ The Dates ruleset deals with PLSQL DATETIME usages.
since="5.1" since="5.1"
message="TO_DATE without date format" message="TO_DATE without date format"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/dates.html#TO_DATEWithoutDateFormat"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_dates.html#to_datewithoutdateformat">
<description> <description>
TO_DATE without date format- use TO_DATE(expression, date-format) TO_DATE without date format- use TO_DATE(expression, date-format)
</description> </description>
@ -64,7 +64,7 @@ END date_utilities ;
since="5.1" since="5.1"
message="TO_DATE(TO_CHAR(variable)) instead of TRUNC(variable)" message="TO_DATE(TO_CHAR(variable)) instead of TRUNC(variable)"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/dates.html#TO_DATE_TO_CHAR"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_dates.html#to_date_to_char">
<description> <description>
TO_DATE(TO_CHAR(date-variable)) used to remove time component - use TRUNC(date-veriable) TO_DATE(TO_CHAR(date-variable)) used to remove time component - use TRUNC(date-veriable)
</description> </description>
@ -73,11 +73,12 @@ END date_utilities ;
<property name="xpath"> <property name="xpath">
<value> <value>
<![CDATA[ <![CDATA[
//PrimaryExpression[PrimaryPrefix/Name/@Image='TO_DATE' //PrimaryExpression
and count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1 [PrimaryPrefix/Name/@Image='TO_DATE']
and .//PrimaryExpression[PrimaryPrefix/Name/@Image='TO_CHAR' [count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1]
and count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1 [.//PrimaryExpression
] [PrimaryPrefix/Name/@Image='TO_CHAR']
[count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1]
] ]
]]> ]]>
</value> </value>
@ -107,7 +108,7 @@ END date_utilities ;
message="TO_TIMESTAMP without date format" message="TO_TIMESTAMP without date format"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.rule.XPathRule"
since="5.1" since="5.1"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/dates.html#TO_TIMESTAMPWithoutDateFormat"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_dates.html#to_timestampwithoutdateformat">
<description> <description>
TO_TIMESTAMP without date format- use TO_TIMESTAMP(expression, date-format) TO_TIMESTAMP without date format- use TO_TIMESTAMP(expression, date-format)
</description> </description>
@ -152,5 +153,5 @@ END date_utilities ;
]]> ]]>
</example> </example>
</rule> </rule>
</ruleset>
</ruleset>

View File

@ -2,4 +2,8 @@
# BSD-style license; for more info see http://pmd.sourceforge.net/license.html # BSD-style license; for more info see http://pmd.sourceforge.net/license.html
# #
rulesets.filenames=rulesets/plsql/codesize.xml,rulesets/plsql/dates.xml,rulesets/plsql/TomKytesDespair.xml,rulesets/plsql/strictsyntax.xml rulesets.filenames=\
rulesets/plsql/codesize.xml,\
rulesets/plsql/dates.xml,\
rulesets/plsql/TomKytesDespair.xml,\
rulesets/plsql/strictsyntax.xml

View File

@ -13,7 +13,7 @@ The Strict Syntax ruleset contains rules that highlight invalid plsql syntax, wh
since="5.5.2" since="5.5.2"
message="Pragma should be used only inside the declaration block before 'BEGIN'." message="Pragma should be used only inside the declaration block before 'BEGIN'."
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/plsql/strictsyntax.html#MisplacedPragma"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_plsql_strictsyntax.html#misplacedpragma">
<description> <description>
Oracle states that the PRAQMA AUTONOMOUS_TRANSACTION must be in the declaration block, Oracle states that the PRAQMA AUTONOMOUS_TRANSACTION must be in the declaration block,
but the code does not complain, when being compiled on the 11g DB. but the code does not complain, when being compiled on the 11g DB.
@ -22,12 +22,15 @@ https://docs.oracle.com/cd/B28359_01/appdev.111/b28370/static.htm#BABIIHBJ
<priority>3</priority> <priority>3</priority>
<properties> <properties>
<property name="xpath"> <property name="xpath">
<value><![CDATA[ <value>
<![CDATA[
//ProgramUnit/Pragma //ProgramUnit/Pragma
]]></value> ]]>
</value>
</property> </property>
</properties> </properties>
<example><![CDATA[ <example>
<![CDATA[
create or replace package inline_pragma_error is create or replace package inline_pragma_error is
end; end;
@ -44,8 +47,8 @@ create or replace package body inline_pragma_error is
end inline_pragma_error; end inline_pragma_error;
/ /
]]>
]]></example> </example>
</rule> </rule>
</ruleset> </ruleset>