vpereira/bugzilla

View on GitHub

Showing 17 of 23 total issues

Method prehook has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

      def prehook(*args)
        cmd, opts, *etc = args
        case cmd
        when :search
          # This parameter is Red Hat Extension
Severity: Minor
Found in lib/bugzilla/plugins/rhbugzilla.rb - About 6 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 posthook has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

      def posthook(*args)
        cmd, opts, *etc = args
        case cmd
        when :search
          if opts.include?('bugs')
Severity: Minor
Found in lib/bugzilla/plugins/rhbugzilla.rb - About 5 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 prehook has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def prehook(*args)
        cmd, opts, *etc = args
        case cmd
        when :search
          # This parameter is Red Hat Extension
Severity: Major
Found in lib/bugzilla/plugins/rhbugzilla.rb - About 4 hrs to fix

    Method get_bugs has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_bugs(bugs, fields = FIELDS_SUMMARY)
          params = {}
    
          params['ids'] = case bugs
                          when Array
    Severity: Minor
    Found in lib/bugzilla/bug.rb - About 2 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 _get has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def _get(cmd, ids, *_args)
          # This is still in experimental and apparently the behavior was changed since 4.2.
          # We don't keep the backward-compatibility and just require the proper version here.
          requires_version(cmd, 4.2)
    
    
    Severity: Minor
    Found in lib/bugzilla/product.rb - About 2 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 _create has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def _create(cmd, *args)
          raise ArgumentError, 'Invalid parameters' unless args[0].is_a?(Hash)
    
          required_fields = %i[product component summary version]
          defaulted_fields = %i[description op_sys platform priority severity]
    Severity: Minor
    Found in lib/bugzilla/bug.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 posthook has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def posthook(*args)
            cmd, opts, *etc = args
            case cmd
            when :search
              if opts.include?('bugs')
    Severity: Minor
    Found in lib/bugzilla/plugins/rhbugzilla.rb - About 1 hr to fix

      Method _get has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _get(cmd, _args)
            requires_version(cmd, 4.4)
      
            params = {}
            # TODO
      Severity: Minor
      Found in lib/bugzilla/classification.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 get_userinfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_userinfo(user)
            p = {}
            ids = []
            names = []
      
      
      Severity: Minor
      Found in lib/bugzilla/user.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 get_bugs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def get_bugs(bugs, fields = FIELDS_SUMMARY)
            params = {}
      
            params['ids'] = case bugs
                            when Array
      Severity: Minor
      Found in lib/bugzilla/bug.rb - About 1 hr to fix

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

            def call(cmd, params = {}, user = nil, password = nil)
              params = {} if params.nil?
              params['Bugzilla_login'] = user unless user.nil? || password.nil?
              params['Bugzilla_password'] = password unless user.nil? || password.nil?
              params['Bugzilla_token'] = @token unless @token.nil?
        Severity: Minor
        Found in lib/bugzilla/xmlrpc.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 get_comments has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_comments(bugs)
              params = {}
        
              # TODO
              # this construction should be refactored to a method
        Severity: Minor
        Found in lib/bugzilla/bug.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 session has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def session(user, password)
              key, fname = authentication_method
        
              # TODO
              # make those variables available
        Severity: Minor
        Found in lib/bugzilla/user.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 get_proxy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_proxy(info)
              uri = info[:Proxy] || ENV['http_proxy']
              proxy_uri = uri.nil? ? nil : URI.parse(uri)
              proxy_host = proxy_uri.nil? ? nil : proxy_uri.host
              proxy_port = proxy_uri.nil? ? nil : proxy_uri.port
        Severity: Minor
        Found in lib/bugzilla/utils.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 7 (exceeds 5 allowed). Consider refactoring.
        Open

              def run(hook, host, *args)
                @@plugins.each do |k|
                  i = k.new
                  next unless i.hostname == host || host.nil?
        
        
        Severity: Minor
        Found in lib/bugzilla/plugin.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 _fields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def _fields(cmd, *args)
              requires_version(cmd, 3.6)
              params = {}
              a = args[0]
              case a
        Severity: Minor
        Found in lib/bugzilla/bug.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 read_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def read_config(opts)
              fname = opts[:config].nil? ? @defaultyamlfile : opts[:config]
              begin
                # TODO: fix config file
                # Psych doesnt allow Symbol as class
        Severity: Minor
        Found in lib/bugzilla/utils.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