yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method SaveLogs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def SaveLogs
      env_home = ENV["HOME"]

      homedir = if env_home && !env_home.empty?
        env_home
Severity: Minor
Found in library/control/src/modules/InstError.rb - About 25 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 NormalizeFilename has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def NormalizeFilename(filename)
      while filename != "" &&
          (Builtins.substring(filename, 0, 1) == " " ||
            Builtins.substring(filename, 0, 1) == "\"")
        filename = Builtins.substring(filename, 1)
Severity: Minor
Found in library/cwm/src/modules/CWMTsigKeys.rb - About 25 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 ReplaceWorkflowModule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def ReplaceWorkflowModule(workflow, old, new, domain, keep)
      workflow = deep_copy(workflow)
      new = deep_copy(new)
      found = false

Severity: Minor
Found in library/control/src/modules/WorkflowManager.rb - About 25 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 CheckAdditionalParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def CheckAdditionalParams(check_workflow)
      if @_additional_workflow_params.nil? ||
          @_additional_workflow_params == {}
        return true
      end
Severity: Minor
Found in library/control/src/modules/ProductControl.rb - About 25 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_tree_node has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def find_tree_node(pages)
      candidate_nodes.each.with_index do |candidate, idx|
        result = pages.find { |page| matches?(page, candidate) }
        if result
          # If we had to use one of the fallbacks, the tab name is not longer
Severity: Minor
Found in library/cwm/src/lib/cwm/ui_state.rb - About 25 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 IntegrateWorkflow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def IntegrateWorkflow(filename)
      Builtins.y2milestone("IntegrateWorkflow %1", filename)

      begin
        update_file = XML.XMLToYCPFile(filename)
Severity: Minor
Found in library/control/src/modules/WorkflowManager.rb - About 25 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 getClientName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def getClientName(name, execute)
      return "inst_test_workflow" if Mode.test

      # BNC #401319
      # 'execute; is defined and thus returned
Severity: Minor
Found in library/control/src/modules/ProductControl.rb - About 25 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 package_repository has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def package_repository(package_name)
      # Identify the installation repository with the package
      pkgs = Y2Packager::Resolvable.find(kind: :package, name: package_name)

      if pkgs.empty?
Severity: Minor
Found in library/control/src/modules/WorkflowManager.rb - About 25 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 CreateActionsButton has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def CreateActionsButton(actions)
      actions = deep_copy(actions)
      sz = Builtins.size(actions)
      return Empty() if sz == 0

Severity: Minor
Found in library/cwm/src/modules/WizardHW.rb - About 25 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 Save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def Save
      InitFeatures(false)
      if Mode.update # in case of update old file has different format
        SCR.Execute(
          path(".target.bash"),
Severity: Minor
Found in library/control/src/modules/ProductFeatures.rb - About 25 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 MkTempInternal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def MkTempInternal(template, usergroup, modes, directory)
      mktemp = Builtins.sformat(
        "/bin/mktemp %1 %2",
        directory ? "-d" : "",
        template.shellescape
Severity: Minor
Found in library/general/src/modules/FileUtils.rb - About 25 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 output has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def output
        return "" unless result

        output = []
        output << "STDERR: #{result.stderr.strip}" unless result.stderr.empty?
Severity: Minor
Found in library/general/src/modules/Hooks.rb - About 25 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 perform_reload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def perform_reload
      return perform_restart unless support_reload?

      result = true

Severity: Minor
Found in library/systemd/src/lib/yast2/system_service.rb - About 25 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 event_loop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def event_loop
      Yast.import "UI"
      @_finish_dialog_flag = false

      loop do
Severity: Minor
Found in library/general/src/lib/ui/event_dispatcher.rb - About 25 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 start_modes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def start_modes
      @start_modes = [:on_boot, :manual, :on_demand] unless found?
      return @start_modes if @start_modes

      @start_modes = [:manual]
Severity: Minor
Found in library/systemd/src/lib/yast2/system_service.rb - About 25 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 Transform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def Transform(old)
      s = Builtins.symbolof(old)

      handler = Greasemonkey.method(s) if @handlers.include?(s)
      return Transform(handler.call(old)) if !handler.nil?
Severity: Minor
Found in library/general/src/lib/ui/greasemonkey.rb - About 25 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 to_html has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def to_html
        fatal, non_fatal = issues_list.partition(&:fatal?)

        parts = []
        parts << error_text(fatal) unless fatal.empty?
Severity: Minor
Found in library/general/src/lib/installation/autoinst_issues/issues_presenter.rb - About 25 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 sockets_map has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def sockets_map
        return @sockets_map if @sockets_map

        result = Yast2::Systemctl.execute(show_triggers_cmd)
        return {} unless result.exit.zero?
Severity: Minor
Found in library/systemd/src/lib/yast2/systemd/socket_finder.rb - About 25 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 AnyQuestion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def AnyQuestion(headline, message, yes_button_message, no_button_message, focus)
      Builtins.y2milestone(1, "%1", message) if @log_yesno_messages

      focus = BACKWARD_MAPPING[focus] || focus
      ret = false
Severity: Minor
Found in library/general/src/modules/Report.rb - About 25 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 load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def load
      begin
        super
      rescue Errno::ENOENT # PATH does not exist yet
        self.data = @parser.empty
Severity: Minor
Found in library/general/src/lib/cfa/sysctl.rb - About 25 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