28.5. CodeIssue

28.5.1. Description

CodeIssue reduction function computes single telemetry stream representing the number of potential problems found by static code analyzer such as Checkstyle, FindBugs, or PMD.

28.5.2. Parameter

Table 28.4. 

ParameterDescriptionDefault
filePatternAnt-like file pattern specifying the files to be included in computation.**
toolSpecify 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.*
issueCategorySpecified 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.*
treatmentOptionSpecified 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.*

28.5.3. Example

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.