mod/recaptcha/set/all/recaptcha.rb
Freeze mutable objects assigned to constants. Open
Open
RECAPTCHA_ERROR_CODES = { # LOCALIZE
"missing-input-secret" => "secret parameter is missing",
"invalid-input-secret" => "secret parameter is invalid or malformed",
"missing-input-response" => "response parameter is missing",
"invalid-input-response" => "response parameter is invalid or malformed",
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze