The Code Analysis window provides detailed analysis, including a results dashboard, report, and tree view with violations and code properties. You can also simultaneously analyze multiple files from this window.
|
Note: This feature is available in the Professional Edition and higher. |
To perform detailed code analysis
Load files or objects to analyze.
Open files. | |
Load objects from the database. You can click the drop-down arrow beside this button to load all objects or choose a group of objects to load. |
Select the rule set you want to use in the Code Analysis toolbar (the default is Top 20).
To evaluate statements' complexity and validity, select Run SQL Scan in the Run Review list on the Code Analysis toolbar.
Select the items to analyze in the grid.
Use SHIFT or CTRL to select multiple items.
Analyze code for all selected items. Click or press F9. (Ensure Run Review is selected.)
Alternatively, to apply your selection to all items press F5.
Review the Code Analysis results.
Send code back to the Code Editor from the selected file or object. SQL Navigator displays the Code Analysis errors and violations in the tabs below the Code Editor. |
Additional details
Grid Dashboard |
The right side of the grid displays a dashboard of violations and statistics. The dashboard includes the item's Toad Code Rating (TCR), which is a composite of several rating criteria. The score ranges from 1 (best) to 4 (worst). It provides a quick reference for how your code has performed in the analysis. | ||
Result tab |
The Results tab displays the analysis results in a tree view. Expand each node for details on the violations. If you select a violation in the tree view, the preview on the right displays the corresponding code. The Result tab displays the results for the item selected in the grid. If you analyzed multiple items and select them in the grid, the tab displays the results for all of the selected items.
| ||
Report tab |
The Reports tab summarizes the analysis results and includes rule definitions. Items in the table of contents are hyperlinked so you can easily navigate the report.
|
A rule set is a collection of rules that Code Analysis uses to evaluate code. You can create your own rule set and determine which rules to include. You can also import existing rule sets from outside SQL Navigator, and export user-defined rule sets.
Icon | Description | ||
---|---|---|---|
Edit the selected rule set.
| |||
Create a rule set | |||
Use the selected rule set as your template |
For each rule in the rule set, select the rule to include it, deselect the rule to exclude it.
Icon | Description |
---|---|
Import a rule set. Navigate to the location of the rule set and click Open. If the rule set has user defined rules then when importing you will be asked if a rule-export file exists, and you want to import it. If so the rules are imported. If any rule numbering has to occur because of conflicts, the rule set is automatically updated to the new rule numbers. | |
Export a user-defined rule set. If the rule set has user defined rules then when exporting you will be asked if you want to export those user-defined rules with the rule set. If so the rules are saved as RuleExport.XML in the same directory as the exported rule set. |
You can use existing Code Analysis rules or clone them and customize them to confirm your code meets your code review requirements. you can import and export rules.
Icon | Description | The Code Analysis Rule Builder |
---|---|---|
Create a rule |
Rule IDs are automatically generated sequentially from 7000 to 9000.
Enter the Description and specify the Rule Tip.
| |
Clone the selected rule |
A checked box in the User Defined column will be displayed for the rule you created.
Select the rule to edit. Edit the fields as necessary.
Field | Description |
---|---|
Code Preview | Enter code to use for testing the rule. |
XPath Expression |
Edit the XPath. If this field is blank, then you cannot edit the XPath for the rule. To test the rule, click . |
To restore a rule or all rules, you can select the rule and click the 'Restore Original Rule Value' button, or the double-arrow 'Restore All Original Rule Values' button.
Icon | Description | ||
---|---|---|---|
Import a rule. Navigate to the location of the rule and click Open.
| |||
Export the selected user-defined rule. |
Drag and drop PL/SQL syntax, SQL functions, column names, and database object names into code.
Code Snippets are stored in catalogs. The catalogs are as follows.
Catalog | Description | ||
---|---|---|---|
Syntax and Web Catalog | Browse the ready-to-use library of PL/SQL syntax. The Knowledge Xpert gives SQL Navigator users a library of more than 900 pre-built PL/SQL routines that can eliminate hours of low-level coding and debugging while enhancing application performance and reliability. | ||
PL/Vision Catalog | Knowledge Xpert products are available as optional add-on modules. For more information, see Search Knowledge Xpert. | ||
Code and SQL Catalog |
Store your own frequently used SQL statements and code fragments here. For example, you can store your frequently-used cursor declarations or variable declarations.
|
Icon | Tool Tip | Description | ||
---|---|---|---|---|
Add new item or node |
Add a code snippet or SQL statement. Open the Add to Catalog / Edit Dialog. | |||
Edit item or node |
Edit the selected item. Open the Add to Catalog / Edit Dialog.
| |||
Delete item or node |
Delete the selected item.
| |||
Paste snippet into editor |
Use to paste a code snippet into an editor:
| |||
Show information window |
Show/Hide the information pane. The information pane shows detailed information on the selected item. | |||
Capture code |
Use to add a code snippet or SQL statement from an editor window into the catalog:
This opens the Add to Catalog / Edit Dialog with the selected code already inserted. | |||
Save all catalogs to disk |
Save changes. |
© ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center