yast/yast-yast2

View on GitHub
library/packages/src/modules/SlideShow.rb

Summary

Maintainability
D
2 days
Test Coverage

Class SlideShowClass has 53 methods (exceeds 20 allowed). Consider refactoring.
Open

  class SlideShowClass < Module
    include Yast::Logger

    def main
      Yast.import "UI"
Severity: Major
Found in library/packages/src/modules/SlideShow.rb - About 7 hrs to fix

    File SlideShow.rb has 426 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "yast"
    require "yast2/system_time"
    
    module Yast
      class SlideShowClass < Module
    Severity: Minor
    Found in library/packages/src/modules/SlideShow.rb - About 6 hrs to fix

      Method Setup has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def Setup(stages)
            stages = deep_copy(stages)
            log.info "SlideShow stages: #{stages}"
            # initiliaze the generic counters
            Reset()
      Severity: Major
      Found in library/packages/src/modules/SlideShow.rb - About 2 hrs to fix

        Method Setup has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def Setup(stages)
              stages = deep_copy(stages)
              log.info "SlideShow stages: #{stages}"
              # initiliaze the generic counters
              Reset()
        Severity: Minor
        Found in library/packages/src/modules/SlideShow.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 UpdateGlobalProgress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def UpdateGlobalProgress(value, label)
              value ||= @total_progress_value
              label ||= @total_progress_label
        
              if UI.WidgetExists(:progressTotal)
        Severity: Minor
        Found in library/packages/src/modules/SlideShow.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 GenericHandleInput has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def GenericHandleInput
              button = UI.PollInput
        
              # in case of cancel ask user if he really wants to quit installation
              if [:abort, :cancel].include?(button)
        Severity: Minor
        Found in library/packages/src/modules/SlideShow.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 TableItem has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def TableItem(id, col1, col2, col3, col4)
        Severity: Minor
        Found in library/packages/src/modules/SlideShow.rb - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status