yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method progress_start has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def progress_start(_id, _task, _in_percent, _is_alive, _min, _max, _val_raw, _val_percent)
Severity: Major
Found in library/packages/src/lib/packages/dummy_callbacks.rb - About 1 hr to fix

    Method GetDevTypeDescription has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetDevTypeDescription(type, longdescr)
          if Builtins.issubstring(type, "#")
            # Device type label
            # This is what used to be Virtual Interface (eth0:1).
            # In our data model, additional addresses for an interface
    Severity: Minor
    Found in library/network/src/modules/NetworkInterfaces.rb - About 55 mins 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 create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

          def create(snapshot_type, description, previous: nil, cleanup: nil, important: false)
            raise SnapperNotConfigured unless configured?
    
            cmd = format(CREATE_SNAPSHOT_CMD,
              root:          target_root.shellescape,
    Severity: Minor
    Found in library/system/src/lib/yast2/fs_snapshot.rb - About 55 mins 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 all has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

          def all
            raise SnapperNotConfigured unless configured?
    
            out = Yast::SCR.Execute(
              Yast::Path.new(".target.bash_output"),
    Severity: Minor
    Found in library/system/src/lib/yast2/fs_snapshot.rb - About 55 mins 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 List has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def List(devregex)
          ret = []
          if devregex == "" || devregex.nil?
            Builtins.maplist(@Devices) do |_t, d|
              Builtins.maplist(
    Severity: Minor
    Found in library/network/src/modules/NetworkInterfaces.rb - About 55 mins 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 Display has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def Display(parameters)
          parameters = deep_copy(parameters)
          @param = deep_copy(parameters)
    
          # menubutton
    Severity: Minor
    Found in library/log/src/modules/LogView.rb - About 55 mins 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 GetEthTypeFromSysfs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetEthTypeFromSysfs(dev)
          sys_dir_path = "/sys/class/net/#{dev}"
    
          if FileUtils.Exists("#{sys_dir_path}/wireless") ||
              FileUtils.Exists("#{sys_dir_path}/phy80211")
    Severity: Minor
    Found in library/network/src/modules/NetworkInterfaces.rb - About 55 mins 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 SubprogressType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def SubprogressType(type, max_value)
          return if !@visible || Mode.commandline
    
          Builtins.y2debug(
            "SubprogressType: type: %1, max_value: %2",
    Severity: Minor
    Found in library/wizard/src/modules/Progress.rb - About 55 mins 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 write_new_filenames has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def write_new_filenames
          result = []
    
          to_write = (available_filenames + [selected_filename]).uniq
    
    
    Severity: Minor
    Found in library/system/src/lib/yast2/clients/view_anymsg.rb - About 55 mins 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 GetLoggingSettings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetLoggingSettings(rule)
          ret_val = nil
    
          case rule
          when "ACCEPT"
    Severity: Minor
    Found in library/network/src/lib/network/susefirewall2.rb - About 55 mins 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 RemoveServiceSupportFromZone has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def RemoveServiceSupportFromZone(service, zone)
          Yast.import "SuSEFirewallServices" # lazy import due to circular dependencies
    
          needed = SuSEFirewallServices.GetNeededPortsAndProtocols(service)
          # unknown service
    Severity: Minor
    Found in library/network/src/lib/network/susefirewall2.rb - About 55 mins 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 find has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

          def find(product_name, content: nil)
            log.info "Searching for a license for product #{product_name}"
            return cache[product_name] if cache[product_name]
    
            fetcher = LicensesFetchers.for(product_name) unless content
    Severity: Minor
    Found in library/packages/src/lib/y2packager/license.rb - About 55 mins 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 UpdateServiceStatusWidget has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def UpdateServiceStatusWidget(widget)
          widget = deep_copy(widget)
          return if !UI.WidgetExists(Id("_cwm_service_status_rp"))
    
          if Mode.config
    Severity: Minor
    Found in library/cwm/src/modules/CWMServiceStart.rb - About 55 mins 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 StartPackage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def StartPackage(name, _location, _summary, installsize, is_delete)
          return if !@enable_asterix_package
    
          @_package_name = name
          @_package_size = installsize
    Severity: Minor
    Found in library/packages/src/modules/PackageCallbacks.rb - About 55 mins 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 method_missing has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def method_missing(method, *args)
          if instance_variable_defined?("@#{method}")
            raise ArgumentError, "Method #{method} does not accept arguments" unless args.empty?
    
            return instance_variable_get("@#{method}")
    Severity: Minor
    Found in library/packages/src/lib/y2packager/resolvable.rb - About 55 mins 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 AdjustButtons has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def AdjustButtons(next_, back, abort, _help)
          next_ = "" if next_.nil?
          back = "" if back.nil?
          abort = "" if abort.nil?
          if next_ == ""
    Severity: Minor
    Found in library/cwm/src/modules/CWM.rb - About 55 mins 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 PrepareWorkflows has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def PrepareWorkflows(workflows)
          workflows = deep_copy(workflows)
          new_workflows = []
    
          # Going through all workflows
    Severity: Minor
    Found in library/control/src/modules/WorkflowManager.rb - About 55 mins 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 TableRedraw has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def TableRedraw(descr, update_buttons)
          descr = deep_copy(descr)
          id_list = getIdList(descr)
          @previous_selected_item = Ops.get(id_list, 0) if @previous_selected_item.nil?
          entries = Builtins.maplist(id_list) do |opt_id|
    Severity: Minor
    Found in library/cwm/src/modules/TablePopup.rb - About 55 mins 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 PrepareProposals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def PrepareProposals(proposals)
          proposals = deep_copy(proposals)
          new_proposals = []
    
          # Going through all proposals
    Severity: Minor
    Found in library/control/src/modules/WorkflowManager.rb - About 55 mins 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 GetCachedWorkflowFilename has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetCachedWorkflowFilename(type, src_id, name = "")
          if ![:package, :addon].include?(type)
            Builtins.y2error("Unknown workflow type: %1", type)
            return nil
          end
    Severity: Minor
    Found in library/control/src/modules/WorkflowManager.rb - About 55 mins 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