Class: CC::Analyzer::IssueCategoryValidation

Inherits:
Validation
  • Object
show all
Defined in:
lib/cc/analyzer/issue_category_validation.rb

Constant Summary collapse

CATEGORIES =
[
  "Bug Risk".freeze,
  "Clarity".freeze,
  "Compatibility".freeze,
  "Complexity".freeze,
  "Duplication".freeze,
  "Performance".freeze,
  "Security".freeze,
  "Style".freeze,
].freeze

Instance Method Summary collapse

Methods inherited from Validation

#initialize

Constructor Details

This class inherits a constructor from CC::Analyzer::Validation

Instance Method Details

#messageObject



19
20
21
# File 'lib/cc/analyzer/issue_category_validation.rb', line 19

def message
  "Category must be at least one of #{CATEGORIES.join(", ")}"
end

#valid?Boolean



15
16
17
# File 'lib/cc/analyzer/issue_category_validation.rb', line 15

def valid?
  object["categories"].present? && no_invalid_categories?
end