yast/yast-yast2

View on GitHub
library/general/src/modules/ValueBrowser.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Method BrowseTreeHelper has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def BrowseTreeHelper(variable, indent)
      variable = deep_copy(variable)
      simple = FormatSimpleType(variable, indent)

      return Item(simple) unless simple.nil?
Severity: Minor
Found in library/general/src/modules/ValueBrowser.rb - About 1 hr to fix

    Method FormatSimpleType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def FormatSimpleType(variable, indent)
          variable = deep_copy(variable)
          if Ops.is_void?(variable)
            Builtins.sformat("%2%1 (void)", variable, indent)
          elsif Ops.is_boolean?(variable)
    Severity: Minor
    Found in library/general/src/modules/ValueBrowser.rb - About 1 hr to fix

      Method DebugBrowseHelper has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def DebugBrowseHelper(variable, indent)
            variable = deep_copy(variable)
            simple = FormatSimpleType(variable, indent)
            if !simple.nil?
              Builtins.y2debug("%1", simple)
      Severity: Minor
      Found in library/general/src/modules/ValueBrowser.rb - About 1 hr to fix

        Method BrowseTreeHelper has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def BrowseTreeHelper(variable, indent)
              variable = deep_copy(variable)
              simple = FormatSimpleType(variable, indent)
        
              return Item(simple) unless simple.nil?
        Severity: Minor
        Found in library/general/src/modules/ValueBrowser.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 DebugBrowseHelper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def DebugBrowseHelper(variable, indent)
              variable = deep_copy(variable)
              simple = FormatSimpleType(variable, indent)
              if !simple.nil?
                Builtins.y2debug("%1", simple)
        Severity: Minor
        Found in library/general/src/modules/ValueBrowser.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 FormatSimpleType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def FormatSimpleType(variable, indent)
              variable = deep_copy(variable)
              if Ops.is_void?(variable)
                Builtins.sformat("%2%1 (void)", variable, indent)
              elsif Ops.is_boolean?(variable)
        Severity: Minor
        Found in library/general/src/modules/ValueBrowser.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

        There are no issues that match your filters.

        Category
        Status