Submitting your review

Klocwork Code Review supports two types of code review workflows--pre-checkin and post-checkin. Your code review workflow may depend on your company's policy or the SCM system you use. Some organizations or teams use both workflows.

Pre-checkin

If your organization has a policy requiring code reviews for key files or modules before they are checked into source control, then the pre-checkin model is the way to go. Pre-checkin code reviews are also known as ‘blocking’ code reviews because developers cannot complete the work and check in until the code changes are approved. Note that Code Review does not actually provide a method for blocking or gating commits to your SCM. This must be done independently, as part of your regular software development process.

Create a pre-checkin code review from your IDE using the Code Review plug-in or from the command-line with kwcodereview (if you use an unsupported IDE or text editor).

Post-checkin

Post-checkin code reviews can be used in environments where you submit code, review and fix or where development code resides on separate work branches that will be merged to the main-line code after approval. In other situations, a manager may opt to do post-checkin reviews to keep an eye on revisions without holding up the work.

Post-checkin code reviews appear as revisions in the product portal. We recommend loading new revisions on a regular basis to maintain sequential history. Typically, this process is scripted using a continuous integration system or set up to run automatically using a Unix command, such as crond.