yast/yast-installation

View on GitHub

Showing 173 of 173 total issues

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        if WFM.Execute(path(".local.bash"), copyCmd) == 0
          @GET_error = ""
          ok = true
        else
          # autoyast tried to copy a file via NFS which failed
Severity: Minor
Found in src/lib/transfer/file_from_url.rb and 1 other location - About 40 mins to fix
src/lib/transfer/file_from_url.rb on lines 376..387

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        if WFM.Execute(path(".local.bash"), copyCmd) == 0
          @GET_error = ""
          ok = true
        else
          # autoyast tried to copy a file via NFS which failed
Severity: Minor
Found in src/lib/transfer/file_from_url.rb and 1 other location - About 40 mins to fix
src/lib/transfer/file_from_url.rb on lines 420..431

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method propose has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def propose
      return if @proposal_done

      @proposal_done = true
      log.info("Making security settings proposal")
Severity: Minor
Found in src/lib/installation/security_settings.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 write has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def write
      snapper_config

      skip_reason = nil
      skip_reason = "no second stage" if InstFunctions.second_stage_required?
Severity: Minor
Found in src/lib/installation/snapshots_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

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 main has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def main
      textdomain "installation"

      Yast.import "ProductControl"
      Yast.import "ProductFeatures"
Severity: Minor
Found in src/lib/installation/clients/inst_features.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 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

Method description_for has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def description_for(client)
      @descriptions ||= {}
      return @descriptions[client] if @descriptions.key?(client)

      description = Yast::WFM.CallFunction(client, ["Description", {}])
Severity: Minor
Found in src/lib/installation/proposal_store.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 extension_packages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def extension_packages
        product = Y2Packager::Product.selected_base
        extension_packages = Yast::Pkg.PkgQueryProvides(PROVIDES_KEY)
        log.info "module extension packages #{extension_packages.inspect}"
        dependencies = {}
Severity: Minor
Found in src/lib/installation/clients/inst_modules_extensions.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 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 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

Method read_only_proposals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def read_only_proposals
      return @read_only_proposals if @read_only_proposals

      @read_only_proposals = { hard: [], soft: [] }

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

    def run
      textdomain "installation"

      # We do not need to create a wizard dialog in installation, but it's
      # helpful when testing all manually on a running system
Severity: Minor
Found in src/lib/installation/dialogs/desktop_roles.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 add_repo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def add_repo
      return @repo_id unless @repo_id.nil?

      status = repo_status
      raise NotValidRepo if status == :not_found
Severity: Minor
Found in src/lib/installation/update_repository.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 false
Severity: Major
Found in src/lib/installation/clients/yast_inf_finish.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

      Avoid too many return statements within this method.
      Open

                return false
      Severity: Major
      Found in src/lib/transfer/file_from_url.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return false
        Severity: Major
        Found in src/lib/installation/clients/yast_inf_finish.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return :abort if !skip_software && !@packager_initialized
          Severity: Major
          Found in src/lib/installation/clients/inst_system_analysis.rb - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language