yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method add_element has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def add_element(doc, metadata, parent, contents, parent_array: nil)
      # backward compatibility. Keys are sorted and needs old ycp sort to be able to compare also classes
      Builtins.sort(contents.keys).each do |key|
        raise XMLSerializationError.new("Cannot represent non-string key '#{key.inspect}', part of #{contents.inspect}", contents) unless key.is_a?(::String)

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

    def parse_node(node, result)
      name = node.name
      # use only element children
      children = node.children
      children = children.select(&:element?)
Severity: Minor
Found in library/xml/src/modules/XML.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 generate_config has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_config(pth, values)
      config = {}
      values.each do |val|
        item = SCR.Read(path("#{pth}.#{val}"))
        log.debug("item=#{item}")
Severity: Minor
Found in library/network/src/modules/NetworkInterfaces.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 IsServiceOrPortsOpen has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def IsServiceOrPortsOpen(service, fallback_ports)
      fallback_ports = deep_copy(fallback_ports)
      ret = false

      Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
Severity: Minor
Found in library/network/src/modules/SuSEFirewallProposal.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 ConfirmLicenses has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def ConfirmLicenses
      ret = true

      to_install = Pkg.GetPackages(:selected, true)
      licenses = Pkg.PkgGetLicensesToConfirm(to_install)
Severity: Minor
Found in library/packages/src/modules/PackagesUI.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 RunPatternSelector has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def RunPatternSelector(enable_back: false, cancel_label: Label.CancelButton)
      Builtins.y2milestone("Running pattern selection dialog")

      if !UI.HasSpecialWidget(:PatternSelector) ||
          UI.WizardCommand(term(:Ping)) != true
Severity: Minor
Found in library/packages/src/modules/PackagesUI.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 UpdateProposal has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def UpdateProposal
      last_known_interfaces = GetKnownInterfaces()
      currently_known_interfaces = SuSEFirewall.GetListOfKnownInterfaces

      had_dialup_interfaces = false
Severity: Minor
Found in library/network/src/modules/SuSEFirewallProposal.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 WriteConfig has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def WriteConfig(config, data)
      data = deep_copy(data)
      Builtins.y2debug("config=%1", config)
      Builtins.y2debug("data=%1", data)

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

    def GetAllKnownInterfaces
      known_interfaces = []

      # All dial-up interfaces
      dialup_interfaces = NetworkInterfaces.List("dialup")
Severity: Minor
Found in library/network/src/lib/network/susefirewall.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 ProgressProgress has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def ProgressProgress(id, val_raw, val_percent)
      Builtins.y2debug("ProgressProgress: %1, %2%% ", id, val_percent)

      if Mode.commandline
        if @tick_progress
Severity: Minor
Found in library/packages/src/modules/PackageCallbacks.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 StringSplitter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def StringSplitter(whattosplit, delimiter, after_chars)
      splittedstring = ""
      after_chars_counter = 0
      max_size = Builtins.size(whattosplit)

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

    def updateButtons(descr)
      descr = deep_copy(descr)
      Builtins.y2milestone("update buttons")
      id = Convert.to_string(UI.QueryWidget(Id(:_tw_table), :CurrentItem))
      item_list = Convert.convert(
Severity: Minor
Found in library/cwm/src/modules/CWMTable.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 cwm_definition has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def cwm_definition
      raise "Widget '#{self.class}' does set its widget type" if !respond_to?(:widget_type)

      res = {}

Severity: Minor
Found in library/cwm/src/lib/cwm/abstract_widget.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 CreateTableDescr has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def CreateTableDescr(attrib, widget_descr)
      attrib = deep_copy(attrib)
      widget_descr = deep_copy(widget_descr)
      ValidateTableAttr(attrib)
      add_button = if Ops.get_boolean(attrib, "add_delete_buttons", true)
Severity: Minor
Found in library/cwm/src/modules/CWMTable.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 askForNewOption has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def askForNewOption(possible, editable, descr)
      possible = deep_copy(possible)
      descr = deep_copy(descr)
      do_sort = !Ops.get_boolean(descr, "add_items_keep_order", false)
      possible = Builtins.sort(possible) if do_sort
Severity: Minor
Found in library/cwm/src/modules/TablePopup.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 SetShowQuestionAgain has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def SetShowQuestionAgain(params, new_value)
      params = deep_copy(params)
      LazyLoadCurrentConf()
      q_type = Ops.get(params, "q_type")
      # Always set to 'true' if the configuration is changed
Severity: Minor
Found in library/general/src/modules/DontShowAgain.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 absolute_url has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def absolute_url(path = nil)
      if (!relative.to_s.empty? && !RelURL.relurl?(relative)) || base.to_s.empty?
        ret = relative.dup
        relative_url = URI("")
      else
Severity: Minor
Found in library/general/src/lib/yast2/rel_url.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 anyTimedMessageTypeInternal has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def anyTimedMessageTypeInternal(headline, message, timeout, richtext, width, height)
      button_box = ButtonBox(
        # FIXME: BNC #422612, Use `opt(`noSanityCheck) later
        PushButton(Id(:stop), Opt(:cancelButton), Label.StopButton),
        PushButton(Id(:ok_msg), Opt(:default, :okButton), Label.OKButton)
Severity: Minor
Found in library/general/src/modules/Popup.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 Summary has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def Summary
      summary = ""
      # translators: summary header for messages generated through autoinstallation
      summary = Summary.AddHeader(summary, _("Messages"))
      summary = Summary.OpenList(summary)
Severity: Minor
Found in library/general/src/modules/Report.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 SetDefaultReturn has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def SetDefaultReturn(params, default_return)
      params = deep_copy(params)
      default_return = deep_copy(default_return)
      LazyLoadCurrentConf()
      q_type = Ops.get(params, "q_type")
Severity: Minor
Found in library/general/src/modules/DontShowAgain.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

Severity
Category
Status
Source
Language