Code quality check in RPA Hub
Summarize
Summary of Code quality check in RPA Hub
Code quality check in RPA Hub is a process that evaluates automation files or scripts to ensure they comply with coding standards, best practices, and maintainability criteria. This step is crucial in the RPA development lifecycle to guarantee that automation packages are robust, efficient, and free from common errors that could affect their performance or maintainability.
Show less
RPA release managers or admins select predefined code quality rules within the RPA Hub instance. The RPA Desktop Design Studio then performs an automatic code quality check before publishing any automation package. Developers can also proactively use the Code Quality Check feature to inspect individual activities or entire projects for issues, which are presented in a detailed results window for troubleshooting.
Key Features
- Predefined Rule Selection: Admins select code quality rules that the automation must comply with.
- Automated and Proactive Checks: Code quality checks are performed automatically before publishing and can also be manually triggered by developers.
- Detailed Issue Reporting: Errors and warnings are listed with specifics, enabling targeted troubleshooting before package publishing.
- Severity-Based Publishing Control: The system property
snrpafdn.restrictpackagebyseveritygoverns whether packages with errors or warnings can be published, enforcing compliance as configured. - Configurable System Properties: Properties such as
snrpafdn.enablecodequalitycheck(to enable the feature),snrpafdn.restrictpackagebyseverity(to restrict publishing based on issue severity), andsnrpafdn.codequalitychecktimeout(to define maximum check duration) allow tailored control over the code quality process. - Rule Management: RPA Hub provides a list of predefined code quality rules and detailed rule forms where admins can edit severity, regular expressions, activation status, and values to fine-tune validations.
- Result Visibility: The outcome of code quality checks is visible in the Code Quality Result field on the package version form within RPA Hub, supporting transparency and decision-making in release management.
Practical Benefits for ServiceNow Customers
Implementing code quality checks in RPA Hub helps ServiceNow customers ensure that their automation projects meet quality standards before deployment, reducing runtime errors and maintenance overhead. The configurable severity restrictions provide control over what level of issues can block publishing, helping maintain consistent and reliable automation pipelines. The visibility into code quality results and detailed issue reporting enables proactive resolution of problems, ultimately leading to smoother automation deployments and improved bot performance.
A code quality check refers to the process of evaluating the automation file or script to assess its adherence to coding standards, best practices, maintainability, and overall quality.
Code quality check overview
Code quality checks are essential in RPA development life cycle, to ensure that the automation file is robust, efficient, and free from common issues that could lead to errors or difficulties in the future.
RPA release managers or RPA admins select code quality check rules from a pre-defined set of rules in the RPA Hub instance.
Then, the RPA Desktop Design Studio performs an in-built code quality check before publishing a package. RPA developers can also perform pro-active code quality check on a package in the RPA Desktop Design Studio by inspecting an activity or a complete automation project for any issues, using the Code Quality Check feature.
The issues and their details are displayed in the Code Quality Check Results window. Double-click an individual entry to view the component that has displayed an error or a warning. Troubleshoot the issues before you publish the automation project to RPA Hub. For more information on how to perform Code Quality Check in RPA Desktop Design Studio, see Code quality check in RPA Desktop Design Studio.
If an error or a warning occurs in the automation, a decision is derived if the package can be published successfully or not, based on the system property [sn_rpa_fdn.restrict_package_by_severity] configuration (error, warning, or no restrictions). For more information about compliance rules for RPA Desktop Design Studio, see Code quality check compliance for RPA Desktop Design Studio.
If a package version is marked with code quality result as error or warning, a decision is derived if the bot process can be published successfully or not, based on the system property [sn_rpa_fdn.restrict_package_by_severity] configuration (error, warning, or no restrictions). For more information about compliance rules for RPA Hub, see Code quality check compliance for RPA Hub.
View a list of the pre-defined code quality rules in the RPA Hub instance. For more information, see Code quality rules list in RPA Hub.
View a code quality rule form along with the type and description. For more information, see Code quality rule form in RPA Hub.
In the code quality rule form, RPA release managers and admins can edit the Severity, Regular Expression, Active, and Value fields.
View the result of the code quality check, in the Code Quality Result field of an associated package version in RPA Hub. For more information, see Package Version form in RPA Hub.
Configuration
To enable the code quality check at the instance level, ensure that you mark the new system property sn_rpa_fdn.enable_code_quality_check as true.
- sn_rpa_fdn.restrict_package_by_severity - To set a restriction on publishing a package from RPA Desktop Design Studio and publishing a bot process in RPA Hub.
- sn_rpa_fdn.code_quality_check_timeout - To enter a maximum duration, in minutes, for the completion of the code quality check.