Sha256: 9cf93359c97bf8aeb9d4dbe7f000cd864508d3c1ba9179d37c600131869cb477

Contents?: true

Size: 545 Bytes

Versions: 102

Compression:

Stored size: 545 Bytes

Contents

module CC
  module Analyzer
    class EngineOutputOverrider
      def initialize(config = {})
        @config = config
      end

      def apply(output)
        if output.issue?
          override_severity(output.as_issue.as_json)
        else
          output
        end
      end

      private

      attr_reader :config

      def override_severity(issue)
        issue.merge(override("severity"))
      end

      def override(name)
        config.
          fetch("issue_override", {}).
          slice(name)
      end
    end
  end
end

Version data entries

102 entries across 102 versions & 2 rubygems

Version Path
codeclimate-0.85.27 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-0.85.26 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-0.85.25 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-0.85.24 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.54 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.53 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.52 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.51 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.50 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.49 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.48 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.47 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.46 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.45 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.44 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.43 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.42 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.41 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.40 lib/cc/analyzer/engine_output_overrider.rb
codeclimate-fede-0.85.39 lib/cc/analyzer/engine_output_overrider.rb