class Reek::Report::XMLReport
Generates a list of smells in XML format
@public
Public Instance Methods
Source
# File lib/reek/report/xml_report.rb, line 16 def show document.write output: $stdout, indent: 2 $stdout.puts end
@public
Private Instance Methods
Source
# File lib/reek/report/xml_report.rb, line 29 def checkstyle REXML::Element.new('checkstyle').tap do |checkstyle| smells.group_by(&:source).each do |source, source_smells| checkstyle << file(source, source_smells) end end end
Source
# File lib/reek/report/xml_report.rb, line 23 def document REXML::Document.new.tap do |document| document << REXML::XMLDecl.new << checkstyle end end
Source
# File lib/reek/report/xml_report.rb, line 51 def error(smell, line) REXML::Element.new('error').tap do |error| error.add_attributes 'column' => 0, 'line' => line, 'message' => smell.message, 'severity' => 'warning', 'source' => smell.smell_type end end
@quality :reek:UtilityFunction
Source
# File lib/reek/report/xml_report.rb, line 39 def file(name, smells) REXML::Element.new('file').tap do |file| file.add_attribute 'name', File.realpath(name) smells.each do |smell| smell.lines.each do |line| file << error(smell, line) end end end end
@quality :reek:FeatureEnvy @quality :reek:NestedIterators { max_allowed_nesting: 2 }