Reviewing files

You can review entire files in a code review. For example, you may want to review all file contents before a new set of changes are made to existing files.

Note: You can also perform ad hoc reviews when viewing files in the Source Tree window or analyzing risk of files attached to issues. Select a file and choose Activities > Code Review > Review File. You are prompted to add the file to a code review when you add the first comment. See Adding files to code reviews.

1. Open the code review and double-click the file to review.

The file opens in a new tab in the Code Review window. Depending on how the file was added to the review, differences between file versions may be displayed by default. Click the Show file version without highlighted differences button to view the entire file without highlighted differences.

Note: Large files take longer to open in code reviews if syntax highlighting is used. You can set a maximum file size limit in the user options to disable highlighting in large files to improve performance. See Changing file viewer and editor text display options.

2. To find text in the file, enter the text in the search field and click Find.

3. To view another version of the file, select the Version from the list.

Versions not included in the review are displayed in gray. If you are reviewing a file after a review was restarted, the last version you reviewed and earlier versions are displayed in italics.

4. Click the Options button to apply syntax highlighting or change the differences output, text font, or tab width in files. See Changing code review view options.

5. If you are reviewing an image file, click a button to change how differences are displayed or enter a percentage to change the magnification. See Viewing image file differences.

6. Click a view button to display the differences between the latest file version and the version before the oldest version in the review. You can also select different versions to compare. See Reviewing changes between file versions.

7. On the Comments tab, add comments, navigate between them, or mark them as addressed.

Note: The content that a comment applies to may move to a different line as the file is updated and reviewed again. To view the content a comment applies to in the version it was originally added to, right-click the Comment icon or the Multiple Comments icon next to the line number and choose Show Version. The available options depend on the view you are using (e.g., side by side or top over bottom) and the version currently displayed.

8. Click the History tab to view history information for the file.

You can also perform actions on historic file versions. See Viewing file history. The code review is updated based on actions you perform. For example, if you select a version on the History tab and add it to the code review, the review updates to include that version.

9. Select the check box in the Completed column when you finish reviewing the file. You can only mark files as completed if you are a reviewer in the code review.

The file status changes to Needs Attention or Approved when all reviewers complete the review. See Understanding code review status.