Sha256: 086c8c3b8887c8578933ee01bccaca1e43911e817cec4abd671155e2dc692dd3

Contents?: true

Size: 835 Bytes

Versions: 119

Compression:

Stored size: 835 Bytes

Contents

module CC
  module Analyzer
    module IssueValidations
      class SeverityValidation < Validation
        INFO = "info".freeze
        MINOR = "minor".freeze
        MAJOR = "major".freeze
        CRITICAL = "critical".freeze
        BLOCKER = "blocker".freeze

        DEPRECATED_SEVERITIES = [
          NORMAL = "normal".freeze,
        ].freeze

        VALID_SEVERITIES = ([
          INFO,
          MINOR,
          MAJOR,
          CRITICAL,
          BLOCKER,
        ] + DEPRECATED_SEVERITIES).freeze

        def valid?
          severity.nil? || VALID_SEVERITIES.include?(severity)
        end

        def message
          "Permitted severities include #{VALID_SEVERITIES.join(", ")}"
        end

        private

        def severity
          @severity ||= object["severity"]
        end
      end
    end
  end
end

Version data entries

119 entries across 119 versions & 2 rubygems

Version Path
codeclimate-fede-0.85.38 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.37 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.36 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.35 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.33 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.32 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.31 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.30 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.21 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.24 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-fede-0.85.23 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.23 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.22 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.21 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.19 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.18 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.17 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.15 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.14 lib/cc/analyzer/issue_validations/severity_validation.rb
codeclimate-0.85.13 lib/cc/analyzer/issue_validations/severity_validation.rb