Checking out code analysis results
- Updated: 2024/06/18
Checking out code analysis results
As a Bot Creator (RPA developer) or Citizen Developer, you can use code analysis to check and fix any coding errors in your automation files (Task Bot or API Task). You can develop automation based on configured code analysis policies and predefined rules.
With code analysis, you can improve the reliability of your automations by implementing coding best practices such as variable naming conventions, comment coverage, and error handling. Building automations conforming to the predefined guidelines or rules helps you to identify possible errors during automation development. This reduces automation failures in the production environment. You can run code analysis in both your private and public workspaces and view the results.
- Run code analysis as required.
- Get tooltip guidance for compliance with rules.
- Integration with Assistant for accounting and guidance.
Code analysis results
-
N/A: You will see the not applicable status for any of the following reasons:
- Code analysis does not apply to the object because the object is not a Task Bot or API Task file.
- There is no policy assigned to the Task Bot or API Task file or folder. When a Task Bot or API Task file or folder is in N/A status, row level actions for run code analysis option is not shown. Code analysis will not automatically run on these automations that have the N/A status.
- Not Scanned: Code analysis has not been run on the Task Bot or API Task.
- Critical: The Task Bot or API Task has a severity violation that is critical.
- High severity: The Task Bot or API Task has at least one high severity violation.
- Low severity: The Task Bot or API Task has at least one low severity violation, but no high severity violations.
- No violations: There are no code analysis violations in the Task Bot or API Task.
The following image shows an example result from code analysis:
- The automation file is edited in the private workspace and has not been saved yet.
- Code analysis is recently enabled by the administrator or there is a change in any of the rule configuration in the applicable policy for the automation file and the file is waiting to be scanned.
Reviewing results in Bot editor
- Applicable object: Displays the automation file, variable, action, and action attribute.
- Rule code: Unique RULE_CODE ID.
- Severity: High or low.
- Rule text: Description to indicate the nature of evaluation to be performed on the code.
The following image shows an example of code analysis displayed in the Assistant:
Attribute | Rules violated |
---|---|
Bot |
|
Variable |
|
Action |
|
The code analysis header displays the count of objects with a violation error within the automation file. Each object can have either low or high severity. The violation is displayed with the attribute followed by the line number and the severity. All the high severity errors are displayed first. Navigate to the corresponding line in the automation file that has the violation, rectify the violation, and save the automation.
You must save the automation file to see the latest code analysis results in the Assistant.
Code analysis violations and policy details in Bot editor
Professional and Citizen Developers can see the code analysis violations in actions at the canvas level. A violation indicator is available for flow and list views, enabling professional and Citizen Developers to quickly see and correct any actions in their automations that have code analysis violations. Code quality is enhanced when developers can easily determine violations and adhere to best practices when they are developing automations.
Professional and Citizen Developers no longer need to navigate to the policies page to view the applied policy and the rules contained in the policy. They can see the current code analysis policy and their rules from directly within the Bot editor from the drop-down menu (access from the three vertical ellipses in the upper right of the Bot editor) . This helps the users who do not have View policies and Manage policies permission to view current policy and their rules while editing the automation in the Bot editor itself instead of just viewing the violation.
System-created variables
Variables created by the system such as input or output variables, package-suggested variables, or auto-generated variables (window variables) use the default variable naming case convention from code analysis or Pascal case if no format is defined in code analysis rule.
Audit log
- Bot name
- User information
- The method through which code analysis is initiated (save option or run code analysis option)
- Time taken for the code analysis to run including details such as the number of code lines if captured by code analysis process
- Total number of violations
- Details of the violations