yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method HaveService has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def HaveService(service, protocol, interface)
      if !IsSupportedProtocol(protocol)
        Builtins.y2error("Unknown protocol: %1", protocol)
        return nil
      end
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 ReadSysconfigSuSEFirewall has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def ReadSysconfigSuSEFirewall(variables)
      variables = deep_copy(variables)
      Builtins.foreach(variables) do |variable|
        value = Convert.to_string(
          SCR.Read(Builtins.add(path(".sysconfig.SuSEfirewall2"), variable))
Severity: Minor
Found in library/network/src/lib/network/susefirewall2.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 PortIsInPortranges has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def PortIsInPortranges(port, port_ranges)
      port_ranges = deep_copy(port_ranges)
      return false if Builtins.size(port_ranges) == 0

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

    def StringsOfTerm(term)
      term = deep_copy(term)
      rets = []
      args = Builtins.size(term)
      index = 0
Severity: Minor
Found in library/cwm/src/modules/CWM.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 cd_devices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def cd_devices(preferred)
      cds = Convert.convert(
        SCR.Read(path(".probe.cdrom")),
        from: "any",
        to:   "list <map>"
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 curl_proxy_args has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def curl_proxy_args
        # Import the module when it is needed to avoid building projects (bsc#1079045)
        Yast.import "Proxy"

        return @curl_proxy_args if @curl_proxy_args
Severity: Minor
Found in library/packages/src/lib/y2packager/release_notes_fetchers/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 ValidateValueContents has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def ValidateValueContents(key, value, widget)
      error = ""
      case key
      when "label"
        s = Convert.to_string(value)
Severity: Minor
Found in library/cwm/src/modules/CWM.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 find_control_package has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def find_control_package(release_package)
      return nil unless release_package&.deps

      release_package.deps.each do |dep|
        provide = dep["provides"]
Severity: Minor
Found in library/control/src/modules/WorkflowManager.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 Launch has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def Launch(modul)
      function = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Call"], "")
      argument = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Argument"], "")
      Builtins.y2debug("Calling: %1 (%2)", function, argument)

Severity: Minor
Found in library/desktop/src/clients/menu.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 init_scalars_from_hash has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def init_scalars_from_hash(hash)
        hash.each_pair do |key, value|
          name = attrib_name(key)

          if name.nil?

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 BrowseTreeHelper has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def BrowseTreeHelper(variable, indent)
      variable = deep_copy(variable)
      simple = FormatSimpleType(variable, indent)

      return Item(simple) unless simple.nil?
Severity: Minor
Found in library/general/src/modules/ValueBrowser.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 load_product_features has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def load_product_features
        if installation_layout && !installation_layout.empty?
          @mode = installation_layout[:mode] unless installation_layout[:mode].nil?
          @banner = installation_layout[:banner] unless installation_layout[:banner].nil?
        elsif installation_ui == "sidebar"
Severity: Minor
Found in library/general/src/lib/ui/wizards/layout.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 ComputePackage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def ComputePackage
      packages = GetPackages()
      the_kernel = Ops.get(packages, 0, "")
      Builtins.y2milestone("Selecting '%1' as kernel package", the_kernel)

Severity: Minor
Found in library/system/src/modules/Kernel.rb - About 1 hr to fix

    Method Stage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def Stage(stage, title, step)
          return if !@visible
    
          Step(step) if -1 != step
    
    
    Severity: Minor
    Found in library/wizard/src/modules/Progress.rb - About 1 hr to fix

      Method NextStage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def NextStage
            return if !@visible
      
            NextStep()
      
      
      Severity: Minor
      Found in library/wizard/src/modules/Progress.rb - About 1 hr to fix

        Method main has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def main
              Yast.import "UI"
              Yast.import "LogViewCore"
        
              @command = "/usr/bin/tail -n 25 -f '/var/log/messages'"
        Severity: Minor
        Found in library/log/examples/logviewcore3.rb - About 1 hr to fix

          Method Check has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def Check
                # we already have a lock
                return @have_lock if !@have_lock.nil?
          
                # just to allow 'Retry', see more in bug #280383
          Severity: Minor
          Found in library/packages/src/modules/PackageLock.rb - About 1 hr to fix

            Method DividePortsAndPortRanges has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def DividePortsAndPortRanges(unsorted_ports, with_aliases)
                  unsorted_ports = deep_copy(unsorted_ports)
                  ret = {}
            
                  Builtins.foreach(unsorted_ports) do |port|
            Severity: Minor
            Found in library/network/src/modules/PortRanges.rb - About 1 hr to fix

              Method ChooseItemSimple has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def ChooseItemSimple(title, items, selected)
                    items = deep_copy(items)
                    item = nil
              
                    items = Builtins.maplist(items) { |i| Item(Id(i), i, i == selected) }
              Severity: Minor
              Found in library/network/src/modules/NetworkPopup.rb - About 1 hr to fix

                Method ActivateConfiguration has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def ActivateConfiguration
                      # just disabled
                      return true if !SuSEFirewallIsInstalled()
                
                      # starting firewall during second stage can cause deadlock in systemd - bnc#798620
                Severity: Minor
                Found in library/network/src/lib/network/susefirewall2.rb - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language