marekgalovic/ruby-remote-service

View on GitHub

Showing 3 of 3 total issues

OS Command Injection in Rake
Open

    rake (10.5.0)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2020-8130

Criticality: High

URL: https://github.com/advisories/GHSA-jppv-gw3r-w3q8

Solution: upgrade to >= 12.3.3

Method setup_signal_handlers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def setup_signal_handlers
      EXIT_SIGNALS.each do |sig|
        trap(sig) do
          @worker_pool.exit if service?
          @conn.exit if !service?
Severity: Minor
Found in lib/remote_service/queue.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Unused block argument - error. You can omit the argument if you don't care about it.
Open

        NATS.on_error do |error|

This cop checks for unused block arguments.

Example:

# bad

do_something do |used, unused|
  puts used
end

do_something do |bar|
  puts :foo
end

define_method(:foo) do |bar|
  puts :baz
end

Example:

#good

do_something do |used, _unused|
  puts used
end

do_something do
  puts :foo
end

define_method(:foo) do |_bar|
  puts :baz
end
Severity
Category
Status
Source
Language