Showing 65 of 65 total issues
Useless assignment to variable - cm
. Open
cm = channel_metrics(channel)
- 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 - interval
. Open
interval = ENV["METRICS_INTERVAL"].to_i
- 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 buffer_size = env["HTTP_X_FIREHOSE_BUFFER_SIZE"]
- 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
Unused method argument - error
. If it's necessary, use _
or _error
as an argument name to indicate that it won't be used. Open
def self.handle_parse_error(request, body, error)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
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 channel_names = msg[:multiplex_unsubscribe]
- 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
Unused method argument - event
. If it's necessary, use _
or _event
as an argument name to indicate that it won't be used. You can also write as open(*)
if you want the method to accept any arguments but don't care about them. Open
def open(event)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
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 interval = options[:interval]
- 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
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 realIp = env["HTTP_X_FORWARDED_FOR"]
- 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 - 'harden' this up with a GET request and throw a "Bad Request"
- Exclude checks
TODO found Open
# TODO - Figure if we need to have an if/else for Rails::Engine loading and Firehose::Assets::Sprockets.auto_detect
- Exclude checks
TODO found Open
# TODO I think this can be cleaned up so the top-level if/else can be ditched.
- Exclude checks
TODO found Open
# TODO: Instead of just raising an exception, it would probably be better
- Exclude checks
TODO found Open
# TODO -ARRRG!!!! We can't listen to deferrables here. Need to expose those
- Exclude checks
TODO found Open
# TODO - Replace the integration test clients with these guys. You'll want to refactor each
- Exclude checks
TODO found Open
# TODO - This won't even work. Dropping ws:// above until this is tested. This thing
- Exclude checks
TODO found Open
# TODO - Fix ws:// transport! See class WebSocket below to udnerstand
- Exclude checks
TODO found Open
# TODO - Spec this thing out. Unfortunately its not tested at all, mostly because the JSON client
- Exclude checks
TODO found Open
# TODO hi-redis isn't that awesome... we have to setup an errback per even for wrong
- Exclude checks
TODO found Open
# TODO: Make this FAR more robust. Ideally we'd whitelist the permitted
- Exclude checks
TODO found Open
# TODO: See if we can just set Thin to use Firehose.logger instead of
- Exclude checks