Fix reek reported issues

This commit is contained in:
Markus Schirp 2013-04-21 02:48:58 +02:00
parent aca87664db
commit 8a7e95efa9
5 changed files with 24 additions and 11 deletions

View file

@ -1,3 +1,3 @@
---
threshold: 16
total_score: 610
total_score: 602

View file

@ -43,6 +43,7 @@ DataClump:
DuplicateMethodCall:
enabled: true
exclude:
- Mutant::Runner#initializ # Time.new
- Mutant::CLI::Classifier::Method#method
- Mutant::Killer#run_with_benchmark
- Mutant::Mutator::Node::FormalArguments19::DefaultMutations#dispatch
@ -66,8 +67,7 @@ FeatureEnvy:
- Mutant::Mutator::Node::FormalArguments19::DefaultMutations#dispatch
- Mutant::Mutator::Node::FormalArguments19::RequireDefaults#dispatch
- Mutant::Mutator::Node::PatternArguments#allow?
- Mutant::Reporter::CLI#report_killer
- Mutant::Reporter::CLI#start
- Mutant::Reporter::CLI#subject_results
IrresponsibleModule:
enabled: true
exclude:
@ -136,6 +136,8 @@ TooManyStatements:
- Mutant::Reporter::CLI#colorized_diff
- Mutant::Reporter::CLI#report_killer
- Mutant::Reporter::CLI#start
- Mutant::Reporter::CLI#config_results
- Mutant::Reporter::CLI#subject_results
- each
max_statements: 5
UncommunicativeMethodName:
@ -185,6 +187,7 @@ UnusedParameters:
UtilityFunction:
enabled: true
exclude:
- Mutant::CLI#reporter
- Mutant::Matcher::Namespace#emit_scope_matches
- Mutant::Mutation::Evil#success?
- Mutant::Mutation::Neutral#success?

View file

@ -103,12 +103,10 @@ module Mutant
# @api private
#
def config(config)
message = []
message << 'Mutant configuration:'
message << "Matcher: #{config.matcher.inspect }"
message << "Filter: #{config.filter.inspect }"
message << "Strategy: #{config.strategy.inspect}"
puts message.join("\n")
puts 'Mutant configuration:'
puts "Matcher: #{config.matcher.inspect }"
puts "Filter: #{config.filter.inspect }"
puts "Strategy: #{config.strategy.inspect}"
end
# Report configuration results
@ -173,6 +171,7 @@ module Mutant
# @api private
#
def char(char, color)
io = self.io
io.write(colorize(color, char))
io.flush
end

View file

@ -55,14 +55,24 @@ module Mutant
#
# @api private
#
def run
report(config)
def run_subjects
strategy = self.strategy
strategy.setup
@subjects = config.subjects.map do |subject|
Subject.run(self, subject)
end
strategy.teardown
end
# Run with strategy management
#
# @return [undefined]
#
# @api private
#
def run
report(config)
run_subjects
@end = Time.now
report(self)
end

View file

@ -68,6 +68,7 @@ module Mutant
# @api private
#
def run
subject = self.subject
report(subject)
@mutations = subject.map do |mutation|
Mutation.run(config, mutation)