yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method CheckAndCreatePath has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def CheckAndCreatePath(pathvalue)
      check_path = pathvalue

      # remove the final slash
      # but never the last one "/"
Severity: Minor
Found in library/general/src/modules/FileUtils.rb - About 1 hr to fix

    Method Stage has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def Stage(stage, title, step)
          return if !@visible
    
          Step(step) if -1 != step
    
    
    Severity: Minor
    Found in library/wizard/src/modules/Progress.rb - About 1 hr 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 SetContentsFocus has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def SetContentsFocus(title, contents, help_text, has_back, has_next, set_focus)
          contents = deep_copy(contents)
          if UI.WizardCommand(term(:SetDialogHeading, title)) == true
            UI.WizardCommand(term(:SetHelpText, help_text))
            UI.WizardCommand(term(:EnableNextButton, has_next))
    Severity: Minor
    Found in library/wizard/src/modules/Wizard.rb - About 1 hr 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 Start has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def Start(log)
          if (@type == "dsl" && @capi_adsl) || @type == "isdn"
            status = Service.Status("isdn")
            Builtins.y2milestone("We need ISDN service, status: %1", status)
            if status != 0 && !Service.Start("isdn")
    Severity: Minor
    Found in library/network/src/modules/Internet.rb - About 1 hr 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 RemovePortFromPortRanges has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def RemovePortFromPortRanges(port_number, port_ranges)
          port_ranges = deep_copy(port_ranges)
          # Checking necessarity of filtering and params
          return deep_copy(port_ranges) if port_ranges.nil? || port_ranges == []
          return deep_copy(port_ranges) if port_number.nil? || port_number == 0
    Severity: Minor
    Found in library/network/src/modules/PortRanges.rb - About 1 hr 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 sanitize_services_and_ports has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def sanitize_services_and_ports(allowed_services, protocol)
          services = []
          ports = []
          allowed_services.each do |s|
            Builtins.y2debug("Examining %1", s)
    Severity: Minor
    Found in library/network/src/lib/network/susefirewalld.rb - About 1 hr 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 ValidateMaps has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def ValidateMaps(widgets)
          widgets = deep_copy(widgets)
          ret = true
          Builtins.foreach(widgets) do |k, v|
            Builtins.foreach(v) do |kk, vv|
    Severity: Minor
    Found in library/cwm/src/modules/CWM.rb - About 1 hr 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 GetSlideList has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetSlideList(lang)
          slide_list = nil
    
          txt_path = Builtins.sformat("%1/txt/%2", @slide_base_path, lang)
          if FileUtils.Exists(txt_path)
    Severity: Minor
    Found in library/packages/src/modules/Slides.rb - About 1 hr 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 ProgressStart has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def ProgressStart(id, task, in_percent, is_alive, _min, _max, _val_raw, val_percent)
          Builtins.y2milestone("ProgressStart: %1", id)
    
          @tick_progress = is_alive
          @val_progress = !in_percent && !is_alive
    Severity: Minor
    Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr 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 PrintTable has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def PrintTable(header, content)
          header = deep_copy(header)
          content = deep_copy(content)
          aligns = []
          widths = []
    Severity: Minor
    Found in library/commandline/src/modules/CommandLine.rb - About 1 hr 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 UpdateProposals has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def UpdateProposals(proposals, prod_name, domain)
          proposals = deep_copy(proposals)
          Builtins.foreach(proposals) do |proposal|
            name = Ops.get_string(proposal, "name", "")
            stage = Ops.get_string(proposal, "stage", "")
    Severity: Minor
    Found in library/control/src/modules/WorkflowManager.rb - About 1 hr 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 PrintGeneralHelp has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def PrintGeneralHelp
          # display custom defined help instead of generic one
          if Builtins.haskey(@modulecommands, "customhelp")
            Print(Ops.get_string(@modulecommands, "customhelp", ""))
            return
    Severity: Minor
    Found in library/commandline/src/modules/CommandLine.rb - About 1 hr 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 CreateTableDescr has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def CreateTableDescr(attrib, widget_descr)
          attrib = deep_copy(attrib)
          widget_descr = deep_copy(widget_descr)
          ValidateTableAttr(attrib)
    
    
    Severity: Minor
    Found in library/cwm/src/modules/TablePopup.rb - About 1 hr 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 Run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def Run(settings)
          settings = deep_copy(settings)
          screens = Ops.get_map(settings, "screens", {})
          widget_descr = Ops.get_map(settings, "widget_descr", {})
          initial_screen = Ops.get_string(settings, "initial_screen", "")
    Severity: Minor
    Found in library/cwm/src/modules/DialogTree.rb - About 1 hr 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 TimedAnyQuestion has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def TimedAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds)
          button_box = AnyQuestionButtonBox(
            yes_button_message,
            no_button_message,
            focus
    Severity: Minor
    Found in library/general/src/modules/Popup.rb - About 1 hr 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 save_start_mode has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def save_start_mode
          return unless changed?(:start_mode)
    
          result =
            case changes[:start_mode]
    Severity: Minor
    Found in library/systemd/src/lib/yast2/system_service.rb - About 1 hr 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 Parse has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def Parse(url)
          Builtins.y2debug("url=%1", url)
    
          # We don't parse empty URLs
          return {} if url.nil? || Ops.less_than(Builtins.size(url), 1)
    Severity: Minor
    Found in library/types/src/modules/URL.rb - About 1 hr 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 reserved4 has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def reserved4(ip)
          raise "Invalid IP address passed '#{ip}'" unless Check4(ip)
    
          # RFC#1700
          return true if ip.start_with?("0.")
    Severity: Minor
    Found in library/types/src/modules/IP.rb - About 1 hr 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 47 lines of code (exceeds 25 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 1 hr to fix

      Method AddService has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def AddService(service, protocol, interface)
            Builtins.y2milestone(
              "Adding service %1, protocol %2 to %3",
              service,
              protocol,
      Severity: Minor
      Found in library/network/src/lib/network/susefirewall.rb - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language