yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

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

    def ShowErrorPopUp(heading, error_text, details)
      bugzilla_url = "http://bugzilla.suse.com/"
      bugzilla_url = "http://bugzilla.opensuse.org" if OSRelease.ReleaseName.include? "openSUSE"
      success = UI.OpenDialog(
        Opt(:decorated, :warncolor),
Severity: Minor
Found in library/control/src/modules/InstError.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 StoreWorkflowFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def StoreWorkflowFile(file_from, file_to)
      if file_from.nil? || file_from == "" || file_to.nil? || file_to == ""
        Builtins.y2error("Cannot copy '%1' to '%2'", file_from, file_to)
        return nil
      end
Severity: Minor
Found in library/control/src/modules/WorkflowManager.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 GetFileRealType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def GetFileRealType(target)
      info = Convert.to_map(SCR.Read(path(".target.lstat"), target))

      if Ops.get_boolean(info, "islink", false) == true
        "link"
Severity: Minor
Found in library/general/src/modules/FileUtils.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 MergeURLs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def MergeURLs(url_base, url_with_modifs)
      if url_base.nil? || url_with_modifs.nil?
        Builtins.y2error("Wrong URLs: %1 or %2", url_base, url_with_modifs)
        return nil
      end
Severity: Minor
Found in library/control/src/modules/InstExtensionImage.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 GetBooleanFeatureWithFallback has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def GetBooleanFeatureWithFallback(section, feature, fallback)
      value = GetFeature(section, feature)
      return fallback if value.nil?
      return value if Ops.is_boolean?(value)

Severity: Minor
Found in library/control/src/modules/ProductFeatures.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 Image has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def Image(icon_type, options)
      options = deep_copy(options)
      LazyInit()

      return Empty() if !@has_image_support
Severity: Minor
Found in library/general/src/modules/Icon.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 GetShowQuestionAgain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def GetShowQuestionAgain(params)
      params = deep_copy(params)
      LazyLoadCurrentConf()
      q_type = Ops.get(params, "q_type")

Severity: Minor
Found in library/general/src/modules/DontShowAgain.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
      func, param = Yast::WFM.Args
      log.info "Called #{self.class}.run with #{func} and params #{param}"

      case func
Severity: Minor
Found in library/general/src/lib/installation/auto_client.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 MergeURLsParams has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def MergeURLsParams(base_url, url_with_modifs)
      if base_url.nil? || url_with_modifs.nil?
        Builtins.y2error("Wrong params: %1 or %2", base_url, url_with_modifs)
        return nil
      end
Severity: Minor
Found in library/control/src/modules/InstExtensionImage.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 event_loop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def event_loop(content, focus, timeout, details, style)
        res = Yast::UI.OpenDialog(dialog_options(style), content)
        raise "Failed to open dialog, see logs." unless res

        begin
Severity: Minor
Found in library/general/src/lib/yast2/popup.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 GetFileType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def GetFileType(target)
      info = Convert.to_map(SCR.Read(path(".target.stat"), target))

      if Ops.get_boolean(info, "isdir", false) == true
        "directory"
Severity: Minor
Found in library/general/src/modules/FileUtils.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 AnyQuestionRichText has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def AnyQuestionRichText(headline, richtext, hdim, vdim, yes_button_message, no_button_message, focus)
      yes_button = PushButton(
        Id(:ok),
        if focus == :focus_yes
          Opt(:default, :key_F10, :okButton)
Severity: Minor
Found in library/general/src/modules/Popup.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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def Check(url)
      # We don't allow empty URLs
      return false if url.nil? || Ops.less_than(Builtins.size(url), 1)

      # We don't allow URLs with spaces
Severity: Minor
Found in library/types/src/modules/URL.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 DocodeDomainNames has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def DocodeDomainNames(encoded_domain_names)
      encoded_domain_names = deep_copy(encoded_domain_names)
      decoded_domain_names = []
      strings_to_decode = []

Severity: Minor
Found in library/types/src/modules/Punycode.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 Convert.to_symbol(
              WS_error(Builtins.sformat("Next not found: %1", current))
            )
Severity: Major
Found in library/sequencer/src/modules/Sequencer.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return :empty if !File.size?(file)
    Severity: Major
    Found in library/system/src/lib/yast2/clients/view_anymsg.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return :closed if allowed_interfaces.empty?
      Severity: Major
      Found in library/network/src/modules/CWMFirewallInterfaces.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return :back if Ops.less_than(Builtins.size(stack), 2)
        Severity: Major
        Found in library/sequencer/src/modules/Sequencer.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return false
          Severity: Major
          Found in library/network/src/modules/PortRanges.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return "C" if r == :abort
            Severity: Major
            Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language