ManageIQ/floe

View on GitHub

Showing 7 of 12 total issues

Method wait has a Cognitive Complexity of 29 (exceeds 11 allowed). Consider refactoring.
Open

      def wait(timeout: nil, events: %i[create update delete], &block)
        until_timestamp = Time.now.utc + timeout if timeout

        r, w = IO.pipe

Severity: Minor
Found in lib/floe/container_runner/docker.rb - About 3 hrs 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 has a Cognitive Complexity of 28 (exceeds 11 allowed). Consider refactoring.
Open

      def wait(workflows, timeout: nil, &block)
        workflows = [workflows] if workflows.kind_of?(self)

        run_until   = Time.now.utc + timeout if timeout.to_i > 0
        ready       = []
Severity: Minor
Found in lib/floe/workflow.rb - About 3 hrs 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 has a Cognitive Complexity of 21 (exceeds 11 allowed). Consider refactoring.
Open

      def wait(timeout: nil, events: %i[create update delete])
        retry_connection = true

        begin
          watcher = kubeclient.watch_pods(:namespace => namespace)
Severity: Minor
Found in lib/floe/container_runner/kubernetes.rb - About 1 hr 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 initialize has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring.
Open

      def initialize(options = {})
        require "active_support/core_ext/hash/keys"
        require "awesome_spawn"
        require "securerandom"
        require "base64"
Severity: Minor
Found in lib/floe/container_runner/kubernetes.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 global_docker_options has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring.
Open

      def global_docker_options
        options = []
        options << [:identity, @identity]                 if @identity
        options << [:"log-level", @log_level]             if @log_level
        options << :noout                                 if @noout
Severity: Minor
Found in lib/floe/container_runner/podman.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 initialize has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring.
Open

      def initialize(context = nil, input: nil, credentials: {}, logger: nil)
        context = JSON.parse(context) if context.kind_of?(String)
        input   = JSON.parse(input || "{}")

        @context = context || {}
Severity: Minor
Found in lib/floe/workflow/context.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 run has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring.
Open

    def run(args = ARGV)
      workflows_inputs, opts = parse_options!(args)

      credentials = create_credentials(opts)

Severity: Minor
Found in lib/floe/cli.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