Showing 26 of 26 total issues

Method stream_sh has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def stream_sh(command, broadcastable = true)
      accumulated = ''
      # Redirects STDOUT and STDERR to STDOUT
      IO.popen("#{command} 2>&1", chdir: Peas.root) do |data|
        while (line = data.gets)
Severity: Minor
Found in lib/worker/model_worker.rb - About 35 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

Method close has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def close(type = :normal)
    unless @socket.closed?
      info "Closing connection (ID: #{@socket.object_id}) #{'(closed via client)' if type == :detected}"
    end
    @socket.close
Severity: Minor
Found in switchboard/server/lib/connection.rb - About 35 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

Method scale has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def scale(processes, deploy = false)
    # Destroy all existing containers
    peas.destroy_all
    # Respawn all needed containers
    processes.each do |process_type, quantity|
Severity: Minor
Found in api/models/app.rb - About 35 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

Method create_job has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def create_job(method, args)
        # UUID's are guaranteed to be practically unique, as in *extremely* unlikely to collide
        new_job_id = SecureRandom.uuid
        # @is_parent_caller differentiates the parent job as originally called (outside a worker process) and the parent
        # job as run by a worker process.
Severity: Minor
Found in lib/worker/model_proxy.rb - About 35 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

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

    def self.wait_for_connection
      Timeout.timeout(5) do
        loop do
          begin
            s = connection
Severity: Minor
Found in lib/switchboard.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

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

    def create_app_image
      # Stream the output of the the buildstep process
      build_error = false
      last_message = nil
      @container.tap(&:start).attach(stdin: File.open(@tmp_tar_path)) do |stream, chunk|
Severity: Minor
Found in lib/builder.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

Severity
Category
Status
Source
Language