Sha256: 8f30b6913062e0ed6a24621a49e005a9dffb7a7015fca985f6fa2a7853631f08

Contents?: true

Size: 621 Bytes

Versions: 4

Compression:

Stored size: 621 Bytes

Contents

module Warder
  # responsible for run code duplication validation
  class CodeDuplicationRunner < Runner
    CLI_OPTION = 'd'
    CLI_FULL_OPTION = 'code-duplication'
    DESCRIPTION = 'Run code duplication validation'
    COMMAND_NAME = 'flay'
    FLAY_SCORE = SCORE / 2
    FAILURE_REGEXP = /code found in :\w+ \(mass(\*\d+)? = (?<issues>\d+)\)/

    private

    def command_with_options
      "#{COMMAND_NAME} -m #{flay_score} #{@options.files}"
    end

    def flay_score
      env_flay_score = ENV['FLAY_SCORE']
      return self.class::FLAY_SCORE unless env_flay_score
      env_flay_score.to_i
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
warder-0.3.4 lib/warder/code_duplication_runner.rb
warder-0.3.2 lib/warder/code_duplication_runner.rb
warder-0.3.1 lib/warder/code_duplication_runner.rb
warder-0.3.0 lib/warder/code_duplication_runner.rb