backend/app/models/concerns/tokenizable.rb
Useless assignment to variable - payload
. Use _
or _payload
as a variable name to indicate that it won't be used. Open
Open
token, payload = user_encoder.call(
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end
Missing top-level module documentation comment. Open
Open
module Tokenizable
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end
Trailing whitespace detected. Open
Open
{
- Exclude checks
Trailing whitespace detected. Open
Open
'Content-Type' => 'application/json'
- Exclude checks
Final newline missing. Open
Open
end
- Exclude checks
Trailing whitespace detected. Open
Open
'Accept' => 'application/json',
- Exclude checks