CodeIssue reduction function computes single telemetry stream representing the number of potential problems found by static code analyzer such as Checkstyle, FindBugs, or PMD.
Table 28.4.
| Parameter | Description | Default |
|---|---|---|
| filePattern | Ant-like file pattern specifying the files to be included in computation. | ** |
| tool | Specify that the telemetry should only count code issues found by the specified tool, such as PMD and FindBugs. Or you can use wildcard '*' to include all tools. | * |
| issueCategory | Specified that the telemetry should only count code issues of the specified category, such as 'style', 'complexity', 'correctness', 'performance', or 'unknown'. Or you can use wildcard '*' to include all categories. | * |
| treatmentOption | Specified that the telemetry should only count code issues with the specified treatment option, such as 'fail', 'monitor', 'toss', 'unknown'. Or you can you wildcard '*' to include all treatment options. | * |
Example 28.6. Code Issue
streams CodeIssue(filePattern, tool, category, treatment) = {
"Code Issues",
CodeIssue(filePattern, tool, category, treatment)
};
y-axis yAxis(label) = {label};
chart FindBugsCodeIssueChart(filePattern) = {
"FindBugs Code Issues",
(CodeIssue(filePattern, "FindBugs", "*", "fail"), yAxis("Code Issues")),
(CodeIssue(filePattern, "FindBugs", "*", "monitor"), yAxis("Code Issues"))
};
draw FindBugsCodeIssueChart("**");

This chart shows the number of code issues found by 'FindBugs' that fall into treatment option 'fail' and 'monitor' respectively.