ManageIQ/polisher

View on GitHub

Showing 37 of 37 total issues

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

      def initialize(args = {})
        @br        = args[:br] || false
        @name      = args[:name]
        @condition = args[:condition]
        @version   = args[:version]
Severity: Minor
Found in lib/polisher/rpm/requirement.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 build_srpm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def build_srpm
        require 'awesome_spawn'

        require_cmd! pkg_cmd
        in_repo do
Severity: Minor
Found in lib/polisher/git/pkg/builder.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 check_missing has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def check_missing
  missing_deps.each { |name, deps|
    latest   = latest_alt(name)
    print "#{name}(#{latest}) #{deps.collect { |dep| dep.requirement.to_s }}: ".blue.bold

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

    def distgit_state(args = {})
      check_dep = args.key?(:check)

      begin
        distgit.clone
Severity: Minor
Found in lib/polisher/gem/state.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 require_dep! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def require_dep!(dep, obj=nil)
      require dep
    rescue LoadError => e
      m  = e.backtrace[obj.nil? ? 3 : 4].split.last
      ms = obj.nil? ? m : "#{obj.class} #{m}"
Severity: Minor
Found in lib/polisher/util/conf_helpers.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 set_targets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def set_targets(conf)
      targets = []
      require 'polisher/adaptors/version_checker'
      targets << :gem    if conf[:check_gem]
      targets << :koji   if conf[:check_koji]
Severity: Minor
Found in lib/polisher/cli/targets.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 matches? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def matches?(dep)
        require 'gem2rpm'

        return self == dep      if dep.is_a?(self.class)
        raise ArgumentError unless dep.is_a?(::Gem::Dependency)
Severity: Minor
Found in lib/polisher/rpm/requirement/comparison.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 waiting has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def waiting(args={})
      waiting_msg(args[:msg]) if args.key?(:msg)
      color = args[:color] || :black

      @term_waiting = false
Severity: Minor
Found in lib/polisher/cli/status.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 configure_targets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def configure_targets(conf)
      if conf[:check_koji]
        require 'polisher/targets/koji'
        Polisher::Koji.koji_url conf[:check_koji]   if conf[:check_koji].is_a?(String)
        Polisher::Koji.koji_tags conf[:koji_tags]   if conf[:koji_tags]
Severity: Minor
Found in lib/polisher/cli/targets.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 dependency_tree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def dependency_tree(args = {}, &bl)
      local_args        = Hash[args]
      recursive         = local_args[:recursive]
      retrieve_dev_deps = local_args[:dev_deps]
      matching          = local_args[:matching]
Severity: Minor
Found in lib/polisher/gem/dependencies.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 known_versions_for has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def self.known_versions_for(name, &bl)
      versions = {}
      versions_for(name) do |tgt, _name, target_versions|
        unless target_versions.include?(:unknown)
          bl.call tgt, name, versions unless bl.nil?
Severity: Minor
Found in lib/polisher/adaptors/version_checker.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

Avoid too many return statements within this method.
Open

      return :missing
Severity: Major
Found in lib/polisher/gem/state.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return :needs_update
    Severity: Major
    Found in lib/polisher/gem/state.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return :available if args[:check].match?(name, version)
      Severity: Major
      Found in lib/polisher/gem/state.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return :needs_build  if state == :available
        Severity: Major
        Found in lib/polisher/gem/state.rb - About 30 mins to fix

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

          def lookup(args={})
            return unless fail_message args[:component],
                                       args[:header]  ||
                                       args[:library] ||
                                       args[:executable]
          Severity: Minor
          Found in lib/polisher/cli/bin/binary_gem_resolver.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 koji_state has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def koji_state(args = {})
                check_dep = args.key?(:check)
          
                return :missing   if koji_tags.empty?
                return :available unless check_dep
          Severity: Minor
          Found in lib/polisher/gem/state.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