Analyzing issue risk in files

You can analyze risk to predict potential problems in source files attached to issues and identify files that may need attention. For example, you may want to analyze risk to identify high risk files that have priority for code review or that need an owner or workflow state change.

Risk scores are calculated based on the number of issues files are attached to during a specified time period. Files with higher risk scores compared to related files are more likely to have unresolved problems. Reviewing files with higher scores can help you address problems and prevent issues from making it into builds. See Code reviews.

Keep the following in mind:

  • To analyze risk, Surround SCM must be integrated with Helix ALM or a supported third-party issue tracking tool. See Helix ALM integration and Integrating with issue tracking tools.
  • A file's risk score increases each time it is attached to a different issue. If it is attached to the same issue multiple times, only the most recent attach event is considered in the score.
  • Recent attach events contribute more to risk scores than older events. As time passes, attach events contribute less to a file's score.

1. Choose Tools > Analyze Risk.

The Analyze Risk window opens.

2. Click Browse and select the branch and repository to analyze.

3. Select the Analysis settings.

  • Select a Helix ALM or external issue tracking tool connection. Risk scores are calculated for files attached to issues in the selected connection. Select All Connections to calculate scores for issues in all connections.
  • Optionally select an Issue filter to limit the issues included in the analysis based on the filter criteria. Filters can only be applied if one issue tracking connection is selected and if filtering is available in the issue tracking tool.
  • Select a duration to Analyze events over. You can analyze risk based on attach events over the last three months, last six months, last year, or all time.
If you change the analysis settings, previously calculated risk scores are cleared. You must reanalyze files to calculate risk scores using the updated settings.

4. Select Search expanded history to include attach events from other branches.

For example, you can include attach events performed when files were promoted, rebased, or added from another branch.

5. Click Analyze.

The risk score is calculated for all files in the selected repository and branch that meet the selected criteria. Files with higher scores compared to other files may need to be reviewed.

Sort the risk score column in descending order to rank the files from highest to lowest risk.

6. Optionally select a filter from the Filter list to limit the files displayed.

7. Select List recursively to display files in subrepositories.

8. Select a file and click a button to perform an action.

Button Action
View the selected file. See Viewing files in Surround SCM.
View the history of the selected file. See Viewing file history.
View properties for the selected file. See Viewing file properties.
Change the workflow state of the selected files. See Changing workflow states.
Change multiple custom field values for the selected files. See Changing multiple custom fields.
Perform a code review for the selected file. See Reviewing files.
Add the selected files to a code review. See Adding files to code reviews.
View code reviews for the selected file. See Viewing code reviews files are included in.