yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

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

    def OpenMenu
      # check if user is root (#246015)
      output = Convert.to_map(
        SCR.Execute(path(".target.bash_output"), "/usr/bin/id --user")
      )
Severity: Major
Found in library/desktop/src/clients/menu.rb - About 2 hrs to fix

    Method CreateInterfacesWidget has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def CreateInterfacesWidget(settings)
          settings = deep_copy(settings)
          widget = HBox(
            HSpacing(1),
            VBox(
    Severity: Major
    Found in library/network/src/modules/CWMFirewallInterfaces.rb - About 2 hrs to fix

      Method Setup has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def Setup(stages)
            stages = deep_copy(stages)
            log.info "SlideShow stages: #{stages}"
            # initiliaze the generic counters
            Reset()
      Severity: Major
      Found in library/packages/src/modules/SlideShow.rb - About 2 hrs to fix

        Method ShowErrorPopUp has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def ShowErrorPopUp(heading, error_text, details)
              bugzilla_url = "http://bugzilla.suse.com/"
              bugzilla_url = "http://bugzilla.opensuse.org" if OSRelease.ReleaseName.include? "openSUSE"
              success = UI.OpenDialog(
                Opt(:decorated, :warncolor),
        Severity: Major
        Found in library/control/src/modules/InstError.rb - About 2 hrs to fix

          Class SuSEFirewallProposalClass has 24 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class SuSEFirewallProposalClass < Module
              include Yast::Logger
          
              def main
                textdomain "base"
          Severity: Minor
          Found in library/network/src/modules/SuSEFirewallProposal.rb - About 2 hrs to fix

            Class SignatureCheckDialogsClass has 24 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class SignatureCheckDialogsClass < Module
                def main
                  Yast.import "Pkg"
                  Yast.import "UI"
                  textdomain "base"
            Severity: Minor
            Found in library/packages/src/modules/SignatureCheckDialogs.rb - About 2 hrs to fix

              Class TablePopupClass has 24 methods (exceeds 20 allowed). Consider refactoring.
              Open

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

                Method TableHandle has 66 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")
                      attrib = Ops.get_map(descr, "_cwm_attrib", {})
                Severity: Major
                Found in library/cwm/src/modules/CWMTable.rb - About 2 hrs to fix

                  File WizardHW.rb has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "yast"
                  
                  module Yast
                    class WizardHWClass < Module
                      def main
                  Severity: Minor
                  Found in library/cwm/src/modules/WizardHW.rb - About 2 hrs to fix

                    File GPGWidgets.rb has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require "yast"
                    
                    module Yast
                      class GPGWidgetsClass < Module
                        def main
                    Severity: Minor
                    Found in library/gpg/src/modules/GPGWidgets.rb - About 2 hrs to fix

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

                          def main
                            # This file contains only translations for
                            # FATE #300687: Ports for SuSEfirewall added via packages
                            #
                            # Translations are grabbed when 'make pot' is called.
                      Severity: Major
                      Found in library/network/src/yast2-services-translations.rb - About 2 hrs to fix

                        Method has_many has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def has_many(*relations, scope: nil, cache: false) # rubocop:disable Naming/PredicateName
                                scope = "#{scope}_" if scope
                                enable_modifications_cache if cache
                        
                                define_method "relations" do
                        Severity: Major
                        Found in library/network/src/lib/y2firewall/firewalld/relations.rb - About 2 hrs to fix

                          Method ChooseItem has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def ChooseItem(_title, items, selected)
                                items = deep_copy(items)
                                item = nil
                          
                                items = Builtins.maplist(items) do |i|
                          Severity: Major
                          Found in library/network/src/modules/NetworkPopup.rb - About 2 hrs to fix

                            Method ProposeFunctions has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def ProposeFunctions
                                  known_interfaces = SuSEFirewall.GetAllKnownInterfaces
                            
                                  dial_up_interfaces = []
                                  non_dup_interfaces = []
                            Severity: Major
                            Found in library/network/src/modules/SuSEFirewallProposal.rb - About 2 hrs to fix

                              Method ItemSignedWithUnknownSignature has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def ItemSignedWithUnknownSignature(item_type, item_name, key_id, dont_show_dialog_ident, repoid)
                                    repo_url = Ops.get_string(Pkg.SourceGeneralData(repoid), "url", "")
                                    description_text = Builtins.sformat(
                                      if item_type == :package
                                        # popup question, %1 stands for the package name, %2 for the complex multiline description of the GnuPG key
                              Severity: Major
                              Found in library/packages/src/modules/SignatureCheckDialogs.rb - About 2 hrs to fix

                                Method StoreAllowedInterfaces has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def StoreAllowedInterfaces(services)
                                      services = deep_copy(services)
                                      # do not save anything if configuration didn't change
                                      return if !configuration_changed
                                
                                
                                Severity: Minor
                                Found in library/network/src/modules/CWMFirewallInterfaces.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 AddModule has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def AddModule(modname, modargs)
                                      log.warn "Initrd.AddModule() is deprecated, do not use (sysconfig.kernel.INITRD_MODULES " \
                                               "is not written anymore, see bnc#895084)"
                                
                                      if Stage.initial && Builtins.size(@modules) == 0
                                Severity: Minor
                                Found in library/system/src/modules/Initrd.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 New has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def New(window_title, progress_title, length, stg, tits, help_text)
                                      stg = deep_copy(stg)
                                      tits = deep_copy(tits)
                                      return if !@visible
                                
                                
                                Severity: Minor
                                Found in library/wizard/src/modules/Progress.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 ShowInstallationSummaryMap has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def ShowInstallationSummaryMap(summary)
                                      summary_str = InstallationSummary(summary)
                                
                                      if summary["installed"] == 0 && summary["updated"] == 0 && summary["removed"] == 0 && summary["remaining"] == []
                                        Builtins.y2warning("No summary, skipping summary dialog")
                                Severity: Minor
                                Found in library/packages/src/modules/PackagesUI.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 SetServicesForZones has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def SetServicesForZones(services_ids, firewall_zones, new_status)
                                      Yast.import "SuSEFirewallServices"
                                
                                      services_ids = deep_copy(services_ids)
                                      zones = deep_copy(firewall_zones)
                                Severity: Minor
                                Found in library/network/src/lib/network/susefirewalld.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

                                Severity
                                Category
                                Status
                                Source
                                Language