Klocwork Review report types
From Insight-9.0
Contents |
Fix Activity
In the Report list, select Fix Activity and then Component or Owner (if available):
The Fix Activity report reports on issues fixed between builds.
When more than one build is selected or a time frame is selected that contains more than one build, bars in the graph show build pairs. For example, if three builds are selected, then two bars would be shown: one illustrating the number of fixed issues between build_1 and build_2, and a second showing the number of fixed issues between build_2 and build_3.
If only one build is selected, this report shows fixes since the previous build.
Fix Activity reports can be summarized by:
- owner (if file/class ownership has been loaded into the Klocwork database).
- component
By default, Fix Activity Summarized by Owner displays desktop fixes for the last 10 builds on the Project Summary page.
Fix Activity reports show a count of:
- all issues fixed at both the desktop and system levels.
- desktop fixes, which are issues fixed before being checked in to system builds.
- system fixes that occur to issues detected in the system build analysis.
When an issue shows up in the desktop component but not in the system build, it means that the desktop issue was detected and fixed while the developer was coding (before submitting code to the system build). Desktop fixes are preventative fixes because the problems were fixed before check-in. Viewing Fix Activity by desktop indicates who has been using Klocwork on the desktop.
You can view Fix Activity reports as a stackbar or table. The stackbar provides a fixed-issue count on the y-axis and either build names corresponding to a selected time interval or selected builds along the x-axis.
When you summarize the report by component, you can use the drill-down feature by clicking active areas of the chart.
Citing Activity
In the Report list, select Citing Activity.
Citing Activity displays status changes over time, between builds. The report reflects the time frame of the date range or builds you select.
Citing Activity indicates how detected issues are being prioritized by your team.
When developers cite issues, they are assigning statuses and comments that indicate how the detected issue should be handled. For example, the "Fix" status indicates that the issues should be fixed as soon as possible. Analyze is the default initial status and it indicates the detected issue needs to be reviewed.
The Citing Activity report shows
- an Update summary in the form of a pie chart, which indicates user updates by status type. You can access a list of issues by status by clicking a slice. See Drill down.
- an Update History indicating user updates over time. The time frame on the X-axis is determined by your selected dates. Intervals are by:
- day for a date range that’s less than or equal to 28 days
- week for a range that’s less than or equal to 62 days
- month for a range that’s greater than 62 days
- User updates in a table format that capture the number of issues changed to a given status. The Backlog column captures the number of issues that are still in Analyze status, which indicates that these issues haven’t been assessed. You’ll only see a particular status column if an issue has been changed to that status. Column headings are sortable and clicking the "number link" in a status column will bring you to a list of issues.
Note: You only see a Backlog report by owner if owners are loaded into the Klocwork database. If ownership is not set up, uncited issues are labeled "unowned". For information about how to set up ownership, see Tracking issues by owner.
Fix and Citing Backlog
In the Report list, select Backlog. The Fix and Citing Backlog report shows two trends per day:
- the backlog of issues that are still in Analyze status that require developer attention to gate accordingly using the available Klocwork statuses. This trend is shown in blue. See Issue statuses.
- the backlog of issues that have been assigned to Fix status but have yet to be fixed. This trend is shown in red.
If you choose to see this report over a number of builds, then the backlog trends are shown from the day of the first build date to the day of the last build. Selecting the "last <n> builds" shows the date of each build up until the current date.
This graph displays by default on the Project Summary page.
The table below the chart shows the Analyze and Fix backlog by owner.
The issues shown on this graph are in any state but Fixed and Not in Scope. See Issue states.
Top Issues
From the Report list, select Top Issues:
The Top Issues pie graph shows you how detected issues are distributed in the latest build by issue name. The default number of segments is 10. The number of segments is limited only by the number of issue types (codes such as ABR or NPE) that have been detected. However, large numbers may make the chart less readable.
Clicking on a pie segment displays the issue list for the selected type of issue. You can also click a hyperlink in the legend to access a list of issues for the selected issue type. The hyperlinks list issues by issue code. For example, clicking FMM.MUST displays the issue list for the FMM.MUST (freeing mismatched memory) issues for the current build.
This graph displays by default on the Project Summary page.
Trending
In the Report list, select Trending and then Component, Category, Severity, State, Status, or Owner.
Trending (Issue Count) reports provide a high-level view of code issues over several builds. You can adjust this setting to target one or more specific builds. See About Builds/Dates.
Trending provides an overall view of product quality and fix rates that allows you to gauge the effectiveness of your organization’s strategy or policies (for example, staff training).
Use Klocwork Review scope settings to determine how many issues are contained in specific components, their severity, issue categories, owners, and whether they have been cited or not.
The legend in the chart reflects the selected summary option (for example, by Category) and provides the ability to drill down to show more details about the summary option. For example, if you have summarized by category, the highest category level displays in the legend.
When you drill down for more information, breadcrumbs display above the chart, enabling you to easily return to the previous view. You can continue drilling down through the data by clicking a link in the legend. Your final ’drill-down stop’ is a list of issues, scoped to your ’drill-down’ selections. Alternatively, you can click the browse issues link (below the report title) to access the issue list directly.
Issue Status
In the Report list, select Issue Status and then Component or Owner (if available).
Issue Status (by Component or Owner) reports show the distribution of issues by their current status in the build you selected.
You can click the chart to drill down for more information. For example, if you summarized by component, issues detected in that component are indicated in the chart on the Y-axis. Drill down into the component to see detected issues for the children of the component.
"Breadcrumbs" across the top display your co-ordinates, allowing you to navigate back to a previous step.
You can also click the browse issues link to display the issue list for the currently displayed components or owners.
Project Configuration
In the Report list, select Project Configuration:
Project configuration reports contain information about the Klocwork project build under analysis, including build characteristics such as date and time of the selected build and Klocwork version used to perform the analysis.
Project characteristics such as the total source lines of code analyzed (which does not include system header files or blank lines and comment lines in source code), and total number of functions/methods.
Metrics
In the Report list, select Metrics and then Churn, Size or Complexity.
Metrics reports capture churn, size or complexity by build. If you select a time frame, the chart will capture all the builds in the selected time frame.
Metrics will also display as options any custom metrics your organization creates by editing the default metrics XML file. For more information about creating custom metrics for Klocwork Review, see Customizing metrics reports in Klocwork Review.
Available metrics are listed in the table below:
| Metric | Description |
| Churn | the number of added, deleted or changed entities of a particular type, as compared to the previous sequential build in Klocwork Review. Klocwork provides churn metrics for these entity types: file, class, class method, function, global variable, and global type. You can also view a report for all churn metrics. You can drill down by component to get more detailed information. Note: Global-type churn does not track changed types, only those added or deleted. |
| Size | Tallies the total lines of code for the project or selected component. You can click active areas of the chart to drill down by component. |
| Complexity | Displays the number of functions, or class-methods that exceed the cyclomatic complexity threshold that you enter. The default threshold is 20. Cyclomatic complexity is a measure of a module’s structural complexity. This report is listed by default on the Project Summary page. You can drill down through the components to get more information. See also Complexity Details. For more information about complexity trend reports, see System Complexity. |
| <your custom metrics> | Your organization can add new report types based on Klocwork metrics. For example, you can add a report for functions below a specified percentage of comments. For more information about available Klocwork metrics, see Supported Metrics. For information about adding these to your reports, see Customizing metrics reports in Klocwork Review. |
System Complexity
To access this report:
- In the Report list, select Metrics.
- In the of type list, select Complexity
- In Threshold, add enter a number. The default cyclomatic complexity is 20.
- In view as, select the report format. The default is stackbar.
This report provides trend information about the complexity trend of methods in your analyzed software system. This report displays by default on the Project Summary page.
Cyclomatic Complexity is a measure of a program’s structural complexity. Studies show a correlation between a program’s Cyclomatic Complexity and its maintainability and testability, implying that with files of higher complexity there is a higher probability of errors when fixing, enhancing, or refactoring source code. The complexity threshold values suggested by Klocwork are shown in the following table:
| Cyclomatic complexity | Risk evaluation |
| 1 - 10 | a simple program without much risk |
| 11 - 20 | more complex, moderate risk |
| 21 - 50 | complex, high risk program |
| Greater than 50 | untestable program (very high risk) |
Refer to http://www.sei.cmu.edu/ and search for Cyclomatic Complexity. For more detailed complexity information, see Complexity Details.
Cyclomatic complexity calculation
Cyclomatic complexity is calculated as follows:
Cyclomatic Complexity = ( 2 + ifs + loops +cases - return ) where:
- ifs is the number of IF operators in the function,
- loops is the number of loops in the function,
- cases is the number of switch branches in the function (without default), and
- return is the number of return operators in the function.
Here is the pseudo code of a simple program and the Cyclomatic Complexity metric for it.
Function
- While
- If
- Else
- Endif
- If
- Endwhile
End Function
Since there is one "if", one "loop" and one "return" operator, we can calculate the Cyclomatic Complexity metric as 2+1+1-1=3.
Category Details
Categories define how issues are grouped in a project. Use the Category Details report to see how detected issues are distributed across these categories for a specific build. The Table Rows field lets you define the number of problematic classes or files you want to see in the "Top <number you define> Files/Classes" table. The default for Table Rows is 10.
Organizations can set up customized categories in the Klocwork Management Console (KMC) to reflect their own processes. See Editing issue categories.
The Category Details report provides a Summary of the project including information such as the build date, number of files, size of the project, and error and warning distribution
For each category containing issues, you see:
- tables showing Error Distribution or Warning Distribution so that you can see how issues are distributed by category in the current project
- a table called Top <number-you-define> Files/Classes with the most issues (listed in descending order) for each category that contains detected issues. You define the number of files/classes you want to see in the Table Rows list
If your C/C++ project contains Unnecessary compile expansion errors, then the Category Details contains an unnecessary compile expansion subsection.
From Category Details you can:
- sort by column heading for each table.
- access the Issue list from the available links in the tables to display only the issues of interest.
Complexity Details
To access this report:
- In the Report list, select Complexity Details.
- In Threshold, enter a number. The default cyclomatic complexity is 20. For information about thresholds, see System Complexity.
- The default level is "System Model".
Tip: To view specific components or components by owner for this report, use the Klocwork Review scope settings.
Whereas the Complexity report (Metrics > Complexity) provides trend information, Complexity Details provides further information about the latest build such as the number of methods with complexity > (threshold) for each component.
This report contains active areas that you can drill down into for more information.
Information displayed depends on the component you select.
| If you select... | The report shows... |
| top-level component, folder, or package |
|
| file or class | a chart and a table, with the actual method complexities. The chart is limited to 30 bars. A link to the file/class source in the Source Cross-Reference module is provided. |
"Breadcrumbs" across the top display your co-ordinates, allowing you to navigate back to a previous step.
Build Summary
In the Report list, select Build Summary.
The Build Summary report shows detected issues (according to summary options you select) for a single project build.
When viewed as a stackbar, sidebar or table, you can group issues by two of the following summary options: Component, Category, Severity, State, Status and Owner. When viewed as a pie chart you can only select one option.
