Created
March 20, 2017 17:01
-
-
Save cwjohnston/5c0396d66f9fa4810d49f900bdd591af to your computer and use it in GitHub Desktop.
Rubocop offenses summary for Sensu as of 0.29-pre
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 Lint/ShadowingOuterLocalVariable | |
49 Lint/UnusedBlockArgument | |
38 Style/ColonMethodCall | |
34 Style/Documentation | |
30 Style/AlignParameters | |
19 Style/IfUnlessModifier | |
18 Metrics/PerceivedComplexity | |
17 Style/GuardClause | |
16 Style/DotPosition | |
14 Style/PreferredHashMethods | |
11 Metrics/BlockLength | |
11 Style/WordArray | |
10 Style/EmptyLiteral | |
9 Style/EmptyCaseCondition | |
8 Style/CaseIndentation | |
8 Style/SpecialGlobalVars | |
7 Metrics/AbcSize | |
7 Performance/RedundantBlockCall | |
7 Style/NumericPredicate | |
6 Style/NumericLiterals | |
6 Style/SpaceAroundOperators | |
4 Lint/DeprecatedClassMethods | |
4 Lint/EndAlignment | |
4 Lint/UnusedMethodArgument | |
4 Performance/RedundantMerge | |
4 Style/AndOr | |
4 Style/BlockDelimiters | |
4 Style/IndentArray | |
4 Style/PercentLiteralDelimiters | |
4 Style/RedundantBegin | |
4 Style/RedundantSelf | |
4 Style/RescueModifier | |
4 Style/SymbolProc | |
3 Metrics/BlockNesting | |
3 Metrics/LineLength | |
2 Metrics/ClassLength | |
2 Style/DoubleNegation | |
2 Style/FormatString | |
2 Style/MultilineOperationIndentation | |
2 Style/MutableConstant | |
2 Style/Next | |
2 Style/SpaceAroundKeyword | |
2 Style/SpaceInsideBlockBraces | |
1 Lint/HandleExceptions | |
1 Lint/UselessAssignment | |
1 Security/MarshalLoad | |
1 Style/ExtraSpacing | |
1 Style/PerlBackrefs | |
1 Style/RedundantReturn | |
1 Style/RegexpLiteral | |
-- | |
478 Total |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Inspecting 66 files | |
..CCCWCWCWCWWCCCCCCCCCCCCWW.CWWCCCWWWCCWCWC.WCWCC.C.CWCWWCCCWWWWCC | |
Offenses: | |
sensu.gemspec:32:50: C: %w-literals should be delimited by ( and ). | |
s.files = Dir.glob("{exe,lib}/**/*") + %w[sensu.gemspec README.md CHANGELOG.md MIT-LICENSE.txt] | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
sensu.gemspec:33:34: C: Use // around regular expression. | |
s.executables = s.files.grep(%r{^exe/}) { |file| File.basename(file) } | |
^^^^^^^^^ | |
exe/sensu-api:3:8: C: Prefer $LOAD_PATH over $:. | |
unless $:.include?(File.dirname(__FILE__) + "/../lib/") | |
^^ | |
exe/sensu-api:4:3: C: Prefer $LOAD_PATH over $:. | |
$: << File.dirname(__FILE__) + "/../lib" | |
^^ | |
exe/sensu-client:3:8: C: Prefer $LOAD_PATH over $:. | |
unless $:.include?(File.dirname(__FILE__) + "/../lib/") | |
^^ | |
exe/sensu-client:4:3: C: Prefer $LOAD_PATH over $:. | |
$: << File.dirname(__FILE__) + "/../lib" | |
^^ | |
exe/sensu-install:6:3: C: Missing top-level class documentation comment. | |
class Install | |
^^^^^ | |
exe/sensu-install:26:121: C: Line is too long. [127/120] | |
opts.on("-P", "--plugins PLUGIN[,PLUGIN]", "PLUGIN or comma-delimited list of Sensu plugins to install") do |plugins| | |
^^^^^^^ | |
exe/sensu-install:32:121: C: Line is too long. [139/120] | |
opts.on("-E", "--extensions EXTENSION[,EXT]", "EXTENSION or comma-delimited list of Sensu extensions to install") do |extensions| | |
^^^^^^^^^^^^^^^^^^^ | |
exe/sensu-install:74:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless system(gem_command) | |
^^^^^^ | |
exe/sensu-install:86:19: W: Useless assignment to variable - gem_version. Use _ or _gem_version as a variable name to indicate that it won't be used. | |
gem_name, gem_version = raw_gem.split(":") | |
^^^^^^^^^^^ | |
exe/sensu-install:137:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if options[:clean] | |
^^ | |
exe/sensu-install:164:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if options[:clean] | |
^^ | |
exe/sensu-install:177:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless options[:extensions].empty? | |
^^^^^^ | |
exe/sensu-server:3:8: C: Prefer $LOAD_PATH over $:. | |
unless $:.include?(File.dirname(__FILE__) + "/../lib/") | |
^^ | |
exe/sensu-server:4:3: C: Prefer $LOAD_PATH over $:. | |
$: << File.dirname(__FILE__) + "/../lib" | |
^^ | |
lib/sensu/api/http_handler.rb:10:5: C: Missing top-level class documentation comment. | |
class HTTPHandler < EM::HttpServer::Server | |
^^^^^ | |
lib/sensu/api/http_handler.rb:67:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if @http_query_string | |
^^ | |
lib/sensu/api/http_handler.rb:93:7: C: Perceived complexity for read_data is too high. [11/7] | |
def read_data(rules={}) | |
^^^ | |
lib/sensu/api/http_handler.rb:94:9: C: Redundant begin block detected. | |
begin | |
^^^^^ | |
lib/sensu/api/http_handler.rb:98:38: C: Space between { and | missing. | |
(Array(rule[:type]).any? {|type| value.is_a?(type)} || | |
^^ | |
lib/sensu/api/http_handler.rb:98:63: C: Space missing inside }. | |
(Array(rule[:type]).any? {|type| value.is_a?(type)} || | |
^ | |
lib/sensu/api/http_handler.rb:100:32: C: Use (value =~ rule[:regex]).zero? instead of (value =~ rule[:regex]) == 0. | |
(rule[:regex] && (value =~ rule[:regex]) == 0) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/api/http_handler.rb:132:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if api[:cors].is_a?(Hash) | |
^^ | |
lib/sensu/api/http_handler.rb:191:7: C: Perceived complexity for authorized? is too high. [11/7] | |
def authorized? | |
^^^ | |
lib/sensu/api/http_handler.rb:217:7: C: Perceived complexity for connected? is too high. [8/7] | |
def connected? | |
^^^ | |
lib/sensu/api/http_handler.rb:308:22: C: Use Hash#key? instead of Hash#has_key?. | |
elsif ROUTES.has_key?(@http_request_method) | |
^^^^^^^^ | |
lib/sensu/api/http_handler.rb:309:59: W: Shadowing outer local variable - route. | |
route = ROUTES[@http_request_method].detect do |route| | |
^^^^^ | |
lib/sensu/api/http_handler.rb:355:9: C: Avoid using rescue in its modifier form. | |
error! rescue nil | |
^^^^^^^^^^^^^^^^^ | |
lib/sensu/api/process.rb:6:5: C: Missing top-level class documentation comment. | |
class Process | |
^^^^^ | |
lib/sensu/api/process.rb:16:15: C: Redundant self detected. | |
api = self.new(options) | |
^^^^^^^^^^^^^^^^^ | |
lib/sensu/api/process.rb:17:11: C: Do not use :: for method calls. | |
EM::run do | |
^^ | |
lib/sensu/api/process.rb:35:26: C: Do not use :: for method calls. | |
@http_server = EM::start_server(bind, port, HTTPHandler) do |handler| | |
^^ | |
lib/sensu/api/process.rb:58:11: C: Do not use :: for method calls. | |
EM::stop_server(@http_server) | |
^^ | |
lib/sensu/api/process.rb:69:15: C: Redundant self detected. | |
api = self.new(options) | |
^^^^^^^^^^^^^^^^^ | |
lib/sensu/api/routes/aggregates.rb:4:7: C: Missing top-level module documentation comment. | |
module Aggregates | |
^^^^^^ | |
lib/sensu/api/routes/aggregates.rb:23:9: C: Assignment Branch Condition size for get_aggregate is too high. [47/30] | |
def get_aggregate | |
^^^ | |
lib/sensu/api/routes/aggregates.rb:23:9: C: Perceived complexity for get_aggregate is too high. [9/7] | |
def get_aggregate | |
^^^ | |
lib/sensu/api/routes/aggregates.rb:147:9: C: Assignment Branch Condition size for get_aggregate_results_severity is too high. [49.36/30] | |
def get_aggregate_results_severity | |
^^^ | |
lib/sensu/api/routes/aggregates.rb:147:9: C: Perceived complexity for get_aggregate_results_severity is too high. [11/7] | |
def get_aggregate_results_severity | |
^^^ | |
lib/sensu/api/routes/aggregates.rb:153:29: C: Use hash literal {} instead of Hash.new. | |
summaries = Hash.new | |
^^^^^^^^ | |
lib/sensu/api/routes/aggregates.rb:162:23: C: Avoid more than 3 levels of block nesting. | |
if SEVERITIES[result[:status]] == severity && ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/api/routes/aggregates.rb:163:27: C: Align the operands of a condition in an if statement spanning multiple lines. | |
(max_age.nil? || result[:executed].nil? || result[:executed] >= (current_timestamp - max_age)) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/api/routes/aggregates.rb:171:42: W: Shadowing outer local variable - check_name. | |
summaries.each do |check_name, outputs| | |
^^^^^^^^^^ | |
lib/sensu/api/routes/checks.rb:4:7: C: Missing top-level module documentation comment. | |
module Checks | |
^^^^^^ | |
lib/sensu/api/routes/clients.rb:7:7: C: Missing top-level module documentation comment. | |
module Clients | |
^^^^^^ | |
lib/sensu/api/routes/clients.rb:49:19: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if index == clients.length - 1 | |
^^ | |
lib/sensu/api/routes/clients.rb:83:32: C: Pass &:to_i as an argument to map! instead of a block. | |
history.map! do |status| ... | |
^^^^^^^^^^^ | |
lib/sensu/api/routes/clients.rb:101:21: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if index == checks.length - 1 | |
^^ | |
lib/sensu/api/routes/clients.rb:119:33: W: Unused block argument - check_name. If it's necessary, use _ or _check_name as an argument name to indicate that it won't be used. | |
events.each do |check_name, event_json| | |
^^^^^^^^^^ | |
lib/sensu/api/routes/clients.rb:124:63: W: Shadowing outer local variable - events. | |
@redis.hgetall("events:#{client_name}") do |events| | |
^^^^^^ | |
lib/sensu/api/routes/events.rb:6:7: C: Missing top-level module documentation comment. | |
module Events | |
^^^^^^ | |
lib/sensu/api/routes/events.rb:20:35: W: Unused block argument - check_name. If it's necessary, use _ or _check_name as an argument name to indicate that it won't be used. | |
events.each do |check_name, event_json| | |
^^^^^^^^^^ | |
lib/sensu/api/routes/events.rb:23:19: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if index == clients.length - 1 | |
^^ | |
lib/sensu/api/routes/events.rb:39:29: W: Unused block argument - check_name. If it's necessary, use _ or _check_name as an argument name to indicate that it won't be used. | |
events.each do |check_name, event_json| | |
^^^^^^^^^^ | |
lib/sensu/api/routes/health.rb:6:7: C: Missing top-level module documentation comment. | |
module Health | |
^^^^^^ | |
lib/sensu/api/routes/info.rb:7:7: C: Missing top-level module documentation comment. | |
module Info | |
^^^^^^ | |
lib/sensu/api/routes/request.rb:6:7: C: Missing top-level module documentation comment. | |
module Request | |
^^^^^^ | |
lib/sensu/api/routes/request.rb:23:39: C: Use array literal [] instead of Array.new. | |
check[:subscribers] ||= Array.new | |
^^^^^^^^^ | |
lib/sensu/api/routes/resolve.rb:6:7: C: Missing top-level module documentation comment. | |
module Resolve | |
^^^^^^ | |
lib/sensu/api/routes/results.rb:6:7: C: Missing top-level module documentation comment. | |
module Results | |
^^^^^^ | |
lib/sensu/api/routes/results.rb:29:9: C: Perceived complexity for get_results is too high. [9/7] | |
def get_results | |
^^^ | |
lib/sensu/api/routes/results.rb:74:19: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if check_index == checks.length - 1 | |
^^ | |
lib/sensu/api/routes/silenced.rb:4:7: C: Missing top-level module documentation comment. | |
module Silenced | |
^^^^^^ | |
lib/sensu/api/routes/silenced.rb:27:21: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if silenced_index == silenced_keys.length - 1 | |
^^ | |
lib/sensu/api/routes/stashes.rb:4:7: C: Missing top-level module documentation comment. | |
module Stashes | |
^^^^^^ | |
lib/sensu/api/routes/stashes.rb:69:21: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if index == stashes.length - 1 | |
^^ | |
lib/sensu/api/routes.rb:15:5: C: Missing top-level module documentation comment. | |
module Routes | |
^^^^^^ | |
lib/sensu/api/routes.rb:34:20: C: Freeze mutable objects assigned to constants. | |
GET_ROUTES = [ ... | |
^ | |
lib/sensu/api/routes.rb:61:16: C: Freeze mutable objects assigned to constants. | |
ROUTES = { ... | |
^ | |
lib/sensu/api/utilities/publish_check_request.rb:4:7: C: Missing top-level module documentation comment. | |
module PublishCheckRequest | |
^^^^^^ | |
lib/sensu/api/utilities/publish_check_result.rb:4:7: C: Missing top-level module documentation comment. | |
module PublishCheckResult | |
^^^^^^ | |
lib/sensu/api/utilities/resolve_event.rb:6:7: C: Missing top-level module documentation comment. | |
module ResolveEvent | |
^^^^^^ | |
lib/sensu/api/utilities/servers_info.rb:4:7: C: Missing top-level module documentation comment. | |
module ServersInfo | |
^^^^^^ | |
lib/sensu/api/utilities/servers_info.rb:8:9: C: Perceived complexity for servers_info is too high. [8/7] | |
def servers_info | |
^^^ | |
lib/sensu/api/utilities/servers_info.rb:20:21: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if index == servers.length - 1 | |
^^ | |
lib/sensu/api/utilities/transport_info.rb:4:7: C: Missing top-level module documentation comment. | |
module TransportInfo | |
^^^^^^ | |
lib/sensu/api/utilities/transport_info.rb:27:49: W: Shadowing outer local variable - stats. | |
@transport.stats("results") do |stats| | |
^^^^^ | |
lib/sensu/api/validators/client.rb:8:7: C: Missing top-level class documentation comment. | |
class Client | |
^^^^^ | |
lib/sensu/api/validators/client.rb:29:22: W: Unused method argument - arguments. If it's necessary, use _ or _arguments as an argument name to indicate that it won't be used. You can also write as invalid(*) if you want the method to accept any arguments but don't care about them. | |
def invalid(*arguments) | |
^^^^^^^^^ | |
lib/sensu/cli.rb:5:3: C: Missing top-level class documentation comment. | |
class CLI | |
^^^^^ | |
lib/sensu/client/http_socket.rb:60:121: C: Line is too long. [130/120] | |
"help" => "Get redacted Sensu settings (requires basic auth). Use ?redacted=false if you want the setting unredacted." | |
^^^^^^^^^^ | |
lib/sensu/client/http_socket.rb:64:33: C: Avoid using {...} for multi-line blocks. | |
"GET" => Proc.new { |response| | |
^ | |
lib/sensu/client/http_socket.rb:64:36: W: Unused block argument - response. You can omit the argument if you don't care about it. | |
"GET" => Proc.new { |response| | |
^^^^^^^^ | |
lib/sensu/client/http_socket.rb:77:60: C: Use hash literal {} instead of Hash.new. | |
http_options = @settings[:client][:http_socket] || Hash.new | |
^^^^^^^^ | |
lib/sensu/client/http_socket.rb:78:32: C: Use && instead of and. | |
if http_options[:user] and http_options[:password] | |
^^^ | |
lib/sensu/client/http_socket.rb:98:40: C: Do not use :: for method calls. | |
@response.content = Sensu::JSON::dump(content) | |
^^ | |
lib/sensu/client/http_socket.rb:114:33: C: Use && instead of and. | |
if @http[:content_type] and @http[:content_type] == "application/json" and @http_content | |
^^^ | |
lib/sensu/client/http_socket.rb:114:80: C: Use && instead of and. | |
if @http[:content_type] and @http[:content_type] == "application/json" and @http_content | |
^^^ | |
lib/sensu/client/http_socket.rb:116:32: C: Do not use :: for method calls. | |
check = Sensu::JSON::load(@http_content) | |
^^ | |
lib/sensu/client/http_socket.rb:130:33: C: Use && instead of and. | |
if @http_query_string and @http_query_string.downcase.include?("redacted=false") | |
^^^ | |
lib/sensu/client/http_socket.rb:157:7: C: Assignment Branch Condition size for process_http_request is too high. [31.11/30] | |
def process_http_request | |
^^^ | |
lib/sensu/client/http_socket.rb:193:48: C: Use hash literal {} instead of Hash.new. | |
help_response[:endpoints][key] ||= Hash.new | |
^^^^^^^^ | |
lib/sensu/client/process.rb:7:5: C: Class has too many lines. [329/300] | |
class Process ... | |
^^^^^^^^^^^^^ | |
lib/sensu/client/process.rb:7:5: C: Missing top-level class documentation comment. | |
class Process | |
^^^^^ | |
lib/sensu/client/process.rb:18:18: C: Redundant self detected. | |
client = self.new(options) | |
^^^^^^^^^^^^^^^^^ | |
lib/sensu/client/process.rb:19:11: C: Do not use :: for method calls. | |
EM::run do | |
^^ | |
lib/sensu/client/process.rb:126:7: C: Assignment Branch Condition size for execute_check_command is too high. [30.94/30] | |
def execute_check_command(check) | |
^^^ | |
lib/sensu/client/process.rb:137:42: C: Favor format over String#%. | |
check[:duration] = ("%.3f" % (Time.now.to_f - started)).to_f | |
^ | |
lib/sensu/client/process.rb:178:40: C: Favor format over String#%. | |
check[:duration] = ("%.3f" % (Time.now.to_f - started)).to_f | |
^ | |
lib/sensu/client/process.rb:205:7: C: Perceived complexity for process_check_request is too high. [11/7] | |
def process_check_request(check) | |
^^^ | |
lib/sensu/client/process.rb:207:60: C: Use Hash#key? instead of Hash#has_key?. | |
if @settings.check_exists?(check[:name]) && !check.has_key?(:proxy_requests) | |
^^^^^^^^ | |
lib/sensu/client/process.rb:210:18: C: Use Hash#key? instead of Hash#has_key?. | |
if check.has_key?(:command) | |
^^^^^^^^ | |
lib/sensu/client/process.rb:265:46: W: Unused block argument - message_info. If it's necessary, use _ or _message_info as an argument name to indicate that it won't be used. | |
@transport.subscribe(*options) do |message_info, message| | |
^^^^^^^^^^^^ | |
lib/sensu/client/process.rb:390:50: C: Use hash literal {} instead of Hash.new. | |
options = @settings[:client][:socket] || Hash.new | |
^^^^^^^^ | |
lib/sensu/client/process.rb:394:23: C: Do not use :: for method calls. | |
@sockets << EM::start_server(options[:bind], options[:port], Socket) do |socket| | |
^^ | |
lib/sensu/client/process.rb:399:23: C: Do not use :: for method calls. | |
@sockets << EM::open_datagram_socket(options[:bind], options[:port], Socket) do |socket| | |
^^ | |
lib/sensu/client/process.rb:418:55: C: Use hash literal {} instead of Hash.new. | |
options = @settings[:client][:http_socket] || Hash.new | |
^^^^^^^^ | |
lib/sensu/client/process.rb:421:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless options[:enabled] == false | |
^^^^^^ | |
lib/sensu/client/process.rb:423:25: C: Do not use :: for method calls. | |
@sockets << EM::start_server(options[:bind], options[:port], HTTPSocket) do |socket| | |
^^ | |
lib/sensu/client/process.rb:466:31: C: Use Hash#key? instead of Hash#has_key?. | |
if @settings[:client].has_key?(:deregistration) | |
^^^^^^^^ | |
lib/sensu/client/process.rb:524:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless @state == :pausing || @state == :paused | |
^^^^^^ | |
lib/sensu/client/process.rb:526:30: C: Pass &:cancel as an argument to each instead of a block. | |
@timers[:run].each do |timer| ... | |
^^^^^^^^^^ | |
lib/sensu/client/socket.rb:101:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if @watchdog | |
^^ | |
lib/sensu/client/socket.rb:101:9: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if @watchdog | |
^^ | |
lib/sensu/client/socket.rb:125:9: C: Redundant begin block detected. | |
begin | |
^^^^^ | |
lib/sensu/client/socket.rb:131:11: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if @protocol == :tcp | |
^^ | |
lib/sensu/client/socket.rb:176:9: C: Redundant return detected. | |
return data =~ utf8_string_pattern | |
^^^^^^ | |
lib/sensu/client/socket.rb:186:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless @mode == MODE_REJECT | |
^^^^^^ | |
lib/sensu/client/socket.rb:191:13: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if EM::reactor_running? | |
^^ | |
lib/sensu/client/socket.rb:191:18: C: Do not use :: for method calls. | |
if EM::reactor_running? | |
^^ | |
lib/sensu/client/utils.rb:5:5: C: Missing top-level module documentation comment. | |
module CheckUtils | |
^^^^^^ | |
lib/sensu/client/utils.rb:10:7: C: Perceived complexity for validate_check_result is too high. [10/7] | |
def validate_check_result(check) | |
^^^ | |
lib/sensu/client/utils.rb:26:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless check[:ttl].nil? || (check[:ttl].is_a?(Integer) && check[:ttl] > 0) | |
^^^^^^ | |
lib/sensu/constants.rb:1:1: C: Missing top-level module documentation comment. | |
module Sensu | |
^^^^^^ | |
lib/sensu/constants.rb:7:18: C: %w-literals should be delimited by ( and ). | |
SEVERITIES = %w[ok warning critical unknown].freeze | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/constants.rb:10:20: C: %w-literals should be delimited by ( and ). | |
STOP_SIGNALS = %w[INT TERM].freeze | |
^^^^^^^^^^^^ | |
lib/sensu/daemon.rb:17:1: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if RUBY_PLATFORM =~ /aix/ || RUBY_PLATFORM =~ /solaris/ | |
^^ | |
lib/sensu/daemon.rb:34:3: C: Missing top-level module documentation comment. | |
module Daemon | |
^^^^^^ | |
lib/sensu/daemon.rb:51:16: C: Do not use :: for method calls. | |
unless EM::reactor_running? | |
^^ | |
lib/sensu/daemon.rb:52:11: C: Do not use :: for method calls. | |
EM::epoll | |
^^ | |
lib/sensu/daemon.rb:53:11: C: Do not use :: for method calls. | |
EM::set_max_timers(200000) | |
^^ | |
lib/sensu/daemon.rb:53:28: C: Separate every 3 digits in the integer portion of a number with underscores(_). | |
EM::set_max_timers(200000) | |
^^^^^^ | |
lib/sensu/daemon.rb:141:7: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless @settings.errors.empty? | |
^^^^^^ | |
lib/sensu/daemon.rb:176:9: C: Do not use :: for method calls. | |
EM::threadpool_size = threadpool_size | |
^^ | |
lib/sensu/daemon.rb:215:9: C: Do not use :: for method calls. | |
EM::stop_event_loop | |
^^ | |
lib/sensu/daemon.rb:320:21: C: Prefer $PROGRAM_NAME over $0. | |
File.basename($0).split("-").last | |
^^ | |
lib/sensu/daemon.rb:329:7: C: Redundant begin block detected. | |
begin | |
^^^^^ | |
lib/sensu/daemon.rb:357:9: C: Use next to skip iteration. | |
unless [STDIN, STDOUT, STDERR].include?(io) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/daemon.rb:360:11: W: Do not suppress exceptions. | |
rescue; end | |
^^^^^^^ | |
lib/sensu/sandbox.rb:2:3: C: Missing top-level module documentation comment. | |
module Sandbox | |
^^^^^^ | |
lib/sensu/sandbox.rb:12:31: W: Unused method argument - value. If it's necessary, use _ or _value as an argument name to indicate that it won't be used. | |
def self.eval(expression, value=nil) | |
^^^^^ | |
lib/sensu/server/filter.rb:3:5: C: Missing top-level module documentation comment. | |
module Filter | |
^^^^^^ | |
lib/sensu/server/filter.rb:33:43: C: Avoid the use of double negation (!!). | |
(event[:action] == :flapping && !!handler[:handle_flapping]) | |
^ | |
lib/sensu/server/filter.rb:48:20: C: Use Hash#key? instead of Hash#has_key?. | |
if handler.has_key?(:severities) | |
^^^^^^^^ | |
lib/sensu/server/filter.rb:52:15: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if status.to_i == 0 | |
^^ | |
lib/sensu/server/filter.rb:52:18: C: Use status.to_i.zero? instead of status.to_i == 0. | |
if status.to_i == 0 | |
^^^^^^^^^^^^^^^^ | |
lib/sensu/server/filter.rb:112:41: W: Unused block argument - output. If it's necessary, use _ or _output as an argument name to indicate that it won't be used. | |
extension.safe_run(event) do |output, status| | |
^^^^^^ | |
lib/sensu/server/filter.rb:113:19: C: Use status.zero? instead of status == 0. | |
yield(status == 0, filter_name) | |
^^^^^^^^^^^ | |
lib/sensu/server/filter.rb:136:9: C: Do not use empty case condition, instead use an if expression. | |
case | |
^^^^ | |
lib/sensu/server/filter.rb:164:7: C: Perceived complexity for event_filtered? is too high. [8/7] | |
def event_filtered?(handler, event) | |
^^^ | |
lib/sensu/server/filter.rb:165:20: C: Use Hash#key? instead of Hash#has_key?. | |
if handler.has_key?(:filters) || handler.has_key?(:filter) | |
^^^^^^^^ | |
lib/sensu/server/filter.rb:165:50: C: Use Hash#key? instead of Hash#has_key?. | |
if handler.has_key?(:filters) || handler.has_key?(:filter) | |
^^^^^^^^ | |
lib/sensu/server/filter.rb:167:33: W: Shadowing outer local variable - filter_list. | |
filter = Proc.new do |filter_list| | |
^^^^^^^^^^^ | |
lib/sensu/server/filter.rb:194:7: C: Perceived complexity for filter_event is too high. [11/7] | |
def filter_event(handler, event) | |
^^^ | |
lib/sensu/server/filter.rb:196:26: C: Do not use empty case condition, instead use an if expression. | |
filter_message = case | |
^^^^ | |
lib/sensu/server/filter.rb:197:9: C: Indent when as deep as case. | |
when handling_disabled?(event) | |
^^^^ | |
lib/sensu/server/filter.rb:199:9: C: Indent when as deep as case. | |
when !handle_action?(handler, event) | |
^^^^ | |
lib/sensu/server/filter.rb:201:9: C: Indent when as deep as case. | |
when !handle_severity?(handler, event) | |
^^^^ | |
lib/sensu/server/filter.rb:203:9: C: Indent when as deep as case. | |
when handler_silenced?(handler, event) | |
^^^^ | |
lib/sensu/server/filter.rb:205:9: W: end at 205, 8 is not aligned with case at 196, 25. | |
end | |
^^^ | |
lib/sensu/server/handle.rb:5:5: C: Missing top-level module documentation comment. | |
module Handle | |
^^^^^^ | |
lib/sensu/server/handle.rb:40:23: C: Use status.zero? instead of status == 0. | |
log_level = status == 0 ? :info : :error | |
^^^^^^^^^^^ | |
lib/sensu/server/handle.rb:65:13: C: Do not use :: for method calls. | |
EM::connect(handler[:socket][:host], handler[:socket][:port], Socket) do |socket| | |
^^ | |
lib/sensu/server/handle.rb:87:9: C: Redundant begin block detected. | |
begin | |
^^^^^ | |
lib/sensu/server/handle.rb:88:13: C: Do not use :: for method calls. | |
EM::open_datagram_socket("0.0.0.0", 0, nil) do |socket| | |
^^ | |
lib/sensu/server/mutate.rb:3:5: C: Missing top-level module documentation comment. | |
module Mutate | |
^^^^^^ | |
lib/sensu/server/mutate.rb:18:14: C: Use status.zero? instead of status == 0. | |
if status == 0 | |
^^^^^^^^^^^ | |
lib/sensu/server/mutate.rb:19:13: C: Use yield instead of callback.call. | |
callback.call(output) | |
^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/server/mutate.rb:76:9: C: Do not use empty case condition, instead use an if expression. | |
case | |
^^^^ | |
lib/sensu/server/process.rb:8:5: C: Class has too many lines. [825/300] | |
class Process ... | |
^^^^^^^^^^^^^ | |
lib/sensu/server/process.rb:8:5: C: Missing top-level class documentation comment. | |
class Process | |
^^^^^ | |
lib/sensu/server/process.rb:30:18: C: Redundant self detected. | |
server = self.new(options) | |
^^^^^^^^^^^^^^^^^ | |
lib/sensu/server/process.rb:31:11: C: Do not use :: for method calls. | |
EM::run do | |
^^ | |
lib/sensu/server/process.rb:44:28: C: Use array literal [] instead of Array.new. | |
@timers[:leader] = Array.new | |
^^^^^^^^^ | |
lib/sensu/server/process.rb:79:19: C: Use Hash#key? instead of Hash#has_key?. | |
if client.has_key?(:registration) | |
^^^^^^^^ | |
lib/sensu/server/process.rb:115:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if @settings.handler_exists?("registration") || client[:registration] | |
^^ | |
lib/sensu/server/process.rb:142:7: C: Perceived complexity for update_client_registry is too high. [11/7] | |
def update_client_registry(client) | |
^^^ | |
lib/sensu/server/process.rb:230:34: C: Avoid using {...} for multi-line blocks. | |
handler_list.compact.map { |handler_name| | |
^ | |
lib/sensu/server/process.rb:231:11: C: Do not use empty case condition, instead use an if expression. | |
case | |
^^^^ | |
lib/sensu/server/process.rb:259:44: W: Shadowing outer local variable - event. | |
filter_event(handler, event) do |event| | |
^^^^^ | |
lib/sensu/server/process.rb:274:40: W: Unused block argument - name. If it's necessary, use _ or _name as an argument name to indicate that it won't be used. | |
@extensions[:bridges].each do |name, bridge| | |
^^^^ | |
lib/sensu/server/process.rb:275:46: W: Unused block argument - status. If it's necessary, use _ or _status as an argument name to indicate that it won't be used. | |
bridge.safe_run(event) do |output, status| | |
^^^^^^ | |
lib/sensu/server/process.rb:400:15: C: Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
unless status == previous_status | |
^^^^^^ | |
lib/sensu/server/process.rb:431:18: C: Use Hash#key? instead of Hash#has_key?. | |
if check.has_key?(:low_flap_threshold) && check.has_key?(:high_flap_threshold) | |
^^^^^^^^ | |
lib/sensu/server/process.rb:431:57: C: Use Hash#key? instead of Hash#has_key?. | |
if check.has_key?(:low_flap_threshold) && check.has_key?(:high_flap_threshold) | |
^^^^^^^^ | |
lib/sensu/server/process.rb:462:62: C: Avoid using {...} for multi-line blocks. | |
silenced_keys = event[:client][:subscriptions].map { |subscription| | |
^ | |
lib/sensu/server/process.rb:502:7: C: Perceived complexity for update_event_registry is too high. [8/7] | |
def update_event_registry(event) | |
^^^ | |
lib/sensu/server/process.rb:509:13: C: Align the operands of a condition in a elsif statement spanning multiple lines. | |
(event[:check][:auto_resolve] != false || event[:check][:force_resolve]) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/server/process.rb:531:7: C: Assignment Branch Condition size for create_event is too high. [38.54/30] | |
def create_event(client, check) | |
^^^ | |
lib/sensu/server/process.rb:531:7: C: Perceived complexity for create_event is too high. [14/7] | |
def create_event(client, check) | |
^^^ | |
lib/sensu/server/process.rb:570:13: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if check[:status] == 0 | |
^^ | |
lib/sensu/server/process.rb:570:16: C: Use (check[:status]).zero? instead of check[:status] == 0. | |
if check[:status] == 0 | |
^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/server/process.rb:573:40: W: Shadowing outer local variable - event. | |
event_silenced?(event) do |event| | |
^^^^^ | |
lib/sensu/server/process.rb:609:7: C: Perceived complexity for retrieve_client is too high. [9/7] | |
def retrieve_client(result) | |
^^^ | |
lib/sensu/server/process.rb:660:7: C: Assignment Branch Condition size for process_check_result is too high. [32.34/30] | |
def process_check_result(result) | |
^^^ | |
lib/sensu/server/process.rb:660:7: C: Perceived complexity for process_check_result is too high. [9/7] | |
def process_check_result(result) | |
^^^ | |
lib/sensu/server/process.rb:665:21: C: Do not use empty case condition, instead use an if expression. | |
check = case | |
^^^^ | |
lib/sensu/server/process.rb:666:13: C: Indent when as deep as case. | |
when @settings.check_exists?(result[:check][:name]) && !result[:check][:standalone] | |
^^^^ | |
lib/sensu/server/process.rb:670:13: W: end at 670, 12 is not aligned with case at 665, 20. | |
end | |
^^^ | |
lib/sensu/server/process.rb:711:13: C: Do not use :: for method calls. | |
EM::next_tick do | |
^^ | |
lib/sensu/server/process.rb:748:41: W: Unused block argument - value. If it's necessary, use _ or _value as an argument name to indicate that it won't be used. | |
payload = check.reject do |key, value| | |
^^^^^ | |
lib/sensu/server/process.rb:782:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless client_attributes.empty? | |
^^^^^^ | |
lib/sensu/server/process.rb:794:21: C: Avoid more than 3 levels of block nesting. | |
if unmatched_tokens.empty? ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/server/process.rb:956:9: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if @settings.handler_exists?(:keepalive) | |
^^ | |
lib/sensu/server/process.rb:959:19: C: Use Hash#key? instead of Hash#has_key?. | |
if client.has_key?(:keepalive) | |
^^^^^^^^ | |
lib/sensu/server/process.rb:981:7: C: Assignment Branch Condition size for create_client_keepalive_check_results is too high. [33.48/30] | |
def create_client_keepalive_check_results(clients) | |
^^^ | |
lib/sensu/server/process.rb:985:13: C: Use next to skip iteration. | |
unless client_json.nil? | |
^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/server/process.rb:992:15: C: Do not use empty case condition, instead use an if expression. | |
case | |
^^^^ | |
lib/sensu/server/process.rb:1052:7: C: Perceived complexity for determine_stale_check_results is too high. [9/7] | |
def determine_stale_check_results(interval = 30) | |
^^^ | |
lib/sensu/server/process.rb:1147:33: C: Pass &:cancel as an argument to each instead of a block. | |
@timers[:leader].each do |timer| ... | |
^^^^^^^^^^ | |
lib/sensu/server/process.rb:1198:70: C: Separate every 3 digits in the integer portion of a number with underscores(_). | |
if new_lock_timestamp - current_lock_timestamp.to_i >= 30000 | |
^^^^^ | |
lib/sensu/server/process.rb:1292:49: C: Use count.zero? instead of count == 0. | |
if @in_progress.values.all? { |count| count == 0 } | |
^^^^^^^^^^ | |
lib/sensu/server/process.rb:1329:9: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
unless @state == :pausing || @state == :paused | |
^^^^^^ | |
lib/sensu/server/process.rb:1331:30: C: Pass &:cancel as an argument to each instead of a block. | |
@timers[:run].each do |timer| ... | |
^^^^^^^^^^ | |
lib/sensu/server/process.rb:1355:17: C: Avoid more than 3 levels of block nesting. | |
if @transport.connected? ... | |
^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/server/socket.rb:3:5: C: Missing top-level class documentation comment. | |
class Socket < EM::Connection | |
^^^^^ | |
lib/sensu/utilities.rb:9:3: C: Missing top-level module documentation comment. | |
module Utilities | |
^^^^^^ | |
lib/sensu/utilities.rb:17:21: C: Prefer $PROGRAM_NAME over $0. | |
File.basename($0) == "rspec" | |
^^ | |
lib/sensu/utilities.rb:27:9: C: Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
unless block.call | |
^^^^^^ | |
lib/sensu/utilities.rb:27:16: C: Use yield instead of block.call. | |
unless block.call | |
^^^^^^^^^^ | |
lib/sensu/utilities.rb:42:23: C: Do not use empty case condition, instead use an if expression. | |
merged[key] = case | |
^^^^ | |
lib/sensu/utilities.rb:43:9: C: Indent when as deep as case. | |
when hash_one[key].is_a?(Hash) && value.is_a?(Hash) | |
^^^^ | |
lib/sensu/utilities.rb:45:9: C: Indent when as deep as case. | |
when hash_one[key].is_a?(Array) && value.is_a?(Array) | |
^^^^ | |
lib/sensu/utilities.rb:49:9: W: end at 49, 8 is not aligned with case at 42, 22. | |
end | |
^^^ | |
lib/sensu/utilities.rb:59:7: C: Avoid using rescue in its modifier form. | |
::Socket.gethostname rescue nil | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/utilities.rb:68:7: C: Avoid using rescue in its modifier form. | |
::Socket.ip_address_list.find { |address| ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/utilities.rb:68:37: C: Avoid using {...} for multi-line blocks. | |
::Socket.ip_address_list.find { |address| | |
^ | |
lib/sensu/utilities.rb:80:9: C: Avoid using rescue in its modifier form. | |
::Process.times.to_a rescue [nil, nil, nil, nil] | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
lib/sensu/utilities.rb:82:9: C: Do not use :: for method calls. | |
EM::defer(determine_cpu_times, callback) | |
^^ | |
lib/sensu/utilities.rb:101:16: C: %w-literals should be delimited by ( and ). | |
keys ||= %w[ ... | |
^^^ | |
lib/sensu/utilities.rb:154:26: C: Avoid the use of Perl-style backrefs. | |
token, default = $1.to_s.split("|", -1) | |
^^ | |
lib/sensu/utilities.rb:157:9: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if matched.nil? | |
^^ | |
lib/sensu/utilities.rb:238:27: C: Avoid using Marshal.load. | |
value = Marshal.load(Marshal.dump(raw_value)) | |
^^^^ | |
lib/sensu/utilities.rb:239:11: C: Avoid the use of double negation (!!). | |
!!Sandbox.eval(eval_string, value) | |
^ | |
lib/sensu/utilities.rb:268:9: C: Do not use empty case condition, instead use an if expression. | |
case | |
^^^^ | |
lib/sensu/utilities.rb:291:5: C: Perceived complexity for in_time_window? is too high. [8/7] | |
def in_time_window?(condition) | |
^^^ | |
lib/sensu/utilities.rb:292:20: C: Use Hash#key? instead of Hash#has_key?. | |
if condition.has_key?(:begin) && condition.has_key?(:end) | |
^^^^^^^^ | |
lib/sensu/utilities.rb:292:50: C: Use Hash#key? instead of Hash#has_key?. | |
if condition.has_key?(:begin) && condition.has_key?(:end) | |
^^^^^^^^ | |
lib/sensu.rb:1:1: C: Missing top-level module documentation comment. | |
module Sensu | |
^^^^^^ | |
spec/api/process_spec.rb:6:1: C: Block has too many lines. [1600/55] | |
describe "Sensu::API::Process" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/api/process_spec.rb:71:58: W: Shadowing outer local variable - http. | |
http_request(4567, "/health?consumers=1000") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:71:64: W: Shadowing outer local variable - body. | |
http_request(4567, "/health?consumers=1000") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:74:74: W: Shadowing outer local variable - http. | |
http_request(4567, "/health?consumers=1000&messages=1000") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:74:80: W: Shadowing outer local variable - body. | |
http_request(4567, "/health?consumers=1000&messages=1000") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:74:80: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/health?consumers=1000&messages=1000") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:142:64: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/clients", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:160:64: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/clients", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:177:64: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/clients", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:193:64: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/clients", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:247:37: C: Surrounding space missing for operator =>. | |
expect(body).to eq({:command=>"echo -n merger", :interval=>60, :subscribers=>["test"], :name=>"merger"}) | |
^^ | |
spec/api/process_spec.rb:247:66: C: Surrounding space missing for operator =>. | |
expect(body).to eq({:command=>"echo -n merger", :interval=>60, :subscribers=>["test"], :name=>"merger"}) | |
^^ | |
spec/api/process_spec.rb:247:84: C: Surrounding space missing for operator =>. | |
expect(body).to eq({:command=>"echo -n merger", :interval=>60, :subscribers=>["test"], :name=>"merger"}) | |
^^ | |
spec/api/process_spec.rb:247:101: C: Surrounding space missing for operator =>. | |
expect(body).to eq({:command=>"echo -n merger", :interval=>60, :subscribers=>["test"], :name=>"merger"}) | |
^^ | |
spec/api/process_spec.rb:255:58: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/checks/standalone") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:474:53: W: Shadowing outer local variable - http. | |
http_request(4567, "/clients/i-888888") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:474:59: W: Shadowing outer local variable - body. | |
http_request(4567, "/clients/i-888888") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:501:64: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/clients", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:503:53: W: Shadowing outer local variable - http. | |
http_request(4567, "/clients/i-888888") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:503:59: W: Shadowing outer local variable - body. | |
http_request(4567, "/clients/i-888888") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:520:48: C: Separate every 3 digits in the integer portion of a number with underscores(_). | |
expect(body[0][:last_execution]).to eq(1363224805) | |
^^^^^^^^^^ | |
spec/api/process_spec.rb:856:49: W: Unused block argument - http. If it's necessary, use _ or _http as an argument name to indicate that it won't be used. | |
http_request(4567, "/aggregates") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1115:47: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/events") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1226:36: W: Unused block argument - result. You can omit the argument if you don't care about it. | |
test_result = Proc.new do |result| | |
^^^^^^ | |
spec/api/process_spec.rb:1240:36: W: Unused block argument - result. You can omit the argument if you don't care about it. | |
test_result = Proc.new do |result| | |
^^^^^^ | |
spec/api/process_spec.rb:1288:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1312:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1341:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1377:67: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1379:57: W: Unused block argument - silenced_info_json. You can omit the argument if you don't care about it. | |
redis.get("silence:#{subscription}:test") do |silenced_info_json| | |
^^^^^^^^^^^^^^^^^^ | |
spec/api/process_spec.rb:1381:81: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/subscriptions/#{subscription}") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1381:87: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/subscriptions/#{subscription}") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1405:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1420:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1435:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1451:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1467:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1483:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1499:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1515:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1517:45: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1517:51: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1528:66: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/subscriptions/test") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1528:72: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/subscriptions/test") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1536:75: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/subscriptions/nonexistent") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1536:81: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/subscriptions/nonexistent") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1540:63: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/checks/test") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1540:69: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/checks/test") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1548:72: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/checks/nonexistent") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1548:78: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/checks/nonexistent") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1562:3: C: Block has too many lines. [61/55] | |
context "when retrieving a silenced registry entry by it's id" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/api/process_spec.rb:1566:61: W: Unused block argument - http. You can omit all the arguments if you don't care about them. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1566:67: W: Unused block argument - body. You can omit all the arguments if you don't care about them. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1567:58: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/ids/*:test") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1567:64: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/ids/*:test") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1580:61: W: Unused block argument - http. You can omit all the arguments if you don't care about them. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1580:67: W: Unused block argument - body. You can omit all the arguments if you don't care about them. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1581:58: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/ids/test:*") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1581:64: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/ids/test:*") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1594:67: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1616:60: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/ids/:invalid") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1616:66: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/ids/:invalid") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1619:64: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/ids/inv@(!alid") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1619:70: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/ids/inv@(!alid") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1638:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1640:45: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1640:51: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1648:69: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1648:75: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1648:75: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1650:71: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1650:77: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1650:77: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1652:51: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1652:57: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1672:65: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1674:45: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1674:51: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1688:69: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1688:75: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1688:75: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1690:71: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1690:77: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1690:77: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(4567, "/silenced/clear", :post, options) do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1692:51: W: Shadowing outer local variable - http. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/api/process_spec.rb:1692:57: W: Shadowing outer local variable - body. | |
http_request(4567, "/silenced") do |http, body| | |
^^^^ | |
spec/cli_spec.rb:9:35: C: Use hash literal {} instead of Hash.new. | |
expect(Sensu::CLI.read).to eq(Hash.new) | |
^^^^^^^^ | |
spec/cli_spec.rb:14:7: C: Use 2 spaces for indentation in an array, relative to the first position after the preceding left parenthesis. | |
"-c", "spec/config.json", | |
^^^^ | |
spec/cli_spec.rb:21:5: C: Indent the right bracket the same as the first position after the preceding left parenthesis. | |
]) | |
^ | |
spec/cli_spec.rb:36:7: C: Use 2 spaces for indentation in an array, relative to the first position after the preceding left parenthesis. | |
"-v", | |
^^^^ | |
spec/cli_spec.rb:38:5: C: Indent the right bracket the same as the first position after the preceding left parenthesis. | |
]) | |
^ | |
spec/client/http_socket_spec.rb:5:1: C: Block has too many lines. [74/55] | |
describe "Sensu::Client::HTTPSocket" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/http_socket_spec.rb:44:57: C: Space before keyword do is missing. | |
http_request(3031, "/results", :post, options)do |http, body| | |
^^ | |
spec/client/http_socket_spec.rb:60:33: C: Use %w or %W for an array of words. | |
:authorization => [ ... | |
^ | |
spec/client/http_socket_spec.rb:66:68: W: Unused block argument - body. If it's necessary, use _ or _body as an argument name to indicate that it won't be used. | |
http_request(3031, "/settings", :get, options) do |http, body| | |
^^^^ | |
spec/client/http_socket_spec.rb:68:55: W: Shadowing outer local variable - http. | |
http_request(3031, "/settings", :get) do |http, body| | |
^^^^ | |
spec/client/http_socket_spec.rb:68:61: W: Shadowing outer local variable - body. | |
http_request(3031, "/settings", :get) do |http, body| | |
^^^^ | |
spec/client/http_socket_spec.rb:72:72: W: Shadowing outer local variable - http. | |
http_request(3031, "/settings?redacted=false", :get) do |http, body| | |
^^^^ | |
spec/client/http_socket_spec.rb:72:78: W: Shadowing outer local variable - body. | |
http_request(3031, "/settings?redacted=false", :get) do |http, body| | |
^^^^ | |
spec/client/process_spec.rb:5:1: C: Block has too many lines. [396/55] | |
describe "Sensu::Client::Process" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/process_spec.rb:137:45: C: Use %w or %W for an array of words. | |
expect(unmatched_tokens).to match_array(["missing", "nonexistent"]) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/process_spec.rb:321:18: C: Use %w or %W for an array of words. | |
expected = ["standalone", "sensu_gc_metrics"] | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/process_spec.rb:329:9: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if expected.empty? | |
^^ | |
spec/client/process_spec.rb:396:20: C: Use %w or %W for an array of words. | |
expected = ["tcp", "udp", "http"] | |
^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/process_spec.rb:401:11: C: Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
if expected.empty? | |
^^ | |
spec/client/process_spec.rb:406:13: C: Do not use :: for method calls. | |
EM::connect("127.0.0.1", 3030, nil) do |socket| | |
^^ | |
spec/client/process_spec.rb:410:13: C: Do not use :: for method calls. | |
EM::open_datagram_socket("127.0.0.1", 0, nil) do |socket| | |
^^ | |
spec/client/process_spec.rb:416:57: C: Space before keyword do is missing. | |
http_request(3031, "/results", :post, options)do |http, body| | |
^^ | |
spec/client/socket_spec.rb:5:1: C: Block has too many lines. [265/55] | |
describe Sensu::Client::Socket do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:36:7: C: Align the parameters of a method call if they span more than one line. | |
"must contain a non-empty", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:37:7: C: Align the parameters of a method call if they span more than one line. | |
{:name => ""}, | |
^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:38:7: C: Align the parameters of a method call if they span more than one line. | |
"check name must be a string and cannot contain spaces or special characters" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:41:7: C: Align the parameters of a method call if they span more than one line. | |
"must contain an acceptable check name", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:42:7: C: Align the parameters of a method call if they span more than one line. | |
{:name => "check name"}, | |
^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:43:7: C: Align the parameters of a method call if they span more than one line. | |
"check name must be a string and cannot contain spaces or special characters" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:46:7: C: Align the parameters of a method call if they span more than one line. | |
"must contain a single-line check name", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:47:7: C: Align the parameters of a method call if they span more than one line. | |
{:name => "check\nname"}, | |
^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:48:7: C: Align the parameters of a method call if they span more than one line. | |
"check name must be a string and cannot contain spaces or special characters" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:51:7: C: Align the parameters of a method call if they span more than one line. | |
"must contain an acceptable check source", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:52:7: C: Align the parameters of a method call if they span more than one line. | |
{:source => "check source"}, | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:53:7: C: Align the parameters of a method call if they span more than one line. | |
"check source must be a string and cannot contain spaces or special characters" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:56:7: C: Align the parameters of a method call if they span more than one line. | |
"must contain a single-line check source", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:57:7: C: Align the parameters of a method call if they span more than one line. | |
{:source => "check\nsource"}, | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:58:7: C: Align the parameters of a method call if they span more than one line. | |
"check source must be a string and cannot contain spaces or special characters" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:61:7: C: Align the parameters of a method call if they span more than one line. | |
"must have check output that is a string", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:62:7: C: Align the parameters of a method call if they span more than one line. | |
{:output => 1234}, | |
^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:63:7: C: Align the parameters of a method call if they span more than one line. | |
"check output must be a string" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:66:7: C: Align the parameters of a method call if they span more than one line. | |
"must have an integer status", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:67:7: C: Align the parameters of a method call if they span more than one line. | |
{:status => "2"}, | |
^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:68:7: C: Align the parameters of a method call if they span more than one line. | |
"check status must be an integer" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:71:7: C: Align the parameters of a method call if they span more than one line. | |
"must have an integer executed timestamp", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:72:7: C: Align the parameters of a method call if they span more than one line. | |
{:executed => "1431361723"}, | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:73:7: C: Align the parameters of a method call if they span more than one line. | |
"check executed timestamp must be an integer" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:76:7: C: Align the parameters of a method call if they span more than one line. | |
"check ttl must be an integer if set", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:77:7: C: Align the parameters of a method call if they span more than one line. | |
{:ttl => "30"}, | |
^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:78:7: C: Align the parameters of a method call if they span more than one line. | |
"check ttl must be an integer greater than 0" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:81:7: C: Align the parameters of a method call if they span more than one line. | |
"check ttl must be an integer greater than 0 if set", | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:82:7: C: Align the parameters of a method call if they span more than one line. | |
{:ttl => -10}, | |
^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:83:7: C: Align the parameters of a method call if they span more than one line. | |
"check ttl must be an integer greater than 0" | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:89:39: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:info). | |
^ | |
spec/client/socket_spec.rb:91:45: C: Place the . on the next line, together with the method name. | |
expect(transport).to receive(:publish). | |
^ | |
spec/client/socket_spec.rb:102:39: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:info). | |
^ | |
spec/client/socket_spec.rb:104:45: C: Place the . on the next line, together with the method name. | |
expect(transport).to receive(:publish). | |
^ | |
spec/client/socket_spec.rb:169:40: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:debug). | |
^ | |
spec/client/socket_spec.rb:177:40: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:debug). | |
^ | |
spec/client/socket_spec.rb:186:40: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:debug). | |
^ | |
spec/client/socket_spec.rb:188:39: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:warn). | |
^ | |
spec/client/socket_spec.rb:195:3: C: Block has too many lines. [103/55] | |
describe "#receive_data" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/client/socket_spec.rb:200:45: C: Place the . on the next line, together with the method name. | |
expect(transport).to receive(:publish). | |
^ | |
spec/client/socket_spec.rb:226:42: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:debug). | |
^ | |
spec/client/socket_spec.rb:228:41: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:info). | |
^ | |
spec/client/socket_spec.rb:230:47: C: Place the . on the next line, together with the method name. | |
expect(transport).to receive(:publish). | |
^ | |
spec/client/socket_spec.rb:252:11: C: Do not use :: for method calls. | |
EM::start_server("127.0.0.1", 3030, described_class) do |socket| | |
^^ | |
spec/client/socket_spec.rb:261:41: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:warn). | |
^ | |
spec/client/socket_spec.rb:274:11: C: Do not use :: for method calls. | |
EM::open_datagram_socket("127.0.0.1", 3030, described_class) do |socket| | |
^^ | |
spec/client/socket_spec.rb:287:42: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:error). | |
^ | |
spec/client/socket_spec.rb:289:41: C: Place the . on the next line, together with the method name. | |
expect(logger).to receive(:info). | |
^ | |
spec/client/socket_spec.rb:291:47: C: Place the . on the next line, together with the method name. | |
expect(transport).to receive(:publish). | |
^ | |
spec/client/socket_spec.rb:296:13: C: Do not use :: for method calls. | |
EM::open_datagram_socket("0.0.0.0", 0, nil) do |socket| | |
^^ | |
spec/extensions/bridges/file.rb:20:11: C: Do not use :: for method calls. | |
EM::defer(update_file, block) | |
^^ | |
spec/extensions/checks/sensu_gc_metrics.rb:22:19: C: Use hash literal {} instead of Hash.new. | |
metrics = Hash.new | |
^^^^^^^^ | |
spec/extensions/checks/sensu_gc_metrics.rb:24:11: C: Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||. | |
unless GC::Profiler.enabled? | |
^^^^^^ | |
spec/extensions/checks/sensu_gc_metrics.rb:29:11: C: Use `metrics[:profiler] = { | |
:invocations => invocations, | |
:total_time => GC::Profiler.total_time | |
} instead of metrics.merge!( | |
:profiler => { | |
:invocations => invocations, | |
:total_time => GC::Profiler.total_time | |
} | |
)`. | |
metrics.merge!( ... | |
^^^^^^^^^^^^^^^ | |
spec/extensions/checks/sensu_gc_metrics.rb:36:11: C: Use metrics[:stat] = GC.stat instead of metrics.merge!(:stat => GC.stat). | |
metrics.merge!(:stat => GC.stat) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/extensions/checks/sensu_gc_metrics.rb:40:11: C: Use metrics[:count] = Hash[object_counts] instead of metrics.merge!(:count => Hash[object_counts]). | |
metrics.merge!(:count => Hash[object_counts]) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/extensions/mutators/fail.rb:12:15: W: 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 run(*) if you want the method to accept any arguments but don't care about them. | |
def run(event) | |
^^^^^ | |
spec/extensions/mutators/opentsdb.rb:13:19: C: Use array literal [] instead of Array.new. | |
metrics = Array.new | |
^^^^^^^^^ | |
spec/extensions/mutators/settings.rb:12:15: W: 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 run(*) if you want the method to accept any arguments but don't care about them. | |
def run(event) | |
^^^^^ | |
spec/extensions/mutators/settings.rb:13:24: C: Use Hash#key? instead of Hash#has_key?. | |
yield(settings.has_key?(:handlers).to_s, 0) | |
^^^^^^^^ | |
spec/helpers.rb:59:7: C: Use yield instead of callback.call. | |
callback.call | |
^^^^^^^^^^^^^ | |
spec/helpers.rb:65:7: C: Do not use :: for method calls. | |
EM::run do | |
^^ | |
spec/helpers.rb:69:7: C: Use yield instead of callback.call. | |
callback.call | |
^^^^^^^^^^^^^ | |
spec/helpers.rb:74:7: C: Do not use :: for method calls. | |
EM::stop_event_loop | |
^^ | |
spec/helpers.rb:80:9: C: Use yield instead of callback.call. | |
callback.call | |
^^^^^^^^^^^^^ | |
spec/helpers.rb:88:5: C: Use yield instead of callback.call. | |
callback.call | |
^^^^^^^^^^^^^ | |
spec/helpers.rb:120:20: C: Separate every 3 digits in the integer portion of a number with underscores(_). | |
:executed => 1363224805 | |
^^^^^^^^^^ | |
spec/helpers.rb:151:27: C: Use %w or %W for an array of words. | |
:authorization => [ ... | |
^ | |
spec/helpers.rb:163:14: C: Do not use empty case condition, instead use an if expression. | |
body = case | |
^^^^ | |
spec/helpers.rb:164:7: C: Indent when as deep as case. | |
when http.response.empty? | |
^^^^ | |
spec/helpers.rb:168:7: W: end at 168, 6 is not aligned with case at 163, 13. | |
end | |
^^^ | |
spec/helpers.rb:169:7: C: Use yield instead of callback.call. | |
callback.call(http, body) | |
^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/helpers.rb:179:7: C: Use a guard clause instead of wrapping the code inside a conditional expression. | |
if @expected | |
^^ | |
spec/helpers.rb:181:11: C: Do not use :: for method calls. | |
EM::stop_event_loop | |
^^ | |
spec/mutators/tag.rb:7:1: C: Use event[:mutated] = true instead of event.merge!(:mutated => true). | |
event.merge!(:mutated => true) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/profilers/gc_profiler.rb:27:13: C: Do not use :: for method calls. | |
EM::defer do | |
^^ | |
spec/profilers/ruby_profiler.rb:39:11: C: Do not use :: for method calls. | |
EM::defer(print, complete) | |
^^ | |
spec/server/filter_spec.rb:5:1: C: Block has too many lines. [169/55] | |
describe "Sensu::Server::Filter" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/server/filter_spec.rb:94:57: W: Shadowing outer local variable - filtered. | |
@server.event_filter("development", @event) do |filtered, filter_name| | |
^^^^^^^^ | |
spec/server/filter_spec.rb:94:67: W: Shadowing outer local variable - filter_name. | |
@server.event_filter("development", @event) do |filtered, filter_name| | |
^^^^^^^^^^^ | |
spec/server/filter_spec.rb:97:59: W: Shadowing outer local variable - filtered. | |
@server.event_filter("nonexistent", @event) do |filtered| | |
^^^^^^^^ | |
spec/server/filter_spec.rb:102:58: W: Shadowing outer local variable - filtered. | |
@server.event_filtered?(handler, @event) do |filtered, filter_name| | |
^^^^^^^^ | |
spec/server/filter_spec.rb:102:68: W: Shadowing outer local variable - filter_name. | |
@server.event_filtered?(handler, @event) do |filtered, filter_name| | |
^^^^^^^^^^^ | |
spec/server/filter_spec.rb:108:60: W: Shadowing outer local variable - filtered. | |
@server.event_filtered?(handler, @event) do |filtered| | |
^^^^^^^^ | |
spec/server/filter_spec.rb:110:37: C: Use %w or %W for an array of words. | |
handler[:filters] = ["production", "development"] | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/server/filter_spec.rb:111:62: W: Shadowing outer local variable - filtered. | |
@server.event_filtered?(handler, @event) do |filtered| | |
^^^^^^^^ | |
spec/server/filter_spec.rb:139:50: W: Shadowing outer local variable - filtered. | |
@server.event_filter("time", @event) do |filtered| | |
^^^^^^^^ | |
spec/server/handle_spec.rb:5:1: C: Block has too many lines. [70/55] | |
describe "Sensu::Server::Handle" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/server/handle_spec.rb:12:14: C: Unnecessary spacing detected. | |
@event_id = event_template[:id] | |
^ | |
spec/server/handle_spec.rb:12:16: C: Operator = should be surrounded by a single space. | |
@event_id = event_template[:id] | |
^ | |
spec/server/handle_spec.rb:29:17: W: File.exists? is deprecated in favor of File.exist?. | |
expect(File.exists?("/tmp/sensu_event")).to be(true) | |
^^^^^^^ | |
spec/server/handle_spec.rb:44:9: C: Do not use :: for method calls. | |
EM::start_server("127.0.0.1", 1234, Helpers::TestServer) do |server| | |
^^ | |
spec/server/handle_spec.rb:53:9: C: Do not use :: for method calls. | |
EM::open_datagram_socket("127.0.0.1", 1234, Helpers::TestServer) do |server| | |
^^ | |
spec/server/mutate_spec.rb:18:49: W: Unused block argument - event_data. You can omit the argument if you don't care about it. | |
@server.mutate_event(handler, @event) do |event_data| | |
^^^^^^^^^^ | |
spec/server/mutate_spec.rb:22:49: W: Unused block argument - event_data. You can omit the argument if you don't care about it. | |
@server.mutate_event(handler, @event) do |event_data| | |
^^^^^^^^^^ | |
spec/server/mutate_spec.rb:26:49: W: Unused block argument - event_data. You can omit the argument if you don't care about it. | |
@server.mutate_event(handler, @event) do |event_data| | |
^^^^^^^^^^ | |
spec/server/mutate_spec.rb:34:51: W: Shadowing outer local variable - event_data. | |
@server.mutate_event(handler, @event) do |event_data| | |
^^^^^^^^^^ | |
spec/server/mutate_spec.rb:37:53: W: Shadowing outer local variable - event_data. | |
@server.mutate_event(handler, @event) do |event_data| | |
^^^^^^^^^^ | |
spec/server/process_spec.rb:5:1: C: Block has too many lines. [879/55] | |
describe "Sensu::Server::Process" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/server/process_spec.rb:106:56: W: Shadowing outer local variable - client_json. | |
redis.get("client:i-424242") do |client_json| | |
^^^^^^^^^^^ | |
spec/server/process_spec.rb:109:68: W: Shadowing outer local variable - signature. | |
redis.get("client:i-424242:signature") do |signature| | |
^^^^^^^^^ | |
spec/server/process_spec.rb:141:19: C: Use %w or %W for an array of words. | |
clients = ["foo", "bar", "baz", "qux"] | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/server/process_spec.rb:156:59: W: Shadowing outer local variable - exists. | |
redis.sismember("aggregates", "foobar") do |exists| | |
^^^^^^ | |
spec/server/process_spec.rb:163:59: W: Shadowing outer local variable - aggregate_members. | |
redis.smembers("aggregates:foobar") do |aggregate_members| | |
^^^^^^^^^^^^^^^^^ | |
spec/server/process_spec.rb:178:20: C: Use %w or %W for an array of words. | |
aggregates = ["foo", "bar"] | |
^^^^^^^^^^^^^^ | |
spec/server/process_spec.rb:191:58: W: Shadowing outer local variable - exists. | |
redis.sismember("aggregates", "bar") do |exists| | |
^^^^^^ | |
spec/server/process_spec.rb:193:56: W: Shadowing outer local variable - aggregate_members. | |
redis.smembers("aggregates:bar") do |aggregate_members| | |
^^^^^^^^^^^^^^^^^ | |
spec/server/process_spec.rb:226:32: W: Unused block argument - index. You can omit the argument if you don't care about it. | |
26.times do |index| | |
^^^^^ | |
spec/server/process_spec.rb:283:21: W: File.exists? is deprecated in favor of File.exist?. | |
expect(File.exists?("/tmp/sensu_event")).to eq(false) | |
^^^^^^^ | |
spec/server/process_spec.rb:295:29: W: File.exists? is deprecated in favor of File.exist?. | |
expect(File.exists?("/tmp/sensu_event")).to eq(false) | |
^^^^^^^ | |
spec/server/process_spec.rb:299:31: W: File.exists? is deprecated in favor of File.exist?. | |
expect(File.exists?("/tmp/sensu_event")).to eq(true) | |
^^^^^^^ | |
spec/server/process_spec.rb:328:61: W: Shadowing outer local variable - event_json. | |
redis.hget("events:i-424242", "test") do |event_json| | |
^^^^^^^^^^ | |
spec/server/process_spec.rb:361:61: W: Shadowing outer local variable - event_json. | |
redis.hget("events:i-424242", "test") do |event_json| | |
^^^^^^^^^^ | |
spec/server/process_spec.rb:377:3: C: Block has too many lines. [56/55] | |
it "can consume results" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/server/process_spec.rb:454:70: W: Shadowing outer local variable - is_member. | |
redis.sismember("result:i-424242", "test") do |is_member| | |
^^^^^^^^^ | |
spec/server/process_spec.rb:680:18: C: Use %w or %W for an array of words. | |
expected = ["tokens", "merger", "source", "cron"] | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/server/process_spec.rb:752:67: W: Shadowing outer local variable - event_json. | |
redis.hget("events:bar", "keepalive") do |event_json| | |
^^^^^^^^^^ | |
spec/server/process_spec.rb:756:69: W: Shadowing outer local variable - event_json. | |
redis.hget("events:qux", "keepalive") do |event_json| | |
^^^^^^^^^^ | |
spec/server/process_spec.rb:883:60: C: Separate every 3 digits in the integer portion of a number with underscores(_). | |
lock_timestamp = (Time.now.to_f * 1000).to_i - 60000 | |
^^^^^ | |
spec/server/socket_spec.rb:14:9: C: Do not use :: for method calls. | |
EM::start_server("127.0.0.1", 1234, Helpers::TestServer) do |server| | |
^^ | |
spec/server/socket_spec.rb:17:9: C: Do not use :: for method calls. | |
EM::connect("127.0.0.1", 1234, Sensu::Server::Socket) do |socket| | |
^^ | |
spec/server/socket_spec.rb:28:9: C: Do not use :: for method calls. | |
EM::connect("127.0.0.1", 1234, Sensu::Server::Socket) do |socket| | |
^^ | |
spec/server/socket_spec.rb:42:9: C: Do not use :: for method calls. | |
EM::start_server("127.0.0.1", 1234, Helpers::TestServer) | |
^^ | |
spec/server/socket_spec.rb:43:9: C: Do not use :: for method calls. | |
EM::connect("127.0.0.1", 1234, Sensu::Server::Socket) do |socket| | |
^^ | |
spec/utilities_spec.rb:5:1: C: Block has too many lines. [168/55] | |
describe "Sensu::Utilities" do ... | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/utilities_spec.rb:17:15: C: Surrounding space missing for operator +=. | |
times +=1 | |
^^ | |
spec/utilities_spec.rb:48:15: C: Use %w or %W for an array of words. | |
:baz => ["one", "two", "three"], | |
^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/utilities_spec.rb:60:15: C: Use %w or %W for an array of words. | |
:baz => ["one", "two", "three"], | |
^^^^^^^^^^^^^^^^^^^^^^^ | |
spec/utilities_spec.rb:175:28: C: Separate every 3 digits in the integer portion of a number with underscores(_). | |
tomorrow = (Time.now + 86400).strftime("%A").downcase.to_sym | |
^^^^^ | |
66 files inspected, 478 offenses detected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment