Showing 7 of 7 total issues
Assignment Branch Condition size for format is too high. [27.29/20] Open
def format
if alias_config && entry[:end]
{ notes: entry[:note],
hours: hours_for_time,
project_id: project_id.to_i,
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Useless assignment to variable - hours
. Open
hours = (rounded / 60)
- 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
Useless assignment to variable - code
. Open
code = match[1]
- 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
Use ==
if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition. Open
if match = HARVESTABLE_REGEX.match(entry[:note])
- Read upRead up
- Exclude checks
This cop checks for assignments in the conditions of if/while/until.
Example:
# bad
if some_var = true
do_something
end
Example:
# good
if some_var == true
do_something
end
TODO found Open
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
- Exclude checks
FIXME found Open
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
- Exclude checks
HACK found Open
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
- Exclude checks