-
Bug
-
Resolution: Fixed
-
Major
-
None
The CodeNarc support added in JENKINS-7169 doesn't handle violations generated by the AbcComplexity rules; these contain a <Message> tag instead of a <SourceLine> tag inside the <Violations> tag. The first attached patch fixes this.
With the first patch, the fact that the source and message fields of the Violation seem to be reversed becomes more obvious. Specifically, the source is set to the error-text of the codenarc violation and the message is set to the codenarc rule that failed; but since Violation.getSource() strips everything before last dot, and the AbcComplexity messages are of the form "
The ABC score for method [foobar] is [92.0]", the result of getSource() is a useless "0]". Hence this second patch which reverses the source and message fields, which I think is semantically more correct.