yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method singleOptionEditPopup has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def singleOptionEditPopup(option)
      option = deep_copy(option)
      opt_key = Ops.get_string(option, "_cwm_key", "")
      opt_id = Ops.get(option, "_cwm_id")

Severity: Minor
Found in library/cwm/src/modules/TablePopup.rb - About 3 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 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def main
      textdomain "base"

      Yast.import "Arch"
      Yast.import "Map"
Severity: Major
Found in library/network/src/modules/NetworkInterfaces.rb - About 3 hrs to fix

    Method InitPackageCallbacks has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def InitPackageCallbacks
          SetProcessCallbacks()
    
          SetProvideCallbacks()
    
    
    Severity: Major
    Found in library/packages/src/modules/PackageCallbacks.rb - About 3 hrs to fix

      File NetworkService.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "yast"
      require "yast2/systemd/service"
      require "shellwords"
      
      module Yast
      Severity: Minor
      Found in library/network/src/modules/NetworkService.rb - About 3 hrs to fix

        File dummy_callbacks.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require "yast"
        
        module Packages
          # Empty callbacks for package bindings. To register empty bindings in Yast::Pkg just call
          # {Packages::DummyCallbacks.register}
        Severity: Minor
        Found in library/packages/src/lib/packages/dummy_callbacks.rb - About 3 hrs to fix

          Class MessageClass has 26 methods (exceeds 20 allowed). Consider refactoring.
          Open

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

            Method ConfirmLicenses has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def ConfirmLicenses
                  ret = true
            
                  to_install = Pkg.GetPackages(:selected, true)
                  licenses = Pkg.PkgGetLicensesToConfirm(to_install)
            Severity: Major
            Found in library/packages/src/modules/PackagesUI.rb - About 2 hrs to fix

              File PackageSystem.rb has 290 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require "yast"
              require "yast2/execute"
              require "shellwords"
              
              module Yast
              Severity: Minor
              Found in library/packages/src/modules/PackageSystem.rb - About 2 hrs to fix

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

                    def main
                      Yast.import "UI"
                      Yast.import "Label"
                      Yast.import "Popup"
                
                
                Severity: Major
                Found in doc/examples/popups1.rb - About 2 hrs to fix

                  Method Connect has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def Connect(show_continue_button)
                        # we already have a lock
                        return { "connected" => @have_lock, "aborted" => @aborted } if !@have_lock.nil?
                  
                        try_again = true
                  Severity: Minor
                  Found in library/packages/src/modules/PackageLock.rb - About 2 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 SaveCurrentConfiguration has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def SaveCurrentConfiguration
                        LazyLoadCurrentConf()
                  
                        # Removing nil entries from the configuration
                        new_configuration = {}
                  Severity: Minor
                  Found in library/general/src/modules/DontShowAgain.rb - About 2 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 ReadServicesDefinedByRPMPackages has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def ReadServicesDefinedByRPMPackages
                        log.info "Reading SuSEfirewall2 services from #{SERVICES_DIR}"
                        @services ||= {}
                  
                        if !FileUtils.Exists(SERVICES_DIR) ||
                  Severity: Major
                  Found in library/network/src/lib/network/susefirewall2services.rb - About 2 hrs to fix

                    Method PrintTable has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def PrintTable(header, content)
                          header = deep_copy(header)
                          content = deep_copy(content)
                          aligns = []
                          widths = []
                    Severity: Major
                    Found in library/commandline/src/modules/CommandLine.rb - About 2 hrs to fix

                      Method UseUnsignedItem has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def UseUnsignedItem(item_type, item_name, dont_show_dialog_ident, repository)
                            Builtins.y2milestone(
                              "UseUnsignedItem: type: %1, name: %2, dontshowid: %3, repo: %4",
                              item_type,
                              item_name,
                      Severity: Major
                      Found in library/packages/src/modules/SignatureCheckDialogs.rb - About 2 hrs to fix

                        Method has_attributes has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def has_attributes(*attributes, scope: nil, cache: false) # rubocop:disable Naming/PredicateName
                                scope_method = scope ? "#{scope}_" : ""
                                enable_modifications_cache if cache
                                define_method "attributes" do
                                  attributes
                        Severity: Minor
                        Found in library/network/src/lib/y2firewall/firewalld/relations.rb - About 2 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 RemoveAllowedPortsOrServices has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def RemoveAllowedPortsOrServices(remove_ports, protocol, zone, check_for_aliases)
                              remove_ports = deep_copy(remove_ports)
                              if Ops.less_than(Builtins.size(remove_ports), 1)
                                Builtins.y2warning(
                                  "Undefined list of %1 services/ports for service",
                        Severity: Minor
                        Found in library/network/src/lib/network/susefirewall.rb - About 2 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 UpdateWorkflows has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def UpdateWorkflows(workflows, prod_name, domain)
                              workflows = deep_copy(workflows)
                              Builtins.foreach(workflows) do |workflow|
                                stage = Ops.get_string(workflow, "stage", "")
                                mode = Ops.get_string(workflow, "mode", "")
                        Severity: Minor
                        Found in library/control/src/modules/WorkflowManager.rb - About 2 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 popupLayoutInternalTypeWithLabel has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def popupLayoutInternalTypeWithLabel(headline, message, button_box, label, richtext, width, height)
                              button_box = deep_copy(button_box)
                              rt = VWeight(
                                1,
                                VBox(
                        Severity: Minor
                        Found in library/general/src/modules/Popup.rb - About 2 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 CreateOpenFirewallWidget has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def CreateOpenFirewallWidget(settings)
                              settings = deep_copy(settings)
                        
                              services = adapt_settings_services!(settings)
                        
                        
                        Severity: Major
                        Found in library/network/src/modules/CWMFirewallInterfaces.rb - About 2 hrs to fix

                          Method AnyQuestion3 has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def AnyQuestion3(headline, message, yes_button_message, no_button_message, retry_button_message, focus)
                                yes_button = Empty()
                                no_button = Empty()
                                retry_button = Empty()
                          
                          
                          Severity: Major
                          Found in library/general/src/modules/Popup.rb - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language