Class: AnalDiffist::ReekProblem

Inherits:
Object
  • Object
show all
Defined in:
lib/analdiffist/reek_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(smell) ⇒ ReekProblem

Returns a new instance of ReekProblem.



26
27
28
# File 'lib/analdiffist/reek_parser.rb', line 26

def initialize smell
  @smell = smell
end

Instance Method Details

#contextObject



34
35
36
# File 'lib/analdiffist/reek_parser.rb', line 34

def context
  @smell.location["context"]
end

#description(mode = :added) ⇒ Object



46
47
48
# File 'lib/analdiffist/reek_parser.rb', line 46

def description(mode = :added)
  "Reek: #{type}"
end

#diff(other) ⇒ Object



38
39
40
# File 'lib/analdiffist/reek_parser.rb', line 38

def diff other
  self if other.nil?
end

#scoreObject



42
43
44
# File 'lib/analdiffist/reek_parser.rb', line 42

def score
  2
end

#typeObject



30
31
32
# File 'lib/analdiffist/reek_parser.rb', line 30

def type
  @smell.subclass.to_s || ''
end