yast/yast-yast2

View on GitHub

Showing 967 of 967 total issues

Method TableHandle has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def TableHandle(descr, key, event_descr)
      descr = deep_copy(descr)
      event_descr = deep_copy(event_descr)
      event_id = Ops.get(event_descr, "ID")
      UI.SetFocus(Id(:_tp_table))
Severity: Major
Found in library/cwm/src/modules/TablePopup.rb - About 5 hrs to fix

    Method Init has 146 lines of code (exceeds 25 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: Major
    Found in library/commandline/src/modules/CommandLine.rb - About 5 hrs to fix

      Class StringClass has 43 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class StringClass < Module
          include Yast::Logger
      
          # @note it is ascii chars only
          UPPER_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".freeze
      Severity: Minor
      Found in library/types/src/modules/String.rb - About 5 hrs to fix

        Method Write has 145 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def Write(devregex)
              log.info("Writing configuration")
              log.debug("Devices=#{@Devices}")
              log.debug("Deleted=#{@Deleted}")
        
        
        Severity: Major
        Found in library/network/src/modules/NetworkInterfaces.rb - About 5 hrs to fix

          Method Write has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

              def Write(devregex)
                log.info("Writing configuration")
                log.debug("Devices=#{@Devices}")
                log.debug("Deleted=#{@Deleted}")
          
          
          Severity: Minor
          Found in library/network/src/modules/NetworkInterfaces.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 Run has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

              def Run(commandline)
                commandline = deep_copy(commandline)
                # The main ()
                Builtins.y2milestone("----------------------------------------")
                Builtins.y2milestone("Command line interface started")
          Severity: Minor
          Found in library/commandline/src/modules/CommandLine.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

          Class CWMFirewallInterfacesClass has 42 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class CWMFirewallInterfacesClass < Module
              include Y2Firewall::Helpers::Interfaces
              include Yast::Logger
          
              # [Array<String>] List of all interfaces relevant for firewall settings
          Severity: Minor
          Found in library/network/src/modules/CWMFirewallInterfaces.rb - About 5 hrs to fix

            Method Load has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                def Load(modulename, moduleargs, vendorname, devicename, ask_before_loading, with_modprobe)
                  if modulename != "" &&
                      # there is no reason for checking initrd, if I need the module to get loaded, I just  need to
                      # check if it isn't already loaded
                      #      && (!contains (Initrd::ListModules (), modulename))
            Severity: Minor
            Found in library/system/src/modules/ModuleLoading.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 prepareWidget has 139 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def prepareWidget(widget_descr)
                  widget_descr = deep_copy(widget_descr)
                  w = deep_copy(widget_descr)
                  widget = Ops.get_symbol(w, "widget", :inputfield)
            
            
            Severity: Major
            Found in library/cwm/src/modules/CWM.rb - About 5 hrs to fix

              Method main has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
              Open

                  def main
                    Yast.import "UI"
              
                    textdomain "base"
              
              
              Severity: Minor
              Found in library/desktop/src/clients/menu.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

              File PortRanges.rb has 392 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require "yast"
              
              module Yast
                # Tools for ranges of network ports, as used by iptables for firewalling.
                #
              Severity: Minor
              Found in library/network/src/modules/PortRanges.rb - About 5 hrs to fix

                Class DummyCallbacks has 40 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class DummyCallbacks
                    class << self
                      include Yast::Logger
                
                      def register
                Severity: Minor
                Found in library/packages/src/lib/packages/dummy_callbacks.rb - About 5 hrs to fix

                  Method ReadServicesDefinedByRPMPackages has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def ReadServicesDefinedByRPMPackages
                        log.info "Reading SuSEfirewall2 services from #{SERVICES_DIR}"
                        @services ||= {}
                  
                        if !FileUtils.Exists(SERVICES_DIR) ||
                  Severity: Minor
                  Found in library/network/src/lib/network/susefirewall2services.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 ProcessSystemCommands has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def ProcessSystemCommands(command)
                        command = deep_copy(command)
                        # handle help for specific command
                        # this needs to be before general help, so "help help" works
                        if Ops.get(command, ["options", "help"])
                  Severity: Major
                  Found in library/commandline/src/modules/CommandLine.rb - About 5 hrs to fix

                    Class FirewalldBashAPI has 39 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class FirewalldBashAPI
                        include Yast::Logger
                    
                      private
                    
                    
                    Severity: Minor
                    Found in library/network/src/lib/network/firewalld.rb - About 5 hrs to fix

                      Class CWMClass has 39 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class CWMClass < Module
                          def main
                            Yast.import "UI"
                            textdomain "base"
                      
                      
                      Severity: Minor
                      Found in library/cwm/src/modules/CWM.rb - About 5 hrs to fix

                        Method ConvertToServicesDefinedByPackages has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def ConvertToServicesDefinedByPackages
                              return if @already_converted
                        
                              if FileUtils.Exists(@converted_to_services_dbp_file)
                                @already_converted = true
                        Severity: Minor
                        Found in library/network/src/lib/network/susefirewall2.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 126 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def main
                              textdomain "base"
                        
                              Yast.import "Mode"
                              Yast.import "Service"
                        Severity: Major
                        Found in library/network/src/lib/network/susefirewall2.rb - About 5 hrs to fix

                          Method CreateTableDescr has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def CreateTableDescr(attrib, widget_descr)
                                attrib = deep_copy(attrib)
                                widget_descr = deep_copy(widget_descr)
                                ValidateTableAttr(attrib)
                          
                          
                          Severity: Major
                          Found in library/cwm/src/modules/TablePopup.rb - About 5 hrs to fix

                            File URL.rb has 375 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            require "yast"
                            
                            module Yast
                              # A module for dealing with URLs
                              #
                            Severity: Minor
                            Found in library/types/src/modules/URL.rb - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language