engineyard/engineyard

View on GitHub

Showing 24 of 28 total issues

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

    def servers
      if options[:environment] == '' && options[:account] == ''
        repo.fail_on_no_remotes!
      end

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

    def console
      app_env = fetch_app_environment(options[:app], options[:environment], options[:account])
      instances = filter_servers(app_env.environment, options, default: {app_master: true})
      user = app_env.environment.username
      cmd = "cd /data/#{app_env.app.name}/current && bundle exec rails console"
Severity: Minor
Found in lib/engineyard/cli.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 banner has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def self.banner(task, task_help = false, subcommand = false)
        subcommand_banner = to_s.split(/::/).map{|s| s.downcase}[2..-1]
        subcommand_banner = if subcommand_banner.size > 0
                              subcommand_banner.join(' ')
                            else
Severity: Minor
Found in lib/engineyard/thor.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 with_reauthentication has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def with_reauthentication
        begin
          yield
        rescue EY::CloudClient::InvalidCredentials
          if @specified || !@ui.interactive?
Severity: Minor
Found in lib/engineyard/cli/api.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