yast/yast-yast2

View on GitHub

Showing 967 of 967 total issues

Method ParseOptions has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def ParseOptions(options, parameters)
      parameters ||= {}
      ret = []

      # parsing options
Severity: Major
Found in library/types/src/modules/String.rb - About 3 hrs to fix

    Method Command has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def Command
          # if we are done already, return the result
          return { "command" => @aborted ? "abort" : "exit" } if @done
    
          # there is a command in the cache
    Severity: Minor
    Found in library/commandline/src/modules/CommandLine.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 board_compatible has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def board_compatible
          if @_board_compatible.nil?
            @_checkgeneration = ""
            systemProbe = Convert.convert(
              SCR.Read(path(".probe.system")),
    Severity: Minor
    Found in library/general/src/modules/Arch.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 97 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/popups2.rb - About 3 hrs to fix

      File CWMTable.rb has 325 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Method ShowInstallationSummaryMap has 92 lines of code (exceeds 25 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: Major
        Found in library/packages/src/modules/PackagesUI.rb - About 3 hrs to fix

          Class KernelClass has 30 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class KernelClass < Module
              include Yast::Logger
          
              # default configuration file for Kernel modules loaded on boot
              MODULES_CONF_FILE = "yast.conf".freeze
          Severity: Minor
          Found in library/system/src/modules/Kernel.rb - About 3 hrs to fix

            Method ProbeKernel has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def ProbeKernel
                  kernel_desktop_exists = ((Mode.normal || Mode.repair) &&
                    Pkg.PkgInstalled("kernel-desktop")) ||
                    Pkg.PkgAvailable("kernel-desktop")
                  Builtins.y2milestone(
            Severity: Major
            Found in library/system/src/modules/Kernel.rb - About 3 hrs to fix

              Method Run has 90 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def Run(commandline)
                    commandline = deep_copy(commandline)
                    # The main ()
                    Builtins.y2milestone("----------------------------------------")
                    Builtins.y2milestone("Command line interface started")
              Severity: Major
              Found in library/commandline/src/modules/CommandLine.rb - About 3 hrs to fix

                Method CreateTableDescr has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def CreateTableDescr(attrib, widget_descr)
                      attrib = deep_copy(attrib)
                      widget_descr = deep_copy(widget_descr)
                      ValidateTableAttr(attrib)
                      add_button = if Ops.get_boolean(attrib, "add_delete_buttons", true)
                Severity: Major
                Found in library/cwm/src/modules/CWMTable.rb - About 3 hrs to fix

                  Method GetDevTypeDescription has 88 lines of code (exceeds 25 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: Major
                  Found in library/network/src/modules/NetworkInterfaces.rb - About 3 hrs to fix

                    Method CreateStartStopWidget has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def CreateStartStopWidget(settings)
                          settings = deep_copy(settings)
                    
                          start_now_button = Ops.get_locale(
                            settings,
                    Severity: Major
                    Found in library/cwm/src/modules/CWMServiceStart.rb - About 3 hrs to fix

                      Class PackageClass has 29 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class PackageClass < Module
                          extend Forwardable
                          include Yast::Logger
                      
                          def_delegators :backend, :Available, :PackageAvailable, :DoInstallAndRemove, :InstallKernel
                      Severity: Minor
                      Found in library/packages/src/modules/Package.rb - About 3 hrs to fix

                        Class CommandLineClass has 29 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class CommandLineClass < Module
                            include Yast::Logger
                        
                            def main
                              Yast.import "Directory"
                        Severity: Minor
                        Found in library/commandline/src/modules/CommandLine.rb - About 3 hrs to fix

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

                              def main
                                Yast.import "Directory"
                                Yast.import "Mode"
                                Yast.import "Popup"
                                Yast.import "Report"
                          Severity: Major
                          Found in library/commandline/src/modules/CommandLine.rb - About 3 hrs to fix

                            Method WS_check has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def WS_check(aliases, sequence)
                                  aliases = deep_copy(aliases)
                                  sequence = deep_copy(sequence)
                                  ret = []
                            
                            
                            Severity: Major
                            Found in library/sequencer/src/modules/Sequencer.rb - About 3 hrs to fix

                              Method ExtractCmdlineParameters has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def ExtractCmdlineParameters(line)
                                    return unless line
                              
                                    # list of parameters to be discarded (yast internals)
                                    cmdlist = list_of_params(line)
                              Severity: Minor
                              Found in library/system/src/modules/Kernel.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 ProcessTerm has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def ProcessTerm(term, widgets)
                                    return term if term.empty?
                              
                                    ret = Yast::Term.new(term.value)
                              
                              
                              Severity: Minor
                              Found in library/cwm/src/modules/CWM.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 Rich2Plain has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def Rich2Plain(richtext)
                                    Builtins.y2debug("richtext=%1", richtext)
                              
                                    lparts = Builtins.splitstring(DropWS(richtext), "<")
                                    Builtins.y2debug("lparts=%1", lparts)
                              Severity: Minor
                              Found in library/types/src/modules/RichText.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

                              File menu.rb has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              require "shellwords"
                              
                              module Yast
                                class MenuClient < Client
                                  def main
                              Severity: Minor
                              Found in library/desktop/src/clients/menu.rb - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language