yast/yast-yast2

View on GitHub

Showing 968 of 968 total issues

File PackageCallbacks.rb has 2396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "yast"
require "uri"
require "packages/dummy_callbacks"
require "packages/file_conflict_callbacks"

Severity: Major
Found in library/packages/src/modules/PackageCallbacks.rb - About 6 days to fix

    File susefirewall2.rb has 1754 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "yast"
    require "network/susefirewall"
    
    module Yast
      # ----------------------------------------------------------------------------
    Severity: Major
    Found in library/network/src/lib/network/susefirewall2.rb - About 4 days to fix

      File CommandLine.rb has 1148 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "yast"
      
      module Yast
        class CommandLineClass < Module
          include Yast::Logger
      Severity: Major
      Found in library/commandline/src/modules/CommandLine.rb - About 2 days to fix

        File Popup.rb has 1135 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require "yast"
        require "erb"
        # when we need to modify some old method, then sometimes it is easier to replace it with new one
        require "yast2/popup"
        
        
        Severity: Major
        Found in library/general/src/modules/Popup.rb - About 2 days to fix

          File ProductControl.rb has 1132 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require "yast"
          require "yast2/control_log_dir_rotator"
          require "yast2/popup"
          
          module Yast
          Severity: Major
          Found in library/control/src/modules/ProductControl.rb - About 2 days to fix

            File Wizard.rb has 1103 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require "yast"
            
            module Yast
              class WizardClass < Module
                DEFAULT_ICON_NAME = "yast".freeze
            Severity: Major
            Found in library/wizard/src/modules/Wizard.rb - About 2 days to fix

              File WorkflowManager.rb has 1043 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require "yast"
              require "yast2/control_log_dir_rotator"
              
              require "packages/package_downloader"
              require "packages/package_extractor"
              Severity: Major
              Found in library/control/src/modules/WorkflowManager.rb - About 2 days to fix

                File NetworkInterfaces.rb has 996 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require "yast"
                require "shellwords"
                
                module Yast
                  # Reads and writes the ifcfg files (/etc/sysconfig/network/ifcfg-*).
                Severity: Major
                Found in library/network/src/modules/NetworkInterfaces.rb - About 2 days to fix

                  Class PackageCallbacksClass has 120 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class PackageCallbacksClass < Module
                      include Yast::Logger
                  
                      # text to clean progress bar in command line
                      CLEAR_PROGRESS_TEXT = ("\b" * 10) + (" " * 10) + ("\b" * 10)
                  Severity: Major
                  Found in library/packages/src/modules/PackageCallbacks.rb - About 2 days to fix

                    Method MediaChange has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device)
                          devices = deep_copy(devices)
                          if @autorefreshing && @autorefreshing_aborted
                            Builtins.y2milestone("Refresh aborted")
                            return "C"
                    Severity: Minor
                    Found in library/packages/src/modules/PackageCallbacks.rb - About 2 days 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 has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def Parse(arguments)
                          args = deep_copy(arguments)
                          return {} if Ops.less_than(Builtins.size(args), 1)
                    
                          # Parse command
                    Severity: Minor
                    Found in library/commandline/src/modules/CommandLine.rb - About 2 days 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 SignatureCheckDialogs.rb has 838 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require "yast"
                    
                    module Yast
                      class SignatureCheckDialogsClass < Module
                        def main
                    Severity: Major
                    Found in library/packages/src/modules/SignatureCheckDialogs.rb - About 2 days to fix

                      File susefirewalld.rb has 795 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require "yast"
                      require "y2firewall/firewalld/api"
                      require "network/susefirewall"
                      
                      module Yast
                      Severity: Major
                      Found in library/network/src/lib/network/susefirewalld.rb - About 1 day to fix

                        File TablePopup.rb has 787 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require "yast"
                        
                        module Yast
                          class TablePopupClass < Module
                            def main
                        Severity: Major
                        Found in library/cwm/src/modules/TablePopup.rb - About 1 day to fix

                          File CWM.rb has 784 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require "yast"
                          
                          require "cwm/abstract_widget"
                          
                          module Yast
                          Severity: Major
                          Found in library/cwm/src/modules/CWM.rb - About 1 day to fix

                            Method ParseOptions has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def ParseOptions(options, parameters)
                                  parameters ||= {}
                                  ret = []
                            
                                  # parsing options
                            Severity: Minor
                            Found in library/types/src/modules/String.rb - About 1 day 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 RunFrom has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def RunFrom(from, allow_back)
                                  former_result = :next
                                  final_result = nil
                                  @current_step = from # current module
                            
                            
                            Severity: Minor
                            Found in library/control/src/modules/ProductControl.rb - About 1 day 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 WizardClass has 92 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                              class WizardClass < Module
                                DEFAULT_ICON_NAME = "yast".freeze
                            
                                def main
                                  Yast.import "UI"
                            Severity: Major
                            Found in library/wizard/src/modules/Wizard.rb - About 1 day to fix

                              File CWMFirewallInterfaces.rb has 704 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              require "yast"
                              require "y2firewall/firewalld"
                              require "y2firewall/helpers/interfaces"
                              
                              module Yast
                              Severity: Major
                              Found in library/network/src/modules/CWMFirewallInterfaces.rb - About 1 day to fix

                                Class SuSEFirewall2Class has 85 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                  class SuSEFirewall2Class < SuSEFirewallClass
                                    CONFIG_FILE = "/etc/sysconfig/SuSEfirewall2".freeze
                                
                                    include Yast::Logger
                                
                                
                                Severity: Major
                                Found in library/network/src/lib/network/susefirewall2.rb - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language