The Groovy script works on the Matcher instance that is passed to the script in the variable matcher. The script must have a single return value of type edu.hm.hafner.analysis.Issue. Use the edu.hm.hafner.analysis.IssueBuilder instance that is passed to the script in the variable builder to create a new issue instance. Additional available variables:

fileName
the name of the parsed report file
lineNumber
the current line number
falsePositive
a predefined issue instance that marks the current match as false positive

Example

Here is an example that you can use as a starting point for your script. It composes a new warning using the matcher of the regular expression ^\s*(.*):(\d+):(.*):\s*(.*)$.


import edu.hm.hafner.analysis.Severity

builder.setFileName(matcher.group(1))
        .setLineStart(Integer.parseInt(matcher.group(2)))
        .setSeverity(Severity.WARNING_NORMAL)
        .setCategory(matcher.group(3))
        .setMessage(matcher.group(4))

return builder.build();