/** * @fileoverview CheckStyle XML reporter * @author Ian Christian Myers */ "use strict"; //------------------------------------------------------------------------------ // Helper Functions //------------------------------------------------------------------------------ function getMessageType(message) { if (message.fatal || message.severity === 2) { return "error"; } else { return "warning"; } } function xmlEscape(s) { return ("" + s).replace(/[<>&"']/g, function(c) { switch (c) { case "<": return "<"; case ">": return ">"; case "&": return "&"; case "\"": return """; case "'": return "'"; // no default } }); } //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ module.exports = function(results) { var output = ""; output += ""; output += ""; results.forEach(function(result) { var messages = result.messages; output += ""; messages.forEach(function(message) { output += ""; }); output += ""; }); output += ""; return output; };