Merge branch 'pr-705'
This commit is contained in:
@ -5,33 +5,33 @@ folder: pmd/rules
|
||||
---
|
||||
List of rulesets and rules contained in each ruleset.
|
||||
|
||||
* [Code Size](pmd_rules_plsql_codesize.html): The Code Size ruleset contains rules that find problems related to code size or complexity.
|
||||
* [PLSQL DATETIME](pmd_rules_plsql_dates.html): The Dates ruleset deals with PLSQL DATETIME usages.
|
||||
* [Strict Syntax](pmd_rules_plsql_strictsyntax.html): The Strict Syntax ruleset contains rules that highlight invalid plsql syntax, which works, but should be avoided.
|
||||
* [Tom Kyte's Despair](pmd_rules_plsql_TomKytesDespair.html): Rules based on Thomas Kyte's recommendations on http://asktom.oracle.com/ and http://tkyte.blogspot.com/.
|
||||
* [Best Practices](pmd_rules_plsql_bestpractices.html): Rules which enforce generally accepted best practices.
|
||||
* [Codestyle](pmd_rules_plsql_codestyle.html): Rules which enforce a specific coding style.
|
||||
* [Design](pmd_rules_plsql_design.html): Rules that help you discover design issues.
|
||||
* [Error Prone](pmd_rules_plsql_errorprone.html): Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.
|
||||
|
||||
## Code Size
|
||||
* [CyclomaticComplexity](pmd_rules_plsql_codesize.html#cyclomaticcomplexity): Complexity directly affects maintenance costs is determined by the number of decision points in a...
|
||||
* [ExcessiveMethodLength](pmd_rules_plsql_codesize.html#excessivemethodlength): When methods are excessively long this usually indicates that the method is doing more than itsna...
|
||||
* [ExcessiveObjectLength](pmd_rules_plsql_codesize.html#excessiveobjectlength): Excessive object line lengths are usually indications that the object may be burdened with excess...
|
||||
* [ExcessivePackageBodyLength](pmd_rules_plsql_codesize.html#excessivepackagebodylength): Excessive class file lengths are usually indications that the class may be burdened with excessiv...
|
||||
* [ExcessivePackageSpecificationLength](pmd_rules_plsql_codesize.html#excessivepackagespecificationlength): Excessive class file lengths are usually indications that the class may be burdened with excessiv...
|
||||
* [ExcessiveParameterList](pmd_rules_plsql_codesize.html#excessiveparameterlist): Methods with numerous parameters are a challenge to maintain, especially if most of them share th...
|
||||
* [ExcessiveTypeLength](pmd_rules_plsql_codesize.html#excessivetypelength): Excessive class file lengths are usually indications that the class may be burdened with excessiv...
|
||||
* [NcssMethodCount](pmd_rules_plsql_codesize.html#ncssmethodcount): This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of l...
|
||||
* [NcssObjectCount](pmd_rules_plsql_codesize.html#ncssobjectcount): This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of l...
|
||||
* [NPathComplexity](pmd_rules_plsql_codesize.html#npathcomplexity): The NPath complexity of a method is the number of acyclic execution paths through that method.A t...
|
||||
* [TooManyFields](pmd_rules_plsql_codesize.html#toomanyfields): Classes that have too many fields can become unwieldy and could be redesigned to have fewer field...
|
||||
* [TooManyMethods](pmd_rules_plsql_codesize.html#toomanymethods): A package or type with too many methods is probably a good suspect for refactoring, in order to r...
|
||||
## Best Practices
|
||||
* [TomKytesDespair](pmd_rules_plsql_bestpractices.html#tomkytesdespair): "WHEN OTHERS THEN NULL" hides all errors - (Re)RAISE an exception or call RAISE_APPLICATION_ERROR
|
||||
|
||||
## PLSQL DATETIME
|
||||
* [TO_DATE_TO_CHAR](pmd_rules_plsql_dates.html#to_date_to_char): TO_DATE(TO_CHAR(date-variable)) used to remove time component - use TRUNC(date-veriable)
|
||||
* [TO_DATEWithoutDateFormat](pmd_rules_plsql_dates.html#to_datewithoutdateformat): TO_DATE without date format- use TO_DATE(expression, date-format)
|
||||
* [TO_TIMESTAMPWithoutDateFormat](pmd_rules_plsql_dates.html#to_timestampwithoutdateformat): TO_TIMESTAMP without date format- use TO_TIMESTAMP(expression, date-format)
|
||||
## Codestyle
|
||||
* [MisplacedPragma](pmd_rules_plsql_codestyle.html#misplacedpragma): Oracle states that the PRAQMA AUTONOMOUS_TRANSACTION must be in the declaration block,but the cod...
|
||||
|
||||
## Strict Syntax
|
||||
* [MisplacedPragma](pmd_rules_plsql_strictsyntax.html#misplacedpragma): Oracle states that the PRAQMA AUTONOMOUS_TRANSACTION must be in the declaration block,but the cod...
|
||||
## Design
|
||||
* [CyclomaticComplexity](pmd_rules_plsql_design.html#cyclomaticcomplexity): Complexity directly affects maintenance costs is determined by the number of decision points in a...
|
||||
* [ExcessiveMethodLength](pmd_rules_plsql_design.html#excessivemethodlength): When methods are excessively long this usually indicates that the method is doing more than itsna...
|
||||
* [ExcessiveObjectLength](pmd_rules_plsql_design.html#excessiveobjectlength): Excessive object line lengths are usually indications that the object may be burdened with excess...
|
||||
* [ExcessivePackageBodyLength](pmd_rules_plsql_design.html#excessivepackagebodylength): Excessive class file lengths are usually indications that the class may be burdened with excessiv...
|
||||
* [ExcessivePackageSpecificationLength](pmd_rules_plsql_design.html#excessivepackagespecificationlength): Excessive class file lengths are usually indications that the class may be burdened with excessiv...
|
||||
* [ExcessiveParameterList](pmd_rules_plsql_design.html#excessiveparameterlist): Methods with numerous parameters are a challenge to maintain, especially if most of them share th...
|
||||
* [ExcessiveTypeLength](pmd_rules_plsql_design.html#excessivetypelength): Excessive class file lengths are usually indications that the class may be burdened with excessiv...
|
||||
* [NcssMethodCount](pmd_rules_plsql_design.html#ncssmethodcount): This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of l...
|
||||
* [NcssObjectCount](pmd_rules_plsql_design.html#ncssobjectcount): This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determine the number of l...
|
||||
* [NPathComplexity](pmd_rules_plsql_design.html#npathcomplexity): The NPath complexity of a method is the number of acyclic execution paths through that method.A t...
|
||||
* [TooManyFields](pmd_rules_plsql_design.html#toomanyfields): Classes that have too many fields can become unwieldy and could be redesigned to have fewer field...
|
||||
* [TooManyMethods](pmd_rules_plsql_design.html#toomanymethods): A package or type with too many methods is probably a good suspect for refactoring, in order to r...
|
||||
|
||||
## Tom Kyte's Despair
|
||||
* [TomKytesDespair](pmd_rules_plsql_TomKytesDespair.html#tomkytesdespair): "WHEN OTHERS THEN NULL" hides all errors - (Re)RAISE an exception or call RAISE_APPLICATION_ERROR
|
||||
## Error Prone
|
||||
* [TO_DATE_TO_CHAR](pmd_rules_plsql_errorprone.html#to_date_to_char): TO_DATE(TO_CHAR(date-variable)) used to remove time component - use TRUNC(date-variable)
|
||||
* [TO_DATEWithoutDateFormat](pmd_rules_plsql_errorprone.html#to_datewithoutdateformat): TO_DATE without date format- use TO_DATE(expression, date-format)
|
||||
* [TO_TIMESTAMPWithoutDateFormat](pmd_rules_plsql_errorprone.html#to_timestampwithoutdateformat): TO_TIMESTAMP without date format- use TO_TIMESTAMP(expression, date-format)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: Tom Kyte's Despair
|
||||
summary: Rules based on Thomas Kyte's recommendations on http://asktom.oracle.com/ and http://tkyte.blogspot.com/.
|
||||
permalink: pmd_rules_plsql_TomKytesDespair.html
|
||||
title: Best Practices
|
||||
summary: Rules which enforce generally accepted best practices.
|
||||
permalink: pmd_rules_plsql_bestpractices.html
|
||||
folder: pmd/rules/plsql
|
||||
sidebaractiveurl: /pmd_rules_plsql.html
|
||||
editmepath: ../pmd-plsql/src/main/resources/rulesets/plsql/TomKytesDespair.xml
|
||||
keywords: Tom Kyte's Despair, TomKytesDespair
|
||||
editmepath: ../pmd-plsql/src/main/resources/category/plsql/bestpractices.xml
|
||||
keywords: Best Practices, TomKytesDespair
|
||||
---
|
||||
## TomKytesDespair
|
||||
|
||||
@ -66,6 +66,6 @@ END update_planned_hrs;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/TomKytesDespair.xml/TomKytesDespair" />
|
||||
<rule ref="rulesets/plsql/bestpractices.xml/TomKytesDespair" />
|
||||
```
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: Strict Syntax
|
||||
summary: The Strict Syntax ruleset contains rules that highlight invalid plsql syntax, which works, but should be avoided.
|
||||
permalink: pmd_rules_plsql_strictsyntax.html
|
||||
title: Codestyle
|
||||
summary: Rules which enforce a specific coding style.
|
||||
permalink: pmd_rules_plsql_codestyle.html
|
||||
folder: pmd/rules/plsql
|
||||
sidebaractiveurl: /pmd_rules_plsql.html
|
||||
editmepath: ../pmd-plsql/src/main/resources/rulesets/plsql/strictsyntax.xml
|
||||
keywords: Strict Syntax, MisplacedPragma
|
||||
editmepath: ../pmd-plsql/src/main/resources/category/plsql/codestyle.xml
|
||||
keywords: Codestyle, MisplacedPragma
|
||||
---
|
||||
## MisplacedPragma
|
||||
|
||||
@ -44,6 +44,6 @@ end inline_pragma_error;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/strictsyntax.xml/MisplacedPragma" />
|
||||
<rule ref="rulesets/plsql/codestyle.xml/MisplacedPragma" />
|
||||
```
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: Code Size
|
||||
summary: The Code Size ruleset contains rules that find problems related to code size or complexity.
|
||||
permalink: pmd_rules_plsql_codesize.html
|
||||
title: Design
|
||||
summary: Rules that help you discover design issues.
|
||||
permalink: pmd_rules_plsql_design.html
|
||||
folder: pmd/rules/plsql
|
||||
sidebaractiveurl: /pmd_rules_plsql.html
|
||||
editmepath: ../pmd-plsql/src/main/resources/rulesets/plsql/codesize.xml
|
||||
keywords: Code Size, NPathComplexity, ExcessiveMethodLength, ExcessiveParameterList, ExcessiveObjectLength, ExcessiveTypeLength, ExcessivePackageBodyLength, ExcessivePackageSpecificationLength, CyclomaticComplexity, TooManyFields, NcssMethodCount, NcssObjectCount, TooManyMethods
|
||||
editmepath: ../pmd-plsql/src/main/resources/category/plsql/design.xml
|
||||
keywords: Design, CyclomaticComplexity, ExcessiveMethodLength, ExcessiveObjectLength, ExcessivePackageBodyLength, ExcessivePackageSpecificationLength, ExcessiveParameterList, ExcessiveTypeLength, NcssMethodCount, NcssObjectCount, NPathComplexity, TooManyFields, TooManyMethods
|
||||
---
|
||||
## CyclomaticComplexity
|
||||
|
||||
@ -18,7 +18,7 @@ plus one for the method entry. The decision points include 'if', 'while', 'for'
|
||||
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.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.CyclomaticComplexityRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/CyclomaticComplexityRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.CyclomaticComplexityRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/CyclomaticComplexityRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -149,7 +149,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/CyclomaticComplexity" />
|
||||
<rule ref="rulesets/plsql/design.xml/CyclomaticComplexity" />
|
||||
```
|
||||
|
||||
## ExcessiveMethodLength
|
||||
@ -163,7 +163,7 @@ name/signature might suggest. They also become challenging for others to digest
|
||||
scrolling causes readers to lose focus.
|
||||
Try to reduce the method length by creating helper methods and removing any copy/pasted code.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveMethodLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/ExcessiveMethodLengthRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.ExcessiveMethodLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveMethodLengthRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -186,7 +186,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/ExcessiveMethodLength" />
|
||||
<rule ref="rulesets/plsql/design.xml/ExcessiveMethodLength" />
|
||||
```
|
||||
|
||||
## ExcessiveObjectLength
|
||||
@ -199,7 +199,7 @@ Excessive object line lengths are usually indications that the object may be bur
|
||||
responsibilities that could be provided by other objects. In breaking these methods
|
||||
apart the code becomes more managable and ripe for reuse.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveObjectLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/ExcessiveObjectLengthRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.ExcessiveObjectLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveObjectLengthRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -233,7 +233,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/ExcessiveObjectLength" />
|
||||
<rule ref="rulesets/plsql/design.xml/ExcessiveObjectLength" />
|
||||
```
|
||||
|
||||
## ExcessivePackageBodyLength
|
||||
@ -246,7 +246,7 @@ Excessive class file lengths are usually indications that the class may be burde
|
||||
responsibilities that could be provided by external classes or functions. In breaking these methods
|
||||
apart the code becomes more managable and ripe for reuse.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePackageBodyLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/ExcessivePackageBodyLengthRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.ExcessivePackageBodyLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageBodyLengthRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -280,7 +280,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/ExcessivePackageBodyLength" />
|
||||
<rule ref="rulesets/plsql/design.xml/ExcessivePackageBodyLength" />
|
||||
```
|
||||
|
||||
## ExcessivePackageSpecificationLength
|
||||
@ -293,7 +293,7 @@ Excessive class file lengths are usually indications that the class may be burde
|
||||
responsibilities that could be provided by external classes or functions. In breaking these methods
|
||||
apart the code becomes more managable and ripe for reuse.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessivePackageSpecificationLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/ExcessivePackageSpecificationLengthRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.ExcessivePackageSpecificationLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessivePackageSpecificationLengthRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -320,7 +320,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/ExcessivePackageSpecificationLength" />
|
||||
<rule ref="rulesets/plsql/design.xml/ExcessivePackageSpecificationLength" />
|
||||
```
|
||||
|
||||
## ExcessiveParameterList
|
||||
@ -332,7 +332,7 @@ END;
|
||||
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.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveParameterListRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/ExcessiveParameterListRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.ExcessiveParameterListRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveParameterListRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -362,7 +362,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/ExcessiveParameterList" />
|
||||
<rule ref="rulesets/plsql/design.xml/ExcessiveParameterList" />
|
||||
```
|
||||
|
||||
## ExcessiveTypeLength
|
||||
@ -375,7 +375,7 @@ Excessive class file lengths are usually indications that the class may be burde
|
||||
responsibilities that could be provided by external classes or functions. In breaking these methods
|
||||
apart the code becomes more managable and ripe for reuse.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.ExcessiveTypeLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/ExcessiveTypeLengthRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.ExcessiveTypeLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/ExcessiveTypeLengthRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -409,7 +409,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/ExcessiveTypeLength" />
|
||||
<rule ref="rulesets/plsql/design.xml/ExcessiveTypeLength" />
|
||||
```
|
||||
|
||||
## NcssMethodCount
|
||||
@ -422,7 +422,7 @@ This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determin
|
||||
of code for a given method. NCSS ignores comments, and counts actual statements. Using this algorithm,
|
||||
lines of code that are split are counted as one.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.NcssMethodCountRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/NcssMethodCountRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.NcssMethodCountRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssMethodCountRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -445,7 +445,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/NcssMethodCount" />
|
||||
<rule ref="rulesets/plsql/design.xml/NcssMethodCount" />
|
||||
```
|
||||
|
||||
## NcssObjectCount
|
||||
@ -458,7 +458,7 @@ This rule uses the NCSS (Non-Commenting Source Statements) algorithm to determin
|
||||
of code for a given Oracle object. NCSS ignores comments, and counts actual statements. Using this algorithm,
|
||||
lines of code that are split are counted as one.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.NcssObjectCountRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/NcssObjectCountRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.NcssObjectCountRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/NcssObjectCountRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -483,7 +483,7 @@ CREATE OR REPLACE PACKAGE pkg_
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/NcssObjectCount" />
|
||||
<rule ref="rulesets/plsql/design.xml/NcssObjectCount" />
|
||||
```
|
||||
|
||||
## NPathComplexity
|
||||
@ -496,7 +496,7 @@ The NPath complexity of a method is the number of acyclic execution paths throug
|
||||
A threshold of 200 is generally considered the point where measures should be taken to reduce
|
||||
complexity and increase readability.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.NPathComplexityRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/NPathComplexityRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.NPathComplexityRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/NPathComplexityRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -545,7 +545,7 @@ END;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/NPathComplexity" />
|
||||
<rule ref="rulesets/plsql/design.xml/NPathComplexity" />
|
||||
```
|
||||
|
||||
## TooManyFields
|
||||
@ -558,7 +558,7 @@ Classes that have too many fields can become unwieldy and could be redesigned to
|
||||
possibly through grouping related fields in new objects. For example, a class with individual
|
||||
city/state/zip fields could park them within a single Address field.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codesize.TooManyFieldsRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codesize/TooManyFieldsRule.java)
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.design.TooManyFieldsRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/design/TooManyFieldsRule.java)
|
||||
|
||||
**Example(s):**
|
||||
|
||||
@ -579,7 +579,7 @@ END pkg_too_many_fields;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/TooManyFields" />
|
||||
<rule ref="rulesets/plsql/design.xml/TooManyFields" />
|
||||
```
|
||||
|
||||
## TooManyMethods
|
||||
@ -633,6 +633,6 @@ have more fine grained objects.
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/codesize.xml/TooManyMethods" />
|
||||
<rule ref="rulesets/plsql/design.xml/TooManyMethods" />
|
||||
```
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: PLSQL DATETIME
|
||||
summary: The Dates ruleset deals with PLSQL DATETIME usages.
|
||||
permalink: pmd_rules_plsql_dates.html
|
||||
title: Error Prone
|
||||
summary: Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.
|
||||
permalink: pmd_rules_plsql_errorprone.html
|
||||
folder: pmd/rules/plsql
|
||||
sidebaractiveurl: /pmd_rules_plsql.html
|
||||
editmepath: ../pmd-plsql/src/main/resources/rulesets/plsql/dates.xml
|
||||
keywords: PLSQL DATETIME, TO_DATEWithoutDateFormat, TO_DATE_TO_CHAR, TO_TIMESTAMPWithoutDateFormat
|
||||
editmepath: ../pmd-plsql/src/main/resources/category/plsql/errorprone.xml
|
||||
keywords: Error Prone, TO_DATE_TO_CHAR, TO_DATEWithoutDateFormat, TO_TIMESTAMPWithoutDateFormat
|
||||
---
|
||||
## TO_DATE_TO_CHAR
|
||||
|
||||
@ -13,7 +13,7 @@ keywords: PLSQL DATETIME, TO_DATEWithoutDateFormat, TO_DATE_TO_CHAR, TO_TIMESTAM
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
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-variable)
|
||||
|
||||
```
|
||||
//PrimaryExpression
|
||||
@ -30,8 +30,8 @@ TO_DATE(TO_CHAR(date-variable)) used to remove time component - use TRUNC(date-v
|
||||
``` sql
|
||||
CREATE OR REPLACE PACKAGE BODY date_utilities
|
||||
IS
|
||||
|
||||
-- Take single parameter, relyimg on current default NLS date format
|
||||
|
||||
-- Take single parameter, relying on current default NLS date format
|
||||
FUNCTION strip_time (p_date IN DATE) RETURN DATE
|
||||
IS
|
||||
BEGIN
|
||||
@ -45,7 +45,7 @@ END date_utilities;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/dates.xml/TO_DATE_TO_CHAR" />
|
||||
<rule ref="rulesets/plsql/errorprone.xml/TO_DATE_TO_CHAR" />
|
||||
```
|
||||
|
||||
## TO_DATEWithoutDateFormat
|
||||
@ -66,7 +66,7 @@ TO_DATE without date format- use TO_DATE(expression, date-format)
|
||||
CREATE OR REPLACE PACKAGE BODY date_utilities
|
||||
IS
|
||||
|
||||
-- Take single parameter, relyimg on current default NLS date format
|
||||
-- Take single parameter, relying on current default NLS date format
|
||||
FUNCTION to_date_single_parameter (p_date_string IN VARCHAR2) RETURN DATE
|
||||
IS
|
||||
BEGIN
|
||||
@ -93,7 +93,7 @@ END date_utilities;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/dates.xml/TO_DATEWithoutDateFormat" />
|
||||
<rule ref="rulesets/plsql/errorprone.xml/TO_DATEWithoutDateFormat" />
|
||||
```
|
||||
|
||||
## TO_TIMESTAMPWithoutDateFormat
|
||||
@ -114,7 +114,7 @@ TO_TIMESTAMP without date format- use TO_TIMESTAMP(expression, date-format)
|
||||
CREATE OR REPLACE PACKAGE BODY date_utilities
|
||||
IS
|
||||
|
||||
-- Take single parameter, relyimg on current default NLS date format
|
||||
-- Take single parameter, relying on current default NLS date format
|
||||
FUNCTION to_timestamp_single_parameter (p_date_string IN VARCHAR2) RETURN DATE
|
||||
IS
|
||||
BEGIN
|
||||
@ -141,6 +141,6 @@ END date_utilities;
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
<rule ref="rulesets/plsql/dates.xml/TO_TIMESTAMPWithoutDateFormat" />
|
||||
<rule ref="rulesets/plsql/errorprone.xml/TO_TIMESTAMPWithoutDateFormat" />
|
||||
```
|
||||
|
Reference in New Issue
Block a user