robertgauld/snmp_table_viewer

View on GitHub
lib/snmp_table_viewer/fetcher.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method has too many lines. [32/10]
Open

    def self.from_array(data_in)
      data_out = Array.new
      regexp_general = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+([A-Za-z0-9 \-]+):\s+(.+)\Z/)
      regexp_nodata = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+""\Z/)
      data_in.each.with_index do |line, index|
Severity: Minor
Found in lib/snmp_table_viewer/fetcher.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for from_array is too high. [36.36/15]
Open

    def self.from_array(data_in)
      data_out = Array.new
      regexp_general = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+([A-Za-z0-9 \-]+):\s+(.+)\Z/)
      regexp_nodata = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+""\Z/)
      data_in.each.with_index do |line, index|
Severity: Minor
Found in lib/snmp_table_viewer/fetcher.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Cyclomatic complexity for from_array is too high. [10/6]
Open

    def self.from_array(data_in)
      data_out = Array.new
      regexp_general = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+([A-Za-z0-9 \-]+):\s+(.+)\Z/)
      regexp_nodata = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+""\Z/)
      data_in.each.with_index do |line, index|
Severity: Minor
Found in lib/snmp_table_viewer/fetcher.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method from_array has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def self.from_array(data_in)
      data_out = Array.new
      regexp_general = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+([A-Za-z0-9 \-]+):\s+(.+)\Z/)
      regexp_nodata = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+""\Z/)
      data_in.each.with_index do |line, index|
Severity: Minor
Found in lib/snmp_table_viewer/fetcher.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 from_array has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def self.from_array(data_in)
      data_out = Array.new
      regexp_general = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+([A-Za-z0-9 \-]+):\s+(.+)\Z/)
      regexp_nodata = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+""\Z/)
      data_in.each.with_index do |line, index|
