yast/yast-installation

View on GitHub
src/lib/installation/clients/inst_complex_welcome.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Method handle_dialog_result has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

      def handle_dialog_result(value)
        case value
        when :abort
          return :abort if Yast::Popup.ConfirmAbort(:painless)

Severity: Minor
Found in src/lib/installation/clients/inst_complex_welcome.rb - About 2 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def main
        if FileUtils.Exists(BETA_FILE) && !GetInstArgs.going_back
          InstShowInfo.show_info_txt(BETA_FILE)
        end

Severity: Minor
Found in src/lib/installation/clients/inst_complex_welcome.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 product_selection_finished? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def product_selection_finished?
        if selected_product.nil?
          return true if products.size <= 1 && !allow_single_product_selection?

          Yast::Popup.Error(_("Please select a product to install."))
Severity: Minor
Found in src/lib/installation/clients/inst_complex_welcome.rb - About 35 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 products has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def products
        return @products if @products

        @products = Array(Y2Packager::ProductSpec.forced_base_product || available_base_products)
        @products = [] if Mode.update && @products.size > 1
Severity: Minor
Found in src/lib/installation/clients/inst_complex_welcome.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 preselect_product_if_needed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def preselect_product_if_needed
        return if Mode.update || products.size != 1

        # As selecting a product can have side effects (especially in the full
        # medium), do not select it twice.
Severity: Minor
Found in src/lib/installation/clients/inst_complex_welcome.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

There are no issues that match your filters.

Category
Status