yast/yast-installation

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

Summary

Maintainability
D
1 day
Test Coverage

File inst_finish.rb has 427 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "installation/minimal_installation"

require "shellwords"

Yast.import "UI"
Severity: Minor
Found in src/lib/installation/clients/inst_finish.rb - About 6 hrs to fix

    Class InstFinishClient has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class InstFinishClient < Client
        include Yast::Logger
    
        def main
          textdomain "installation"
    Severity: Minor
    Found in src/lib/installation/clients/inst_finish.rb - About 2 hrs to fix

      Method keep_only_valid_steps has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def keep_only_valid_steps(stage)
            steps = stage["steps"].map do |s|
              # some steps are called in live installer only
              next nil if s == "" || s.nil?
      
      
      Severity: Minor
      Found in src/lib/installation/clients/inst_finish.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 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def write
            stages.each_with_index do |stage, index|
              current_stage_percent = 100 * index / stages.size
              SlideShow.StageProgress(
                current_stage_percent,
      Severity: Minor
      Found in src/lib/installation/clients/inst_finish.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 report_messages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def report_messages
            return if Misc.boot_msg.empty?
            return if Mode.autoinst
      
            # --------------------------------------------------------------
      Severity: Minor
      Found in src/lib/installation/clients/inst_finish.rb - About 55 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 report_hooks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def report_hooks
            used_hooks = Hooks.all.select(&:used?)
            failed_hooks = used_hooks.select(&:failed?)
      
            if !failed_hooks.empty?
      Severity: Minor
      Found in src/lib/installation/clients/inst_finish.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 control_stages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def control_stages
            log.info "Using inst_finish steps definition from control file"
            stages = deep_copy(ProductControl.inst_finish)
      
            # Inst-finish need to be translated (#343783)
      Severity: Minor
      Found in src/lib/installation/clients/inst_finish.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

      There are no issues that match your filters.

      Category
      Status