yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Avoid deeply nested control flow statements.
Open

              ret << str if !unique || !Builtins.contains(ret, str)
Severity: Major
Found in library/types/src/modules/String.rb - About 45 mins to fix

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

        def Replace(input, source, target)
          return nil if input.nil?
    
          if source.nil? || source == ""
            Builtins.y2warning("invalid parameter source: %1", source)
    Severity: Minor
    Found in library/types/src/modules/String.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

                  ret << str if !unique || !ret.include?(str)
    Severity: Major
    Found in library/types/src/modules/String.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  elsif character == "\\\""
                    str << "\""
                  else
                    str << character
      Severity: Major
      Found in library/types/src/modules/String.rb - About 45 mins to fix

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

            def FromString(string)
              return {} if string.nil?
        
              ret = {}
              Builtins.foreach(Builtins.splitstring(string, " ")) do |vals|
        Severity: Minor
        Found in library/types/src/modules/Map.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

                    elsif character == "\\\""
                      str << "\""
                    else
                      str << character
        Severity: Major
        Found in library/types/src/modules/String.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                        str = (character == "\\\"") ? "\"" : character
          Severity: Major
          Found in library/types/src/modules/String.rb - About 45 mins to fix

            Consider simplifying this complex logical expression.
            Open

                      if key != "label" ||
                          (Ops.get(v, "widget") != :radio_buttons &&
                              Ops.get(v, "widget") != :custom &&
                              Ops.get(v, "widget") != :rich_text &&
                              Ops.get(v, "widget") != :func)
            Severity: Major
            Found in library/cwm/src/modules/CWM.rb - About 40 mins to fix

              Method SetContentsButtons has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def SetContentsButtons(title, contents, help_text, back_label, next_label)
              Severity: Minor
              Found in library/wizard/src/modules/Wizard.rb - About 35 mins to fix

                Method SetContents has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def SetContents(title, contents, help_text, has_back, has_next)
                Severity: Minor
                Found in library/wizard/src/modules/Wizard.rb - About 35 mins to fix

                  Method TableItem has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def TableItem(id, col1, col2, col3, col4)
                  Severity: Minor
                  Found in library/packages/src/modules/SlideShow.rb - About 35 mins to fix

                    Method StartPackage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def StartPackage(name, _location, _summary, installsize, is_delete)
                    Severity: Minor
                    Found in library/packages/src/modules/PackageCallbacks.rb - About 35 mins to fix

                      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def initialize(successful, failed, remaining, srcremaining, update_messages)
                      Severity: Minor
                      Found in library/packages/src/lib/packages/commit_result.rb - About 35 mins to fix

                        Method start_package has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                              def start_package(_name, _location, _summary, _installsize, _is_delete)
                        Severity: Minor
                        Found in library/packages/src/lib/packages/dummy_callbacks.rb - About 35 mins to fix

                          Method source_report_end has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                def source_report_end(_src_id, _url, _task, _error, _description)
                          Severity: Minor
                          Found in library/packages/src/lib/packages/dummy_callbacks.rb - About 35 mins to fix

                            Method SourceReportEnd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def SourceReportEnd(src_id, url, task, error, description)
                            Severity: Minor
                            Found in library/packages/src/modules/PackageCallbacks.rb - About 35 mins to fix

                              Method ItemSignedWithUnknownSignature has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def ItemSignedWithUnknownSignature(item_type, item_name, key_id, dont_show_dialog_ident, repoid)
                              Severity: Minor
                              Found in library/packages/src/modules/SignatureCheckDialogs.rb - About 35 mins to fix

                                Method ReplaceWorkflowModule has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def ReplaceWorkflowModule(workflow, old, new, domain, keep)
                                Severity: Minor
                                Found in library/control/src/modules/WorkflowManager.rb - About 35 mins to fix

                                  Method ErrorAnyQuestion has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def ErrorAnyQuestion(headline, message, yes_button_message, no_button_message, focus)
                                  Severity: Minor
                                  Found in library/general/src/modules/Report.rb - About 35 mins to fix

                                    Method event_loop has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                          def event_loop(content, focus, timeout, details, style)
                                    Severity: Minor
                                    Found in library/general/src/lib/yast2/popup.rb - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language