Severity: Minor
Found in lib/snmp_table_viewer/fetcher.rb - About 1 hr to fix

    Block has too many lines. [26/25]
    Open

          data_in.each.with_index do |line, index|
            # Try to get a match on the various valid frmats of line
            match = line.match(regexp_general)
            match ||= line.match(regexp_nodata)
            if match.nil?
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Trailing whitespace detected.
    Open

            
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Use array literal [] instead of Array.new.
    Open

          data = Array.new
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

    Example:

    # bad
    a = Array.new
    h = Hash.new
    s = String.new
    
    # good
    a = []
    h = {}
    s = ''

    Use array literal [] instead of Array.new.
    Open

          data_out = Array.new
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

    Example:

    # bad
    a = Array.new
    h = Hash.new
    s = String.new
    
    # good
    a = []
    h = {}
    s = ''

    Avoid when branches without a body.
    Open

              when nil
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for the presence of when branches without a body.

    Example:

    # bad
    
    case foo
    when bar then 1
    when baz then # nothing
    end

    Example:

    # good
    
    case foo
    when bar then 1
    when baz then 2
    end

    Line is too long. [89/80]
    Open

          regexp_nodata = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+""\Z/)
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Indent when as deep as case.
    Open

              when nil
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

    It will register a separate offense for each misaligned when.

    Example:

    # If Layout/EndAlignment is set to keyword style (default)
    # *case* and *end* should always be aligned to same depth,
    # and therefore *when* should always be aligned to both -
    # regardless of configuration.
    
    # bad for all styles
    case n
      when 0
        x * 2
      else
        y / 3
    end
    
    # good for all styles
    case n
    when 0
      x * 2
    else
      y / 3
    end

    Example: EnforcedStyle: case (default)

    # if EndAlignment is set to other style such as
    # start_of_line (as shown below), then *when* alignment
    # configuration does have an effect.
    
    # bad
    a = case n
    when 0
      x * 2
    else
      y / 3
    end
    
    # good
    a = case n
        when 0
          x * 2
        else
          y / 3
    end

    Example: EnforcedStyle: end

    # bad
    a = case n
        when 0
          x * 2
        else
          y / 3
    end
    
    # good
    a = case n
    when 0
      x * 2
    else
      y / 3
    end

    Avoid when branches without a body.
    Open

              when 'oid', 'hex-string'
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for the presence of when branches without a body.

    Example:

    # bad
    
    case foo
    when bar then 1
    when baz then # nothing
    end

    Example:

    # good
    
    case foo
    when bar then 1
    when baz then 2
    end

    Indent when as deep as case.
    Open

              when 'oid', 'hex-string'
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

    It will register a separate offense for each misaligned when.

    Example:

    # If Layout/EndAlignment is set to keyword style (default)
    # *case* and *end* should always be aligned to same depth,
    # and therefore *when* should always be aligned to both -
    # regardless of configuration.
    
    # bad for all styles
    case n
      when 0
        x * 2
      else
        y / 3
    end
    
    # good for all styles
    case n
    when 0
      x * 2
    else
      y / 3
    end

    Example: EnforcedStyle: case (default)

    # if EndAlignment is set to other style such as
    # start_of_line (as shown below), then *when* alignment
    # configuration does have an effect.
    
    # bad
    a = case n
    when 0
      x * 2
    else
      y / 3
    end
    
    # good
    a = case n
        when 0
          x * 2
        else
          y / 3
    end

    Example: EnforcedStyle: end

    # bad
    a = case n
        when 0
          x * 2
        else
          y / 3
    end
    
    # good
    a = case n
    when 0
      x * 2
    else
      y / 3
    end

    Surrounding space missing for operator +.
    Open

                STDERR.puts "Unknown SNMP type (#{type}) on line #{index+1}: #{line}"
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Checks that operators have space around them, except for ** which should not have surrounding space.

    Example:

    # bad
    total = 3*4
    "apple"+"juice"
    my_number = 38/4
    a ** b
    
    # good
    total = 3 * 4
    "apple" + "juice"
    my_number = 38 / 4
    a**b

    Space missing inside }.
    Open

              col, row = oid.split('.')[-2..-1].map{ |i| i.to_i - 1}
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that block braces have
    # surrounding space.
    
    # bad
    some_array.each {puts e}
    
    # good
    some_array.each { puts e }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that block braces don't
    # have surrounding space.
    
    # bad
    some_array.each { puts e }
    
    # good
    some_array.each {puts e}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # block braces don't have a space in between when empty.
    
    # bad
    some_array.each {   }
    some_array.each {  }
    some_array.each { }
    
    # good
    some_array.each {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # block braces have at least a spece in between when empty.
    
    # bad
    some_array.each {}
    
    # good
    some_array.each { }
    some_array.each {  }
    some_array.each {   }

    Example: SpaceBeforeBlockParameters: true (default)

    # The SpaceBeforeBlockParameters style set to `true` enforces that
    # there is a space between `{` and `|`. Overrides `EnforcedStyle`
    # if there is a conflict.
    
    # bad
    [1, 2, 3].each {|n| n * 2 }
    
    # good
    [1, 2, 3].each { |n| n * 2 }

    Example: SpaceBeforeBlockParameters: true

    # The SpaceBeforeBlockParameters style set to `false` enforces that
    # there is no space between `{` and `|`. Overrides `EnforcedStyle`
    # if there is a conflict.
    
    # bad
    [1, 2, 3].each { |n| n * 2 }
    
    # good
    [1, 2, 3].each {|n| n * 2 }

    Extra empty line detected at module body beginning.
    Open

    
      # Class to fetch the information from an SNMP host.
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cops checks if empty lines around the bodies of modules match the configuration.

    Example: EnforcedStyle: empty_lines

    # good
    
    module Foo
    
      def bar
        # ...
      end
    
    end

    Example: EnforcedStyle: emptylinesexcept_namespace

    # good
    
    module Foo
      module Bar
    
        # ...
    
      end
    end

    Example: EnforcedStyle: emptylinesspecial

    # good
    module Foo
    
      def bar; end
    
    end

    Example: EnforcedStyle: noemptylines (default)

    # good
    
    module Foo
      def bar
        # ...
      end
    end

    Line is too long. [125/80]
    Open

        # @return [Array<Array<#to_s>>] A two dimensional array containing objects in each cell (at 'address' data\[row\]\[col\])
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Indent when as deep as case.
    Open

              when 'timeticks'
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

    It will register a separate offense for each misaligned when.

    Example:

    # If Layout/EndAlignment is set to keyword style (default)
    # *case* and *end* should always be aligned to same depth,
    # and therefore *when* should always be aligned to both -
    # regardless of configuration.
    
    # bad for all styles
    case n
      when 0
        x * 2
      else
        y / 3
    end
    
    # good for all styles
    case n
    when 0
      x * 2
    else
      y / 3
    end

    Example: EnforcedStyle: case (default)

    # if EndAlignment is set to other style such as
    # start_of_line (as shown below), then *when* alignment
    # configuration does have an effect.
    
    # bad
    a = case n
    when 0
      x * 2
    else
      y / 3
    end
    
    # good
    a = case n
        when 0
          x * 2
        else
          y / 3
    end

    Example: EnforcedStyle: end

    # bad
    a = case n
        when 0
          x * 2
        else
          y / 3
    end
    
    # good
    a = case n
    when 0
      x * 2
    else
      y / 3
    end

    Extra empty line detected at module body end.
    Open

    
    end # module SNMPTableViewer
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cops checks if empty lines around the bodies of modules match the configuration.

    Example: EnforcedStyle: empty_lines

    # good
    
    module Foo
    
      def bar
        # ...
      end
    
    end

    Example: EnforcedStyle: emptylinesexcept_namespace

    # good
    
    module Foo
      module Bar
    
        # ...
    
      end
    end

    Example: EnforcedStyle: emptylinesspecial

    # good
    module Foo
    
      def bar; end
    
    end

    Example: EnforcedStyle: noemptylines (default)

    # good
    
    module Foo
      def bar
        # ...
      end
    end

    Surrounding space missing for operator +.
    Open

              STDERR.puts "Could not parse data on line #{index+1}: #{line}"
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Checks that operators have space around them, except for ** which should not have surrounding space.

    Example:

    # bad
    total = 3*4
    "apple"+"juice"
    my_number = 38/4
    a ** b
    
    # good
    total = 3 * 4
    "apple" + "juice"
    my_number = 38 / 4
    a**b

    Do not place comments on the same line as the end keyword.
    Open

      end # class Fetcher
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for comments put on the same line as some keywords. These keywords are: begin, class, def, end, module.

    Note that some comments (such as :nodoc: and rubocop:disable) are allowed.

    Example:

    # bad
    if condition
      statement
    end # end if
    
    # bad
    class X # comment
      statement
    end
    
    # bad
    def x; end # comment
    
    # good
    if condition
      statement
    end
    
    # good
    class X # :nodoc:
      y
    end

    Space missing to the left of {.
    Open

              col, row = oid.split('.')[-2..-1].map{ |i| i.to_i - 1}
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Checks that block braces have or don't have a space before the opening brace depending on configuration.

    Example:

    # bad
    foo.map{ |a|
      a.bar.to_s
    }
    
    # good
    foo.map { |a|
      a.bar.to_s
    }

    Line is too long. [95/80]
    Open

        #   Each String of the format returned by the snmpwalk command ("<oid> = <type>: <value>").
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Line is too long. [125/80]
    Open

        # @return [Array<Array<#to_s>>] A two dimensional array containing objects in each cell (at 'address' data\[row\]\[col\])
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Line is too long. [88/80]
    Open

              when 'integer', 'integer32', 'uinteger32', 'gauge32', 'counter32', 'counter64'
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Line is too long. [81/80]
    Open

                STDERR.puts "Unknown SNMP type (#{type}) on line #{index+1}: #{line}"
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Indent when as deep as case.
    Open

              when 'ipaddress'
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

    It will register a separate offense for each misaligned when.

    Example:

    # If Layout/EndAlignment is set to keyword style (default)
    # *case* and *end* should always be aligned to same depth,
    # and therefore *when* should always be aligned to both -
    # regardless of configuration.
    
    # bad for all styles
    case n
      when 0
        x * 2
      else
        y / 3
    end
    
    # good for all styles
    case n
    when 0
      x * 2
    else
      y / 3
    end

    Example: EnforcedStyle: case (default)

    # if EndAlignment is set to other style such as
    # start_of_line (as shown below), then *when* alignment
    # configuration does have an effect.
    
    # bad
    a = case n
    when 0
      x * 2
    else
      y / 3
    end
    
    # good
    a = case n
        when 0
          x * 2
        else
          y / 3
    end

    Example: EnforcedStyle: end

    # bad
    a = case n
        when 0
          x * 2
        else
          y / 3
    end
    
    # good
    a = case n
    when 0
      x * 2
    else
      y / 3
    end

    Extra empty line detected at class body end.
    Open

    
      end # class Fetcher
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cops checks if empty lines around the bodies of classes match the configuration.

    Example: EnforcedStyle: empty_lines

    # good
    
    class Foo
    
      def bar
        # ...
      end
    
    end

    Example: EnforcedStyle: emptylinesexcept_namespace

    # good
    
    class Foo
      class Bar
    
        # ...
    
      end
    end

    Example: EnforcedStyle: emptylinesspecial

    # good
    class Foo
    
      def bar; end
    
    end

    Example: EnforcedStyle: noemptylines (default)

    # good
    
    class Foo
      def bar
        # ...
      end
    end

    Indent when as deep as case.
    Open

              when 'integer', 'integer32', 'uinteger32', 'gauge32', 'counter32', 'counter64'
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

    It will register a separate offense for each misaligned when.

    Example:

    # If Layout/EndAlignment is set to keyword style (default)
    # *case* and *end* should always be aligned to same depth,
    # and therefore *when* should always be aligned to both -
    # regardless of configuration.
    
    # bad for all styles
    case n
      when 0
        x * 2
      else
        y / 3
    end
    
    # good for all styles
    case n
    when 0
      x * 2
    else
      y / 3
    end

    Example: EnforcedStyle: case (default)

    # if EndAlignment is set to other style such as
    # start_of_line (as shown below), then *when* alignment
    # configuration does have an effect.
    
    # bad
    a = case n
    when 0
      x * 2
    else
      y / 3
    end
    
    # good
    a = case n
        when 0
          x * 2
        else
          y / 3
    end

    Example: EnforcedStyle: end

    # bad
    a = case n
        when 0
          x * 2
        else
          y / 3
    end
    
    # good
    a = case n
    when 0
      x * 2
    else
      y / 3
    end

    Trailing whitespace detected.
    Open

            data_out[row] ||= Array.new        
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Use array literal [] instead of Array.new.
    Open

              data[row] ||= Array.new
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

    Example:

    # bad
    a = Array.new
    h = Hash.new
    s = String.new
    
    # good
    a = []
    h = {}
    s = ''

    Line is too long. [113/80]
    Open

          regexp_general = Regexp.compile(/\A(?:iso)?[\.0-9]+\.([0-9]+)\.([0-9]+)\s+=\s+([A-Za-z0-9 \-]+):\s+(.+)\Z/)
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    Do not place comments on the same line as the end keyword.
    Open

          end # each line of data_in
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for comments put on the same line as some keywords. These keywords are: begin, class, def, end, module.

    Note that some comments (such as :nodoc: and rubocop:disable) are allowed.

    Example:

    # bad
    if condition
      statement
    end # end if
    
    # bad
    class X # comment
      statement
    end
    
    # bad
    def x; end # comment
    
    # good
    if condition
      statement
    end
    
    # good
    class X # :nodoc:
      y
    end

    Do not place comments on the same line as the end keyword.
    Open

    end # module SNMPTableViewer
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for comments put on the same line as some keywords. These keywords are: begin, class, def, end, module.

    Note that some comments (such as :nodoc: and rubocop:disable) are allowed.

    Example:

    # bad
    if condition
      statement
    end # end if
    
    # bad
    class X # comment
      statement
    end
    
    # bad
    def x; end # comment
    
    # good
    if condition
      statement
    end
    
    # good
    class X # :nodoc:
      y
    end

    Use array literal [] instead of Array.new.
    Open

            data_out[row] ||= Array.new        
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

    Example:

    # bad
    a = Array.new
    h = Hash.new
    s = String.new
    
    # good
    a = []
    h = {}
    s = ''

    Indent when as deep as case.
    Open

              when 'string'
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

    It will register a separate offense for each misaligned when.

    Example:

    # If Layout/EndAlignment is set to keyword style (default)
    # *case* and *end* should always be aligned to same depth,
    # and therefore *when* should always be aligned to both -
    # regardless of configuration.
    
    # bad for all styles
    case n
      when 0
        x * 2
      else
        y / 3
    end
    
    # good for all styles
    case n
    when 0
      x * 2
    else
      y / 3
    end

    Example: EnforcedStyle: case (default)

    # if EndAlignment is set to other style such as
    # start_of_line (as shown below), then *when* alignment
    # configuration does have an effect.
    
    # bad
    a = case n
    when 0
      x * 2
    else
      y / 3
    end
    
    # good
    a = case n
        when 0
          x * 2
        else
          y / 3
    end

    Example: EnforcedStyle: end

    # bad
    a = case n
        when 0
          x * 2
        else
          y / 3
    end
    
    # good
    a = case n
    when 0
      x * 2
    else
      y / 3
    end

    Extra empty line detected at class body beginning.
    Open

    
        # Fetch the data using SNMP.
    Severity: Minor
    Found in lib/snmp_table_viewer/fetcher.rb by rubocop

    This cops checks if empty lines around the bodies of classes match the configuration.

    Example: EnforcedStyle: empty_lines

    # good
    
    class Foo
    
      def bar
        # ...
      end
    
    end

    Example: EnforcedStyle: emptylinesexcept_namespace

    # good
    
    class Foo
      class Bar
    
        # ...
    
      end
    end

    Example: EnforcedStyle: emptylinesspecial

    # good
    class Foo
    
      def bar; end
    
    end

    Example: EnforcedStyle: noemptylines (default)

    # good
    
    class Foo
      def bar
        # ...
      end
    end

    There are no issues that match your filters.

    Category
    Status