Skip to content

Instantly share code, notes, and snippets.

@paul-butcher
Last active December 7, 2018 13:12
Show Gist options
  • Select an option

  • Save paul-butcher/3e075c3e24e01679bb4e3a08145f6c17 to your computer and use it in GitHub Desktop.

Select an option

Save paul-butcher/3e075c3e24e01679bb4e3a08145f6c17 to your computer and use it in GitHub Desktop.
Radon Maintainability index Warnings plugin
myproj/myfile.py - B (14.83)
import hudson.plugins.warnings.parser.Warning
import hudson.plugins.analysis.util.model.Priority
String filename = matcher.group(1)
String line = 0
String type = 'maintainability'
category = "maintainability"
gradeMap = [B:'Medium', C:'Extremely Low']
String message = gradeMap.get(matcher.group(2))+ " maintainability: " + matcher.group(2) + " " + matcher.group(3)
priorityMap = [B:Priority.NORMAL, C:Priority.HIGH]
return new Warning(filename, Integer.parseInt(line), type, category, message, priorityMap.get(matcher.group(2)));
(.*) - (A|B|C) (.*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment