RubyCritic
module RubyCritic
class AnalysedModule
def cost
smells.map(&:cost).inject(0.0, :+) +
(complexity / COMPLEXITY_FACTOR)
end
end
end
Slide 105
Slide 105 text
RubyCritic
module RubyCritic
class AnalysedModule
def cost
smells.map(&:cost).inject(0.0, :+) + # From Reek
(complexity / COMPLEXITY_FACTOR)
end
end
end
Slide 106
Slide 106 text
RubyCritic
module RubyCritic
class AnalysedModule
def cost
smells.map(&:cost).inject(0.0, :+) + # From Reek
(complexity / COMPLEXITY_FACTOR) # From Flog
end
end
end
Slide 107
Slide 107 text
Skunk
module RubyCritic
class AnalysedModule
def stink_score
return cost if perfect_coverage?
cost * (PERFECT_COVERAGE - coverage.to_i)
end
end
end
Slide 108
Slide 108 text
Skunk
module RubyCritic
class AnalysedModule
def stink_score
return cost if perfect_coverage?
cost * (PERFECT_COVERAGE - coverage.to_i)
# Penalty Factor = 100% - 20% => 80
end
end
end
Slide 109
Slide 109 text
Skunk Warning
> skunk-v0.3.1
Slide 110
Slide 110 text
Skunk Warning
> skunk-v0.3.1
> COVERAGE=TRUE rake test