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.
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.