Class: CC::Analyzer::IssueValidations::CategoryValidation

Inherits:
Validation
  • Object
show all
Defined in:
lib/cc/analyzer/issue_validations/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::IssueValidations::Validation

Instance Method Details

#messageObject



20
21
22
# File 'lib/cc/analyzer/issue_validations/category_validation.rb', line 20

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

#valid?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/cc/analyzer/issue_validations/category_validation.rb', line 16

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