yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

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

    def GetListOfForwardsIntoMasquerade
      list_of_rules = []

      Builtins.foreach(
        Builtins.splitstring(
Severity: Minor
Found in library/network/src/lib/network/susefirewall2.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 CreateNewPortRange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def CreateNewPortRange(min_pr, max_pr)
      if min_pr.nil? || min_pr == 0
        Builtins.y2error(
          "Wrong definition of the starting port '%1', it must be between 1 and 65535",
          min_pr
Severity: Minor
Found in library/network/src/modules/PortRanges.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 enable_modifications_cache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def enable_modifications_cache
        # Return an array with all the modified attributes/relations
        define_method "modified" do
          @modified ||= []
        end
Severity: Minor
Found in library/network/src/lib/y2firewall/firewalld/relations.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 EnableDisableNow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def EnableDisableNow(force: false)
      return unless force || Modified()

      if current_name && Modified()
        stop_service(current_name)
Severity: Minor
Found in library/network/src/modules/NetworkService.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 AnyRPCServiceInConfiguration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def AnyRPCServiceInConfiguration
      ret = false

      Builtins.foreach(GetKnownFirewallZones()) do |fw_zone|
        fw_rule = Builtins.sformat("FW_SERVICES_%1_RPC", fw_zone)
Severity: Minor
Found in library/network/src/lib/network/susefirewall2.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 ReadServicesDefinedByRPMPackages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def ReadServicesDefinedByRPMPackages
      log.info "Reading FirewallD services from #{SERVICES_DIRECTORIES.join(" and ")}"

      @services ||= {}

Severity: Minor
Found in library/network/src/lib/network/susefirewalldservices.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 ArePortsOrServicesAllowed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def ArePortsOrServicesAllowed(needed_ports, protocol, zone, check_for_aliases)
      needed_ports = deep_copy(needed_ports)
      are_allowed = true

      if Ops.less_than(Builtins.size(needed_ports), 1)
Severity: Minor
Found in library/network/src/lib/network/susefirewall.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 remove_port has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def remove_port(port_or_range, protocol, interface)
      return false unless valid_port?(port_or_range)
      return false unless supported_protocol?(protocol)

      zone = interface_zone(interface)
Severity: Minor
Found in library/network/src/modules/firewalld_wrapper.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 AutoStartInit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def AutoStartInit(widget, _key)
      widget = deep_copy(widget)
      if !UI.WidgetExists(Id("_cwm_service_startup"))
        Builtins.y2error("Widget _cwm_service_startup does not exist")
        return
Severity: Minor
Found in library/cwm/src/modules/CWMServiceStart.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 SelectPackages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def SelectPackages(toinstall, toremove)
      toinstall = deep_copy(toinstall)
      toremove = deep_copy(toremove)
      ok = true

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

    def set_property(key, value)
      current_value = get_property(key)

      # Redefining already existent information
      if !current_value.nil? && !current_value.empty? && current_value != value
Severity: Minor
Found in library/packages/src/modules/Product.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 ImportGPGKeyIntoTrustedDialog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def ImportGPGKeyIntoTrustedDialog(key, repository)
      key = deep_copy(key)
      # additional Richtext (HTML) warning text (kind of help), 1/2
      warning_text = _(
        "<p>The owner of the key may distribute updates,\n" \
Severity: Minor
Found in library/packages/src/modules/SignatureCheckDialogs.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 release_notes_content_for_lang_and_format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def release_notes_content_for_lang_and_format(lang, format)
        # If there is an index and the language is not indexed
        return nil unless release_notes_index.empty? || indexed_release_notes_for?(lang, format)

        # Where we want to store the downloaded release notes
Severity: Minor
Found in library/packages/src/lib/y2packager/release_notes_fetchers/url.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 CreateStartStopWidget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def CreateStartStopWidget(settings)
      settings = deep_copy(settings)

      start_now_button = Ops.get_locale(
        settings,
Severity: Minor
Found in library/cwm/src/modules/CWMServiceStart.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 ValidateValueType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def ValidateValueType(key, value, widget)
      types = {
        # general
        "widget"        => "symbol",
        "custom_widget" => "term",
Severity: Minor
Found in library/cwm/src/modules/CWM.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 DisableButtons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def DisableButtons(buttons)
      Builtins.foreach(buttons) do |button|
        Wizard.DisableBackButton if button == "back_button"
        Wizard.DisableAbortButton if button == "abort_button"
        Wizard.DisableNextButton if button == "next_button"
Severity: Minor
Found in library/cwm/src/modules/CWM.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 WaitForYesNoCancelUserInput has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def WaitForYesNoCancelUserInput
      user_input = nil
      ret = nil

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

    def ProgressScanDb(value)
      if Mode.commandline
        CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + "#{value}%")
      elsif @_scan_popup && UI.WidgetExists(Id(:label_scanDB_popup))
        UI.ChangeWidget(Id(:progress), :Value, value)
Severity: Minor
Found in library/packages/src/modules/PackageCallbacks.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 product_package has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def product_package(name, _repo_id = nil)
      return nil unless name

      # find the highest version
      Y2Packager::Resolvable.find(kind: :package, name: name).reduce(nil) do |a, p|
Severity: Minor
Found in library/packages/src/lib/y2packager/product_reader.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 CreateAutoStartWidget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def CreateAutoStartWidget(settings)
      settings = deep_copy(settings)

      start_auto_button = Ops.get_locale(
        settings,
Severity: Minor
Found in library/cwm/src/modules/CWMServiceStart.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