Ruby

Ruby

Made by DeepSource
Inconsistent usage of request attribute detected RB-RL1047
Style
Major
Autofix

The referer from the request object should be accessed in a consistent way throughout the codebase. By default, this issue is raised when referrer is used. However, it can be configured to raise this issue on usage of referer in .rubocop.yml.

Incorrect pluralization grammar detected RB-RL1037
Style
Major
Autofix

When using ActiveSupport's number pluralization, proper aliases should be used for readablity. For example, 1.day.ago, while equivalent to 1.days.ago, does not make grammatical sense.

Grouped parentheses found in function calls RB-LI1043
Style
Major
Autofix

Do not put a space between method name and left parenthesis, it makes the code ambiguous to read.

Access modifiers should be declared as a group RB-ST1001
Style
Major

Access group modifiers should be declared as a group.

Bad use of alias detected RB-ST1002
Style
Minor
Autofix

A block can be used that cleans up resources automatically on closing RB-ST1007
Style
Major

A block accepting version of the method can be used that does automatic resource cleanup.

Invalid annotation keyword format detected RB-ST1023
Style
Minor
Autofix

The annotation keyword is followed by a colon and a space, then a note describing the problem. Supported keywords are TODO, FIXME, OPTIMIZE, HACK and REVIEW.

Improper position of comments RB-ST1024
Style
Minor

Comments, when put on the same line as some keywords (begin, class, def, end, module), cause this issue.

Use __dir__ to get an absolute path to the current file's directory RB-ST1030
Style
Major
Autofix

#__dir__ method can replace more complex constructs to retrieve a canonicalized absolute path to the current file.

Put empty method definitions on a single line RB-ST1042
Style
Minor
Autofix

Put the end of empty method definitions on the next line. A method definition is not considered empty if it contains comments.

Inconsistent use of safe navigation detected RB-RL1049
Style
Major
Autofix

By default, this issue is raised when using try! in place of &.. try can be detected, too, if configured in .rubocop.yml. For example, if try is detected too

Detected use of discouraged ways to define class methods RB-ST1194
Style
Major

Using def self.method_name or class << self to define class methods is recommended.

Command literal without backtick detected RB-ST1022
Style
Major
Autofix

The use of %x must be avoided unless a command is to be invoked with backquotes in it (which is rather unlikely).