yast/yast-yast2

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

Summary

Maintainability
D
2 days
Test Coverage

Class ArchClass has 46 methods (exceeds 20 allowed). Consider refactoring.
Open

  class ArchClass < Module
    def main
      # local variables

      @_architecture = nil
Severity: Minor
Found in library/general/src/modules/Arch.rb - About 6 hrs to fix

    Method board_compatible has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def board_compatible
          if @_board_compatible.nil?
            @_checkgeneration = ""
            systemProbe = Convert.convert(
              SCR.Read(path(".probe.system")),
    Severity: Minor
    Found in library/general/src/modules/Arch.rb - About 3 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

    File Arch.rb has 308 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "yast"
    
    module Yast
      # Representing architecture information yast have.
      #
    Severity: Minor
    Found in library/general/src/modules/Arch.rb - About 3 hrs to fix

      Method board_compatible has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def board_compatible
            if @_board_compatible.nil?
              @_checkgeneration = ""
              systemProbe = Convert.convert(
                SCR.Read(path(".probe.system")),
      Severity: Major
      Found in library/general/src/modules/Arch.rb - About 2 hrs to fix

        There are no issues that match your filters.

        Category
        Status