Showing 840 of 840 total issues
Tab detected. Open
file_path = file_path.join(file_name) if file_name
- Exclude checks
Tab detected. Open
end
- Exclude checks
Line is too long. [90/80] Open
FileUtils.mkdir_p code_module.test_file_root if code_module.test_file_root
- Exclude checks
Line is too long. [91/80] Open
puts "Test file path: #{code_module.test_file_path}".green if code_module.test_file_path
- Exclude checks
Line is too long. [110/80] Open
# It's possible that current project doesn't test targets configured, so it doesn't need to generate tests.
- Exclude checks
Prefer the use of the nil?
predicate. Open
if targets.count == 0 || files == nil || files.count == 0 || dir_path == nil || group_path == nil
- Read upRead up
- Exclude checks
This cop checks for comparison of something with nil using ==.
Example:
# bad
if x == nil
end
# good
if x.nil?
end
Use %r
around regular expression. Open
directory_name = file[TEMPLATE_NAME_KEY].gsub(/^\/|\/$/, '')
- Read upRead up
- Exclude checks
This cop enforces using // or %r around regular expressions.
Example: EnforcedStyle: slashes (default)
# bad
snake_case = %r{^[\dA-Z_]+$}
# bad
regex = %r{
foo
(bar)
(baz)
}x
# good
snake_case = /^[\dA-Z_]+$/
# good
regex = /
foo
(bar)
(baz)
/x
Example: EnforcedStyle: percent_r
# bad
snake_case = /^[\dA-Z_]+$/
# bad
regex = /
foo
(bar)
(baz)
/x
# good
snake_case = %r{^[\dA-Z_]+$}
# good
regex = %r{
foo
(bar)
(baz)
}x
Example: EnforcedStyle: mixed
# bad
snake_case = %r{^[\dA-Z_]+$}
# bad
regex = /
foo
(bar)
(baz)
/x
# good
snake_case = /^[\dA-Z_]+$/
# good
regex = %r{
foo
(bar)
(baz)
}x
Example: AllowInnerSlashes: false (default)
# If `false`, the cop will always recommend using `%r` if one or more
# slashes are found in the regexp string.
# bad
x =~ /home\//
# good
x =~ %r{home/}
Example: AllowInnerSlashes: true
# good
x =~ /home\//
Extra empty line detected at class body beginning. Open
def colorize(color_code)
- Read upRead up
- Exclude checks
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
Line is too long. [92/80] Open
dependencies = ask_loop('Enter the name of your dependency (empty string to stop):')
- Exclude checks
Final newline missing. Open
end
- Exclude checks
Extra empty line detected at class body end. Open
end
- Read upRead up
- Exclude checks
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
Final newline missing. Open
end
- Exclude checks
Line is too long. [102/80] Open
method_option :description, :aliases => '-d', :desc => 'Provides a full description to the module'
- Exclude checks
Line is too long. [95/80] Open
method_option :test_targets, :desc => 'Specifies project targets for adding new test files'
- Exclude checks
Line is too long. [115/80] Open
parameters = GenCommandTableParametersFormatter.prepare_parameters_for_displaying(code_module, template_name)
- Exclude checks
Use the new Ruby 1.9 hash syntax. Open
method_option :test_group_path, :desc => 'Specifies a location in Xcode groups for new test files'
- Read upRead up
- Exclude checks
This cop checks hash literal syntax.
It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).
A separate offense is registered for each problematic pair.
The supported styles are:
- ruby19 - forces use of the 1.9 syntax (e.g.
{a: 1}
) when hashes have all symbols for keys - hash_rockets - forces use of hash rockets for all hashes
- nomixedkeys - simply checks for hashes with mixed syntaxes
- ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes
Example: EnforcedStyle: ruby19 (default)
# bad
{:a => 2}
{b: 1, :c => 2}
# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden
Example: EnforcedStyle: hash_rockets
# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}
# good
{:a => 1, :b => 2}
Example: EnforcedStyle: nomixedkeys
# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}
# good
{:a => 1, :b => 2}
{c: 1, d: 2}
Example: EnforcedStyle: ruby19nomixed_keys
# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets
# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}
Extra empty line detected at method body end. Open
end
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the bodies of methods.
Example:
# good
def foo
# ...
end
# bad
def bar
# ...
end
Operator =
should be surrounded by a single space. Open
properties[PROJECT_PREFIX_KEY] = ask('The project prefix (if any):')
- Read upRead up
- Exclude checks
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
private
(on line 103) does not make singleton methods private. Use private_class_method
or private
inside a class << self
block instead. Open
def self.obtain_target(target_name, project)
- Read upRead up
- Exclude checks
This cop checks for private
or protected
access modifiers which are
applied to a singleton method. These access modifiers do not make
singleton methods private/protected. private_class_method
can be
used for that.
Example:
# bad
class C
private
def self.method
puts 'hi'
end
end
Example:
# good
class C
def self.method
puts 'hi'
end
private_class_method :method
end
Example:
# good
class C
class << self
private
def method
puts 'hi'
end
end
end
Line is too long. [135/80] Open
next_group = group_is_logical ? final_group.new_group(group_name) : final_group.new_group(group_name, dir_path, :project)
- Exclude checks