yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Avoid deeply nested control flow statements.
Open

                  is_vnc_enabled = true if set_vnc_enabled_to == true
Severity: Major
Found in library/network/src/modules/SuSEFirewallProposal.rb - About 45 mins to fix

    Method Read has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def Read
          # Do not read it again and again
          # to avoid rewriting changes already made
          if @configuration_has_been_read
            Builtins.y2milestone(
    Severity: Minor
    Found in library/network/src/lib/network/susefirewall2.rb - About 45 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 GetAdditionalServices has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetAdditionalServices(protocol, zone)
          if !IsSupportedProtocol(protocol)
            Builtins.y2error("Unknown protocol '%1'", protocol)
            return nil
          end
    Severity: Minor
    Found in library/network/src/lib/network/susefirewall2.rb - About 45 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 UpdateGlobalProgress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def UpdateGlobalProgress(value, label)
          value ||= @total_progress_value
          label ||= @total_progress_label
    
          if UI.WidgetExists(:progressTotal)
    Severity: Minor
    Found in library/packages/src/modules/SlideShow.rb - About 45 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 GenericHandleInput has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenericHandleInput
          button = UI.PollInput
    
          # in case of cancel ask user if he really wants to quit installation
          if [:abort, :cancel].include?(button)
    Severity: Minor
    Found in library/packages/src/modules/SlideShow.rb - About 45 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 InstallKernel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def InstallKernel(kernel_modules)
          kernel_modules = deep_copy(kernel_modules)
          # this function may be responsible for the horrible startup time
          Builtins.y2milestone("want: %1", kernel_modules)
          if kernel_modules == []
    Severity: Minor
    Found in library/packages/src/modules/PackageSystem.rb - About 45 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 FormatPatchName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def FormatPatchName(patch_name, patch_version, patch_arch)
          patch_full_name = (!patch_name.nil? && patch_name != "") ? patch_name : ""
    
          if patch_full_name != ""
            if !patch_version.nil? && patch_version != ""
    Severity: Minor
    Found in library/packages/src/modules/PackageCallbacks.rb - About 45 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 ScriptProgress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def ScriptProgress(ping, output)
          Builtins.y2milestone("ScriptProgress: ping:%1, output: %2", ping, output)
    
          if @_script_popup
            if ping
    Severity: Minor
    Found in library/packages/src/modules/PackageCallbacks.rb - About 45 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 PrintInternal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def PrintInternal(string, newline)
          return if !Mode.commandline
    
          # avoid using of uninitialized value in .dev.tty perl agent
          if string.nil?
    Severity: Minor
    Found in library/commandline/src/modules/CommandLine.rb - About 45 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 checkDisabled has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def checkDisabled(mod)
          mod = deep_copy(mod)
          if mod.nil?
            Builtins.y2error("Unknown module %1", mod)
            return nil
    Severity: Minor
    Found in library/control/src/modules/ProductControl.rb - About 45 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

    Avoid deeply nested control flow statements.
    Open

                    @aborted = true if !@interactive
    Severity: Major
    Found in library/commandline/src/modules/CommandLine.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      @aborted = true if !@interactive
      Severity: Major
      Found in library/commandline/src/modules/CommandLine.rb - About 45 mins to fix

        Method RunRequired has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def RunRequired(stage, mode)
              modules = getModules(stage, mode, :enabled)
        
              if modules.nil?
                Builtins.y2error("Undefined %1/%2", stage, mode)
        Severity: Minor
        Found in library/control/src/modules/ProductControl.rb - About 45 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

        Avoid deeply nested control flow statements.
        Open

                        @aborted = true if !@interactive
        Severity: Major
        Found in library/commandline/src/modules/CommandLine.rb - About 45 mins to fix

          Method Handle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def Handle(_key, event)
                event = deep_copy(event)
                @last_event = deep_copy(event)
                current = Convert.to_string(UI.QueryWidget(Id(:_hw_items), :CurrentItem))
                if Ops.get(event, "ID") == :_hw_items
          Severity: Minor
          Found in library/cwm/src/modules/WizardHW.rb - About 45 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

          Avoid deeply nested control flow statements.
          Open

                        if Builtins.contains(present, opt_key)
                          Report.Error(
                            # error report
                            _("The selected option is already present.")
                          )
          Severity: Major
          Found in library/cwm/src/modules/TablePopup.rb - About 45 mins to fix

            Method find_ids has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def find_ids(term)
                  term.each_with_object([]) do |arg, res|
                    next unless arg.is_a? Yast::Term
            
                    if arg.value == :id
            Severity: Minor
            Found in library/cwm/src/lib/cwm/custom_widget.rb - About 45 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 RemoveWorkflow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def RemoveWorkflow(type, src_id, name)
                  Builtins.y2milestone(
                    "Removing Workflow:  Type %1, ID %2, Name %3",
                    type,
                    src_id,
            Severity: Minor
            Found in library/control/src/modules/WorkflowManager.rb - About 45 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

            Avoid deeply nested control flow statements.
            Open

                            @aborted = true if !@interactive
            Severity: Major
            Found in library/commandline/src/modules/CommandLine.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            return nil if opt_key.nil?
              Severity: Major
              Found in library/cwm/src/modules/TablePopup.rb - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language