robertgauld/snmp_table_viewer

View on GitHub
bin/table-from-stdin

Summary

Maintainability
Test Coverage

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

def parse_command_line
  options = {
    SNMPTableViewer::Formatter::Table => {
      transpose: false,
    },
Severity: Minor
Found in bin/table-from-stdin 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 parse_command_line is too high. [27.22/15]
Open

def parse_command_line
  options = {
    SNMPTableViewer::Formatter::Table => {
      transpose: false,
    },
Severity: Minor
Found in bin/table-from-stdin 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

Extra empty line detected at block body end.
Open


  end # create parser
Severity: Minor
Found in bin/table-from-stdin by rubocop

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

Example: EnforcedStyle: empty_lines

# good

foo do |bar|

  # ...

end

Example: EnforcedStyle: noemptylines (default)

# good

foo do |bar|
  # ...
end

Avoid comma after the last item of a hash.
Open

    formatter: SNMPTableViewer::Formatter::Table,
Severity: Minor
Found in bin/table-from-stdin by rubocop

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

Extra blank line detected.
Open


    opts.separator "\nTable formatter options:"
Severity: Minor
Found in bin/table-from-stdin by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Line is too long. [136/80]
Open

    opts.on('--headings-for TYPE', String, "Use headings for this table type (#{SNMPTableViewer::HEADINGS_FOR.keys.join('|')}).") do |v|
Severity: Minor
Found in bin/table-from-stdin by rubocop

Line is too long. [99/80]
Open

    opts.on('--[no-]transpose-table', 'Transpose the output table (swap rows and columns).') do |v|
Severity: Minor
Found in bin/table-from-stdin by rubocop

Line is too long. [152/80]
Open

    opts.on('--converter CONVERTER', String, "A converter to run on the data before formatting (#{SNMPTableViewer::CONVERTERS.keys.join('|')}).") do |v|
Severity: Minor
Found in bin/table-from-stdin by rubocop

Extra blank line detected.
Open


options = parse_command_line
Severity: Minor
Found in bin/table-from-stdin by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    opts.banner = "Usage: table-from-stdin [options]"
Severity: Minor
Found in bin/table-from-stdin by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Trailing whitespace detected.
Open

  
Severity: Minor
Found in bin/table-from-stdin by rubocop

Line is too long. [99/80]
Open

    opts.on('--headings HEADINGS', Array, 'Headings to use in the table (e.g. "A, Bc, D").') do |v|
Severity: Minor
Found in bin/table-from-stdin by rubocop

Avoid comma after the last item of a hash.
Open

      transpose: false,
Severity: Minor
Found in bin/table-from-stdin by rubocop

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

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

  end # create parser
Severity: Minor
Found in bin/table-from-stdin 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

Line is too long. [138/80]
Open

    opts.on('--format FORMAT', String, "How to format the output (#{SNMPTableViewer::FORMATTERS.keys.join('|')}) (default table).") do |v|
Severity: Minor
Found in bin/table-from-stdin by rubocop

There are no issues that match your filters.

Category
Status