/** * @fileoverview CheckStyle XML reporter * @author Ian Christian Myers */ "use strict"; const xmlEscape = require("../util/xml-escape"); //------------------------------------------------------------------------------ // Helper Functions //------------------------------------------------------------------------------ /** * Returns the severity of warning or error * @param {Object} message message object to examine * @returns {string} severity level * @private */ function getMessageType(message) { if (message.fatal || message.severity === 2) { return "error"; } else { return "warning"; } } //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ module.exports = function(results) { let output = ""; output += ""; output += ""; results.forEach(function(result) { const messages = result.messages; output += ``; messages.forEach(function(message) { output += [ `` ].join(" "); }); output += ""; }); output += ""; return output; };