Sha256: 68606f0e7a540f90422b5853cacf6d24a9926f0db1c1d22f18582b0b4183b18d
Contents?: true
Size: 1005 Bytes
Versions: 3
Compression:
Stored size: 1005 Bytes
Contents
require "rubycritic/analysers/adapters/reek" require "rubycritic/core/smell" module Rubycritic module Analyser class ReekSmells def initialize(analysed_files) @analysed_files = analysed_files end def run @analysed_files.each do |analysed_file| add_smells_to(analysed_file) end end private def add_smells_to(analysed_file) Reek.new(analysed_file.path).smells.each do |smell| analysed_file.smells << create_smell(smell) end end def create_smell(smell) Smell.new( :locations => smell_locations(smell.source, smell.lines), :context => smell.context, :message => smell.message, :type => smell.subclass, :cost => 0 ) end def smell_locations(file_path, file_lines) file_lines.uniq.map do |file_line| Location.new(file_path, file_line) end.sort end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubycritic-1.0.2 | lib/rubycritic/analysers/smells/reek.rb |
rubycritic-1.0.1 | lib/rubycritic/analysers/smells/reek.rb |
rubycritic-1.0.0 | lib/rubycritic/analysers/smells/reek.rb |