yast/yast-yast2

View on GitHub

Showing 968 of 968 total issues

Method TableHandle has a Cognitive Complexity of 79 (exceeds 5 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: Minor
Found in library/cwm/src/modules/TablePopup.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 FlattenServices has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
Open

    def FlattenServices(old_list, protocol)
      old_list = deep_copy(old_list)
      if !Builtins.contains(["TCP", "UDP"], protocol)
        message = Builtins.sformat(
          "Protocol %1 doesn't support port ranges, skipping...",
Severity: Minor
Found in library/network/src/modules/PortRanges.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 MediaChange has 279 lines of code (exceeds 25 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: Major
Found in library/packages/src/modules/PackageCallbacks.rb - About 1 day to fix

    File susefirewall.rb has 629 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    Severity: Major
    Found in library/network/src/lib/network/susefirewall.rb - About 1 day to fix

      Method ProposalSummary has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
      Open

          def ProposalSummary
            # output: $[ "output" : "HTML Proposal", "warning" : "HTML Warning" ];
            output = ""
            warning = ""
      
      
      Severity: Minor
      Found in library/network/src/modules/SuSEFirewallProposal.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

      File PackagesUI.rb has 599 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Severity: Major
      Found in library/packages/src/modules/PackagesUI.rb - About 1 day to fix

        Class PopupClass has 68 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class PopupClass < Module
            def main
              Yast.import "UI"
        
              textdomain "base"
        Severity: Major
        Found in library/general/src/modules/Popup.rb - About 1 day to fix

          File Progress.rb has 580 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require "yast"
          
          module Yast
            class ProgressClass < Module
              include Yast::Logger
          Severity: Major
          Found in library/wizard/src/modules/Progress.rb - About 1 day to fix

            File CWMTsigKeys.rb has 576 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require "yast"
            require "shellwords"
            
            module Yast
              class CWMTsigKeysClass < Module
            Severity: Major
            Found in library/cwm/src/modules/CWMTsigKeys.rb - About 1 day to fix

              Class SuSEFirewalldClass has 62 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class SuSEFirewalldClass < SuSEFirewallClass
                  require "set"
                  attr_reader :special_all_interface_zone
              
                  # Valid attributes for firewalld zones
              Severity: Major
              Found in library/network/src/lib/network/susefirewalld.rb - About 1 day to fix

                Method RunFrom has 221 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def RunFrom(from, allow_back)
                      former_result = :next
                      final_result = nil
                      @current_step = from # current module
                
                
                Severity: Major
                Found in library/control/src/modules/ProductControl.rb - About 1 day to fix

                  File CWMServiceStart.rb has 531 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "yast"
                  
                  module Yast
                    # Routines for service start widget handling.
                    #
                  Severity: Major
                  Found in library/cwm/src/modules/CWMServiceStart.rb - About 1 day to fix

                    Method initialize_hwinfo_classnames has 217 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def initialize_hwinfo_classnames(_include_target)
                          textdomain "base"
                    
                          # Class names collected
                          @ClassNames = {
                    Severity: Major
                    Found in library/system/src/include/hwinfo/classnames.rb - About 1 day to fix

                      Class NetworkInterfacesClass has 58 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class NetworkInterfacesClass < Module
                          attr_reader :Devices
                      
                          include Logger
                      
                      
                      Severity: Major
                      Found in library/network/src/modules/NetworkInterfaces.rb - About 1 day to fix

                        Method Handle has a Cognitive Complexity of 53 (exceeds 5 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: Minor
                        Found in library/cwm/src/modules/CWMTsigKeys.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 DonePackage has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def DonePackage(error, reason)
                              # remove invalid characters (bnc#876459)
                              if !reason.valid_encoding?
                                reason.encode!("UTF-16", undef: :replace, invalid: :replace, replace: "?")
                                reason.encode!("UTF-8")
                        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

                        Method FlattenServices has 191 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def FlattenServices(old_list, protocol)
                              old_list = deep_copy(old_list)
                              if !Builtins.contains(["TCP", "UDP"], protocol)
                                message = Builtins.sformat(
                                  "Protocol %1 doesn't support port ranges, skipping...",
                        Severity: Major
                        Found in library/network/src/modules/PortRanges.rb - About 7 hrs to fix

                          Method AddWizardSteps has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def AddWizardSteps(stagemode)
                                stagemode = deep_copy(stagemode)
                                debug_workflow = ProductFeatures.GetBooleanFeature(
                                  "globals",
                                  "debug_workflow"
                          Severity: Minor
                          Found in library/control/src/modules/ProductControl.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

                          File SuSEFirewallProposal.rb has 481 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

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

                            Class SlideShowClass has 53 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                              class SlideShowClass < Module
                                include Yast::Logger
                            
                                def main
                                  Yast.import "UI"
                            Severity: Major
                            Found in library/packages/src/modules/SlideShow.rb - About 7 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language