egonbraun/logmsg

View on GitHub
bin/logmsg

Summary

Maintainability
Test Coverage

Use meaningful heredoc delimiters.
Open

  EOF
Severity: Minor
Found in bin/logmsg by rubocop

This cop checks that your heredocs are using meaningful delimiters. By default it disallows END and EO*, and can be configured through blacklisting additional delimiters.

Example:

# good
<

Freeze mutable objects assigned to constants.
Open

DEFAULT_SEVERITY = 'info'
Severity: Minor
Found in bin/logmsg by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Use empty? instead of length < 1.
Open

if ARGV.length < 1
Severity: Minor
Found in bin/logmsg by rubocop

This cop checks for numeric comparisons that can be replaced by a predicate method, such as receiver.length == 0, receiver.length > 0, receiver.length != 0, receiver.length < 1 and receiver.size == 0 that can be replaced by receiver.empty? and !receiver.empty.

Example:

# bad
[1, 2, 3].length == 0
0 == "foobar".length
array.length < 1
{a: 1, b: 2}.length != 0
string.length > 0
hash.size > 0

# good
[1, 2, 3].empty?
"foobar".empty?
array.empty?
!{a: 1, b: 2}.empty?
!string.empty?
!hash.empty?

Use 2 spaces for indentation in a heredoc by using some library(e.g. ActiveSupport's String#strip_heredoc).
Open

logmsg [OPTIONS] ... MESSAGE

-h, --help:
   show this help message

Severity: Minor
Found in bin/logmsg by rubocop

This cops checks the indentation of the here document bodies. The bodies are indented one step. In Ruby 2.3 or newer, squiggly heredocs (<<~) should be used. If you use the older rubies, you should introduce some library to your project (e.g. ActiveSupport, Powerpack or Unindent). Note: When Metrics/LineLength's AllowHeredoc is false(not default), this cop does not add any offenses for long here documents to avoid Metrics/LineLength's offenses.

Example:

# bad
<

Freeze mutable objects assigned to constants.
Open

DEFAULT_NAMESPACE = 'logmsg_cli'
Severity: Minor
Found in bin/logmsg by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

There are no issues that match your filters.

Category
Status