Skip to main content
Version: 2024

Code review

Introduction to code review

menu Quality > Code review

The Code review screen shows the control procedures and templates marked for review. Reviews are based on live code. You can perform manual code reviews as well as use automatic AI code reviews.

1536918582964 Code review

Code review settings

Maintenance > Configuration

Code review is not required in all situations.

  • To make code review mandatory, select Code review required. This setting affects all models. Clear it to hide the tasks for (dis)approving code and the corresponding validations.
  • To use AI code review, select both Code review required and Use AI review. Now, you can automatically perform a code review on any control procedure that is set to the status review.

See also Configuration.

AI code review

The Software Factory can use AI to automatically perform a code review on any control procedure set to be reviewed.

Prerequisites for AI code review:

To use automated AI code review on a control procedure:

menu Quality > Code review > tab Code review

  1. Us the task Ready for review to set a control procedure to review.
  2. Select the option Review by AI.

The control procedure templates are sent to OpenAI for review, along with a master prompt and code guidelines. It may take some time for the AI to complete its review.

After the review, the response is shown as separate comments on the tab Code review > Comments.

comment review comments by AI Code review comments by AI


Generative AI is intended to supplement human reviewers and should be used as a tool to assist in the review process. Users can still disable the AI review if they prefer a manual review. Feedback on AI-generated reviews is encouraged to help improve the system over time. Feel free to create a topic in the Community if you have any suggestions.

Assign a code reviewer

menu Quality > Code review > tab Code review

The control procedure can be assigned to a reviewer with the Assign to reviewer Assign to reviewer task.

Tab Assignments shows an overview of the amount of unassigned review tasks, and assigned tasks for each developer.

Review code changes and add comments

menu Quality > Code review > tab Changes

Tab Changes provides an overview of every change since the last time the control procedures have been completed. Here, you can see which control procedures and templates are new, updated, or deleted.

  • Compare template Use the Compare control procedure and Compare template tasks to preview the changes using an external compare tool like WinMerge.
  • Add Comments add to inform the developer of any errors or possible optimizations in the code. Comments are linked automatically to the selected change.

You can add general comments (not linked to a change) in tab All comments.

comment code change Add a comment to a specific change

menu Quality > Code review

When reviewing code, you may want to view its context. For example, the unaffected templates, previous code reviews, or even the entire program object code. To do so, execute the task Go to control procedure in Functionality go to cp (Alt + C).

See also Go to a related screen for an object.

Test code changes

menu Quality > Code review > tab Unit tests

When reviewing control procedures, it is helpful to run the accompanying unit tests to ensure the code is running as intended.

A badge displays the number of unit tests available for the control procedure.

For more information, see Unit tests.

Analyze code

menu Quality > Code review > tab Code analysis

The Code analysis tab allows you to perform an automated static code analysis on the generated T-SQL code.

  1. Execute the Code Analysis Analyze code task for a control procedure.

    Icons show if a program object has warnings or errors.

  2. Manually add issues that need to be resolved before code changes can be approved to the code review comments.

image292 Code analysis

The code analysis will check over 60 rules covering, for instance:

  • Type checking
  • Use of patterns in LIKE predicates
  • Potential SQL Injection Issue
  • Avoid cross server joins
  • Deprecated JOIN syntax
  • Use two part naming
  • Use of nolock / UNCOMMITTED READS
  • Use of Table / Query hints
  • Use of Select *
  • Explicit Conversion of Columnar data - Non Sargable predicates
  • Ordinal positions in ORDER BY Clauses
  • Change Of DateFormat and DateFirst
  • Missing Column specifications on insert
  • SET OPTION usage
  • Use 2 part naming in EXECUTE statements
  • Use of RANGE windows in SQL Server 2012
  • Create table statements should specify schema
  • View created with ORDER
  • Writable cursors
  • SET NOCOUNT ON should be included inside stored procedures
  • COUNT(*) used when EXISTS/NOT EXISTS can be more performant
  • Use of TOP(100) percent or TOP(>9999) in a derived table.

Approve or disapprove code changes

menu Quality > Code review > tab Code review

  1. Use the tasks to approve or disapprove the changes.
  • Approve Approve changes - the control procedure will be set to Completed.
  • Disapprove Disapprove changes - a comment is required as feedback, if not already added. The control procedure status will be set to Waiting for developer.

Undo a code change (dis)approval

It is possible to undo a wrong choice when reviewing a control procedure. Since this is not meant for making historical corrections, you can only undo the most recent (dis)approval for a control procedure.

menu Quality > Code review > tab Code review

  1. Execute the Undo undo task. This task only becomes available after approving approve or disapproving disapprove a control procedure.

The control procedure status will be reset to Review. The live code will be available for review again.

Resolve comments

menu Quality > Code review > tab All comments


Any comments made by the reviewer are also available in the Functionality screen (menu Business logic > Functionality).

  1. You can choose to Resolve resolve the comments or mark the comment as Won't fix won't fix and explain this decision by replying with a comment.
  2. When done, set the procedure to Review review again. If not all comments have been resolved, you will be notified.

Resolve comments in Code review

All comments overview

menu Quality > Code review > tab All comments

Tab All comments contains an overview of all comments on every change in the selected code review record. Here, you can also add a comment that is not linked to a specific change.

The automatically generated comments state whether a control procedure has been disapproved or retracted. The following situations and comments are possible:

  • Changes to the control procedure's code after it has been marked for review:
    • Title: "Control procedure was updated after it was submitted for review."
    • Comment: "The control procedure was updated by [Developer] after the changelog was submitted for review."
  • Changes to the template code after a control procedure has been marked for review:
    • Title: "Template was updated after it was submitted for review."
    • Comment: "The template code was updated by [Developer] after the changelog was submitted for review."
  • Changes to the status of the changelog or code review:
    • "Code review was retracted by [Developer]."
    • "Code review was disapproved by [Developer]."
    • "Code review has been reopened by [Developer]."


menu Quality > Code review > tab Assignments

The Assignments tab shows an overview of the code review tasks that are assigned to a developer.

code_review_assignments Assignments

Was this page helpful?

Happy React is loading...