yast/yast-yast2

View on GitHub
library/control/src/modules/ProductFeatures.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method main has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def main
      textdomain "base"

      Yast.import "Misc"
      Yast.import "Mode"
Severity: Major
Found in library/control/src/modules/ProductFeatures.rb - About 2 hrs to fix

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

        def GetBooleanFeatureWithFallback(section, feature, fallback)
          value = GetFeature(section, feature)
          return fallback if value.nil?
          return value if Ops.is_boolean?(value)
    
    
    Severity: Minor
    Found in library/control/src/modules/ProductFeatures.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 Save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def Save
          InitFeatures(false)
          if Mode.update # in case of update old file has different format
            SCR.Execute(
              path(".target.bash"),
    Severity: Minor
    Found in library/control/src/modules/ProductFeatures.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