cloudfoundry/vmc

View on GitHub

Showing 89 of 93 total issues

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

    def display_user(u)
      if quiet?
        puts u.email
      else
        line "#{c(u.email, :name)}:"
Severity: Minor
Found in lib/vmc/cli/user/users.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_space has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def create_space
      # TODO: ask org instead
      return invoke :help,
        :command => "create-space" if input[:organization].nil?

Severity: Minor
Found in lib/vmc/cli/space/create.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 stream_start_log has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def stream_start_log(log)
      offset = 0

      while true
        begin
Severity: Minor
Found in lib/vmc/cli/app/start.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 health has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def health
      apps = input[:apps]
      fail "No applications given." if apps.empty?

      health =
Severity: Minor
Found in lib/vmc/cli/app/health.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 stream_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def stream_path(lines, instance, path)
      if verbose?
        lines << [instance, path, c("streaming...", :good) + "\n"]
      end

Severity: Minor
Found in lib/vmc/cli/app/files.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 save_token_if_it_changes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def save_token_if_it_changes
      return yield unless client && client.token

      before_token = client.token

Severity: Minor
Found in lib/vmc/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

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

    def display_instance(i)
      start_line "instance #{c("\##{i.id}", :instance)}: "
      puts "#{b(c(i.state.downcase, state_color(i.state)))}"

      indented do
Severity: Minor
Found in lib/vmc/cli/app/instances.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 stop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def stop
      apps = input[:all] ? client.apps : input[:apps]
      fail "No applications given." if apps.empty?

      apps.each do |app|
Severity: Minor
Found in lib/vmc/cli/app/stop.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 map_detectors! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def map_detectors!
      @framework_detectors = {}
      @detector_frameworks = {}

      Clouseau.detectors.each do |d|
Severity: Minor
Found in lib/vmc/detect.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