yast/yast-installation

View on GitHub
src/lib/installation/proposal_runner.rb

Summary

Maintainability
F
4 days
Test Coverage

File proposal_runner.rb has 579 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "yast"

require "installation/proposal_store"
require "installation/proposal_errors"
require "ui/text_helpers"
Severity: Major
Found in src/lib/installation/proposal_runner.rb - About 1 day to fix

    Method input_loop has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        def input_loop
          loop do
            richtext_normal_cursor(Id(:proposal))
    
            # bnc #431567
    Severity: Minor
    Found in src/lib/installation/proposal_runner.rb - About 4 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 make_proposal has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def make_proposal(force_reset, language_changed)
          tab_to_switch = 999
          current_tab_affected = false
          @have_blocker = false
    
    
    Severity: Minor
    Found in src/lib/installation/proposal_runner.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

    Class ProposalRunner has 27 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class ProposalRunner
        include Yast::I18n
        include Yast::UIShortcuts
        include Yast::Logger
        include ::UI::TextHelpers
    Severity: Minor
    Found in src/lib/installation/proposal_runner.rb - About 3 hrs to fix

      Method run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def run
            if Yast::Mode.auto
              # Checking if second stage is needed and the environment has been setup.
              second_stage_error = Yast::AutoinstFunctions.check_second_stage_environment
      
      
      Severity: Minor
      Found in src/lib/installation/proposal_runner.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 submod_descriptions_and_build_menu has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def submod_descriptions_and_build_menu
            return true unless Yast::UI.TextMode # have menu only in text mode
      
            # now build the menu button
            menu_list = @submodules_presentation.each_with_object([]) do |submod, menu|
      Severity: Minor
      Found in src/lib/installation/proposal_runner.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 pre_continue_handling has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def pre_continue_handling
            @skip = if Yast::UI.WidgetExists(Id(:skip))
              val = Yast::UI.QueryWidget(Id(:skip), :Value)
              log.info "there is :skip widget with value #{val.inspect}."
              val
      Severity: Minor
      Found in src/lib/installation/proposal_runner.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 build_dialog has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def build_dialog
            headline = @store.headline
            change_point = Empty()
      
            if Yast::UI.TextMode()
      Severity: Minor
      Found in src/lib/installation/proposal_runner.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 submod_ask_user has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def submod_ask_user(input)
            # Call the AskUser() function
            ask_user_result = @store.handle_link(input)
      
            # read-only proposal
      Severity: Minor
      Found in src/lib/installation/proposal_runner.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 write_settings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def write_settings
            success = true
      
            log.info "Writting settings for proposal"
      
      
      Severity: Minor
      Found in src/lib/installation/proposal_runner.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 load_matching_submodules_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def load_matching_submodules_list
            Yast::Builtins.y2milestone(
              "getting proposals for stage: \"%1\" mode: \"%2\" proposal type: \"%3\"",
              Yast::Stage.stage,
              Yast::Mode.mode,
      Severity: Minor
      Found in src/lib/installation/proposal_runner.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

      Avoid too many return statements within this method.
      Open

                return :back
      Severity: Major
      Found in src/lib/installation/proposal_runner.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return :next
        Severity: Major
        Found in src/lib/installation/proposal_runner.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                    return :abort if Yast::Popup.ConfirmAbort(abort_mode)
          Severity: Major
          Found in src/lib/installation/proposal_runner.rb - About 30 mins to fix

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

                def format_sub_proposal(prop)
                  html = ""
                  warning = prop["warning"] || ""
            
                  if !warning.empty?
            Severity: Minor
            Found in src/lib/installation/proposal_runner.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