The core code review and quality control engine analyses PL/SQL code against 180 standardised code review rules and allows creating custom requirements in XPath.
Follow this guide to create custom rules for code analysis.
To create a custom code review rule, the user should be familiar with the XML Path Language (XPath). To learn the XPath syntax, refer to the external resources msdn.microsoft.com and www.w3schools.com.
Let's consider the following example:
The package SOME_CUSTOMER_DEPRECATED_PACKAGE has been deprecated.
Make sure the package SOME_CUSTOMER_DEPRECATED_PACKAGE is no longer used in the code.
Go to Options > Code Analyzer Options > Code Review Options, and click Add New. The Code Review Rule Editor will open.
Enter the code review name.
For example: Avoid use of SOME_CUSTOMER_DEPRECATED_PACKAGE package.
Select a severity level: Major; category: Maintainability; code element: PL/SQL.
On the Rationale subtab, enter a short description of the rule's usage.
<p>The company has deprecated the SOME_CUSTOMER_DEPRECATED_PACKAGE package.
Do not use this package.</p>
Switch to the XPath Expressions and Code Sample tab.