yast/yast-registration

View on GitHub
src/lib/registration/clients/inst_scc.rb

Summary

Maintainability
C
1 day
Test Coverage

File inst_scc.rb has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "yast/suse_connect"

require "cgi"

require "registration/addon"
Severity: Minor
Found in src/lib/registration/clients/inst_scc.rb - About 2 hrs to fix

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

      class InstSccClient < Client
        include Yast::Logger
        extend Yast::I18n
    
        # popup message
    Severity: Minor
    Found in src/lib/registration/clients/inst_scc.rb - About 2 hrs to fix

      Method start_workflow has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def start_workflow
            sequence = {
              "ws_start"               => workflow_start,
              "check"                  => {
                auto:       :auto,
      Severity: Major
      Found in src/lib/registration/clients/inst_scc.rb - About 2 hrs to fix

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

            def registration_check
              # Go back if the user clicked 'back' in the registration dialog
              return :back if @back_from_register
        
              # check the base product at start to avoid problems later,
        Severity: Minor
        Found in src/lib/registration/clients/inst_scc.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 registration_check has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def registration_check
              # Go back if the user clicked 'back' in the registration dialog
              return :back if @back_from_register
        
              # check the base product at start to avoid problems later,
        Severity: Minor
        Found in src/lib/registration/clients/inst_scc.rb - About 1 hr to fix

          Avoid too many return statements within this method.
          Open

                return :cancel if init_registration == :cancel
          Severity: Major
          Found in src/lib/registration/clients/inst_scc.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return :abort unless success
            Severity: Major
            Found in src/lib/registration/clients/inst_scc.rb - About 30 mins to fix

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

                  def select_addons
                    log.group "Select add-ons" do |group|
                      # FIXME: available_addons is called just to fill cache with popup
                      return :cancel if get_available_addons == :cancel
              
              
              Severity: Minor
              Found in src/lib/registration/clients/inst_scc.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