Showing 714 of 714 total issues
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
log.info("Cat command called.")
- Read upRead up
- Exclude checks
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"
Use snake_case for method names. Open
def self.detectResult(msg, ws, log, response_limit, outLoc)
- Read upRead up
- Exclude checks
This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.
Example: EnforcedStyle: snake_case (default)
# bad
def fooBar; end
# good
def foo_bar; end
Example: EnforcedStyle: camelCase
# bad
def foo_bar; end
# good
def fooBar; end
Use 2 (not 4) spaces for indentation. Open
return @@wsList
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
Replace class var @@wsList with a class instance var. Open
@@wsList = Array.new
- Read upRead up
- Exclude checks
This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.
Use 2 (not 4) spaces for indentation. Open
open_message = "WebSocket connection open: #{ws} from " + Bbs::WebSocket.convertIP(ws)
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
Replace class var @@selected with a class instance var. Open
@@selected = newSelected
- Read upRead up
- Exclude checks
This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.
Use 2 (not 4) spaces for indentation. Open
return ws.get_peername[2,6].unpack('nC4')[1..4].join('.')
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
Use 2 (not 4) spaces for indentation. Open
Bbs::PrintColor.print_error("Session does not exist.")
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"ws.send(err.message);"\
- Read upRead up
- Exclude checks
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"
Line is too long. [86/80] Open
def startEM(log, host, port, secure, priv_key, cert_chain, response_limit, outLoc)
- Exclude checks
Extra empty line detected at module body beginning. Open
module Config
- Read upRead up
- Exclude checks
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
Use 2 (not 4) spaces for indentation. Open
if @@configfile == nil
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
1 trailing blank lines detected. Open
- Exclude checks
Use 2 (not 4) spaces for indentation. Open
log.info("Exit command called.")
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
Line is too long. [87/80] Open
log.error("Unable to convert #{ws} to IP address with error: #{e.message}")
- Exclude checks
Use snake_case for method names. Open
def Config.loadLog
- Read upRead up
- Exclude checks
This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.
Example: EnforcedStyle: snake_case (default)
# bad
def fooBar; end
# good
def foo_bar; end
Example: EnforcedStyle: camelCase
# bad
def foo_bar; end
# good
def fooBar; end
Use self.getConfig
instead of Config.getConfig
. Open
def Config.getConfig
- Read upRead up
- Exclude checks
This cop checks for uses of the class/module name instead of self, when defining class/module methods.
Example:
# bad
class SomeClass
def SomeClass.class_method
# ...
end
end
# good
class SomeClass
def self.class_method
# ...
end
end
Use snake_case for variable names. Open
def self.detectResult(msg, ws, log, response_limit, outLoc)
- Read upRead up
- Exclude checks
This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.
Example: EnforcedStyle: snake_case (default)
# bad
fooBar = 1
# good
foo_bar = 1
Example: EnforcedStyle: camelCase
# bad
foo_bar = 1
# good
fooBar = 1
Use self.getLog
instead of Config.getLog
. Open
def Config.getLog
- Read upRead up
- Exclude checks
This cop checks for uses of the class/module name instead of self, when defining class/module methods.
Example:
# bad
class SomeClass
def SomeClass.class_method
# ...
end
end
# good
class SomeClass
def self.class_method
# ...
end
end
Redundant begin
block detected. Open
begin
- Read upRead up
- Exclude checks
This cop checks for redundant begin
blocks.
Currently it checks for code like this:
Example:
def redundant
begin
ala
bala
rescue StandardError => e
something
end
end
def preferred
ala
bala
rescue StandardError => e
something
end