yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method DoneProvide has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def DoneProvide(error, reason, name)
      Builtins.y2milestone("DoneProvide: %1, %2, %3", error, reason, name)

      if @_provide_popup
        UI.CloseDialog
Severity: Minor
Found in library/packages/src/modules/PackageCallbacks.rb - About 7 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

Class WorkflowManagerClass has 51 methods (exceeds 20 allowed). Consider refactoring.
Open

  class WorkflowManagerClass < Module
    include Yast::Logger

    def main
      Yast.import "UI"
Severity: Major
Found in library/control/src/modules/WorkflowManager.rb - About 7 hrs to fix

    Method InstallationSummary has 179 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def InstallationSummary(summary)
          ret = ""
    
          if Builtins.haskey(summary, "success")
            ret = HTML.Para(
    Severity: Major
    Found in library/packages/src/modules/PackagesUI.rb - About 7 hrs to fix

      File Report.rb has 461 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "yast"
      require "yast2/popup"
      
      module Yast
        # Report module is universal reporting module. It properly display messages
      Severity: Minor
      Found in library/general/src/modules/Report.rb - About 7 hrs to fix

        File String.rb has 461 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require "yast"
        
        module Yast
          class StringClass < Module
            include Yast::Logger
        Severity: Minor
        Found in library/types/src/modules/String.rb - About 7 hrs to fix

          Method Handle has 176 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def Handle(widget, _key, event)
                widget = deep_copy(widget)
                event = deep_copy(event)
                ret = Ops.get(event, "ID")
                existing_filename = Convert.to_string(
          Severity: Major
          Found in library/cwm/src/modules/CWMTsigKeys.rb - About 7 hrs to fix

            Method CreateWidget has 173 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def CreateWidget(settings)
                  settings = deep_copy(settings)
                  # tsig keys management dialog help 1/4
                  help = _(
                    "<p><big><b>TSIG Key Management</b></big><br>\nUse this dialog to manage the TSIG keys.</p>\n"
            Severity: Major
            Found in library/cwm/src/modules/CWMTsigKeys.rb - About 6 hrs to fix

              Method ProbeKernel has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

                  def ProbeKernel
                    kernel_desktop_exists = ((Mode.normal || Mode.repair) &&
                      Pkg.PkgInstalled("kernel-desktop")) ||
                      Pkg.PkgAvailable("kernel-desktop")
                    Builtins.y2milestone(
              Severity: Minor
              Found in library/system/src/modules/Kernel.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 Init has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
              Open

                  def Init(cmdlineinfo, args)
                    cmdlineinfo = deep_copy(cmdlineinfo)
                    args = deep_copy(args)
                    # remember the command line specification
                    # required later by xmlhelp command
              Severity: Minor
              Found in library/commandline/src/modules/CommandLine.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

              File Kernel.rb has 451 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require "yast"
              
              module Yast
                class KernelClass < Module
                  include Yast::Logger
              Severity: Minor
              Found in library/system/src/modules/Kernel.rb - About 6 hrs to fix

                Method ProposalSummary has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def ProposalSummary
                      # output: $[ "output" : "HTML Proposal", "warning" : "HTML Warning" ];
                      output = ""
                      warning = ""
                
                
                Severity: Major
                Found in library/network/src/modules/SuSEFirewallProposal.rb - About 6 hrs to fix

                  Method Parse has 166 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def Parse(arguments)
                        args = deep_copy(arguments)
                        return {} if Ops.less_than(Builtins.size(args), 1)
                  
                        # Parse command
                  Severity: Major
                  Found in library/commandline/src/modules/CommandLine.rb - About 6 hrs to fix

                    Class ProductControlClass has 47 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class ProductControlClass < Module
                        include Yast::Logger
                    
                        # Product control system roles key
                        # @return [String] System roles
                    Severity: Minor
                    Found in library/control/src/modules/ProductControl.rb - About 6 hrs to fix

                      Class LabelClass has 47 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class LabelClass < Module
                          def main
                            textdomain "base"
                          end
                      
                      
                      Severity: Minor
                      Found in library/general/src/modules/Label.rb - About 6 hrs to fix

                        Class ArchClass has 46 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class ArchClass < Module
                            def main
                              # local variables
                        
                              @_architecture = nil
                        Severity: Minor
                        Found in library/general/src/modules/Arch.rb - About 6 hrs to fix

                          Class SystemService has 46 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class SystemService
                              extend Forwardable
                          
                              # Error when a service is not found
                              class NotFoundError < RuntimeError; end
                          Severity: Minor
                          Found in library/systemd/src/lib/yast2/system_service.rb - About 6 hrs to fix

                            Method Run has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def Run(widgets, functions, skip_store_for: [])
                                  widgets = deep_copy(widgets)
                                  functions = deep_copy(functions)
                                  widgets = mergeFunctions(widgets, functions)
                                  PushSettings()
                            Severity: Minor
                            Found in library/cwm/src/modules/CWM.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

                            File SlideShow.rb has 426 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            require "yast"
                            require "yast2/system_time"
                            
                            module Yast
                              class SlideShowClass < Module
                            Severity: Minor
                            Found in library/packages/src/modules/SlideShow.rb - About 6 hrs to fix

                              Method WS_check has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def WS_check(aliases, sequence)
                                    aliases = deep_copy(aliases)
                                    sequence = deep_copy(sequence)
                                    ret = []
                              
                              
                              Severity: Minor
                              Found in library/sequencer/src/modules/Sequencer.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 main has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def main
                                    textdomain "base"
                              
                                    Yast.import "FileUtils"
                              
                              
                              Severity: Major
                              Found in library/network/src/lib/network/susefirewall2services.rb - About 5 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language