travis-ci/dpl

View on GitHub

Showing 22 of 42 total issues

Class GitPush has 41 methods (exceeds 20 allowed). Consider refactoring.
Open

    class GitPush < Provider
      register :git_push

      status :dev

Severity: Minor
Found in lib/dpl/providers/git_push.rb - About 5 hrs to fix

    Class Git has 34 methods (exceeds 20 allowed). Consider refactoring.
    Open

          class Git < Pages
            register :'pages:git'
    
            status :stable
    
    
    Severity: Minor
    Found in lib/dpl/providers/pages/git.rb - About 4 hrs to fix

      Class Cloudformation has 25 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class Cloudformation < Provider
            register :cloudformation
            status :stable
      
            full_name 'AWS CloudFormation'
      Severity: Minor
      Found in lib/dpl/providers/cloudformation.rb - About 2 hrs to fix

        File bintray.rb has 262 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'net/http'
        require 'uri'
        require 'find'
        
        module Dpl
        Severity: Minor
        Found in lib/dpl/providers/bintray.rb - About 2 hrs to fix

          Method walk has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

                  def walk(key, *nodes)
                    case key
                    when :program
                      nodes[0].map { |node| walk(*node) }.compact
                    when :module
          Severity: Minor
          Found in lib/dpl/support/gems.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 shell has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

                def shell(cmd, opts = {})
                  cmd = Cmd.new(nil, cmd, opts) if cmd.is_a?(String)
                  info cmd.msg if cmd.msg?
                  info cmd.echo if cmd.echo?
          
          
          Severity: Minor
          Found in lib/dpl/ctx/bash.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 walk has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def walk(key, *nodes)
                    case key
                    when :program
                      nodes[0].map { |node| walk(*node) }.compact
                    when :module
          Severity: Minor
          Found in lib/dpl/support/gems.rb - About 1 hr to fix

            Method run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def run
                  stages = stage.select { |stage| run_stage?(stage) }
                  stages.each { |stage| run_stage(stage) }
                  run_cmds
                rescue Error
            Severity: Minor
            Found in lib/dpl/provider.rb - About 55 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 lookup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                  def lookup(key)        
                    if vars? && !var?(key)
                      UNKNOWN % key
                    elsif mod = modifier(key)
                      key = key.to_s.sub("#{mod}d_", '')
            Severity: Minor
            Found in lib/dpl/helper/interpolate.rb - About 55 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 find has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def find(path, includes, excludes, uploads, params, download)
            Severity: Minor
            Found in lib/dpl/providers/bintray.rb - About 45 mins to fix

              Method check_deployment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                    def check_deployment(msgs)
                      sleep 5
                      events.each do |event|
                        msg = "#{event.event_date} [#{event.severity}] #{event.message}"
                        error "Deployment failed: #{msg}" if event.severity == 'ERROR'
              Severity: Minor
              Found in lib/dpl/providers/elasticbeanstalk.rb - About 45 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 deploy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def deploy
                      create_package unless package_exists?
                      create_version unless version_exists?
                      upload_files
                      sign_version if sign_version?
              Severity: Minor
              Found in lib/dpl/providers/bintray.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_change_set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      def create_change_set(type)
                        info :create_change_set
                        set = client.create_change_set(common_params.merge(change_set_params(type)))
                        wait_for(:change_set_create_complete, change_set_name: set.id) if wait? && !test?
                        info :done
              Severity: Minor
              Found in lib/dpl/providers/cloudformation.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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      def update
                        promote? ? promote : create_change_set(:update)
                      rescue Aws::CloudFormation::Errors::ValidationError => e
                        raise e unless e.message.start_with?('No updates are to be performed')
                        info :stack_up_to_date
              Severity: Minor
              Found in lib/dpl/providers/cloudformation.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 login_token has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      def login_token
                        return unless github?
                        info :login, user.login
                        error :insufficient_scopes unless sufficient_scopes?
                      rescue Octokit::Unauthorized => e
              Severity: Minor
              Found in lib/dpl/providers/git_push.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 memoize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def memoize(name)
                    ivar = :"@#{name.to_s.sub('?', '_predicate')}"
                    prepend Module.new {
                      define_method(name) do |*args|
                        raise ArgsError.new('cannot pass arguments to memoized method %p' % name) unless args.empty?
              Severity: Minor
              Found in lib/dpl/helper/memoize.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 config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                    def config(*paths)
                      if paths.any?
                        @config_files = paths
                      elsif config_files
                        paths = config_files.dup
              Severity: Minor
              Found in lib/dpl/helper/config_file.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 value_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def value_for(opt)
                    return if opt.type == :flag
                    return 1 if opt.type == :integer
                    return opt.enum.first if opt.enum?
                    str = opt.strs.detect { |str| str =~ /^--#{opt.name} (.*)$/ } && $1
              Severity: Minor
              Found in lib/dpl/provider/examples.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 deploy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      def deploy
                        info :deploy
              
                        api.request_page_build slug
              
              
              Severity: Minor
              Found in lib/dpl/providers/pages/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

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

                    def deploy
                      stack_exists? ? update : create
                      store_events if output_file?
                    rescue Aws::CloudFormation::Errors::InvalidAccessKeyId
                      error :invalid_creds
              Severity: Minor
              Found in lib/dpl/providers/cloudformation.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