Showing 94 of 94 total issues
Method has too many lines. [15/10] Open
def custom_caps(text)
# $1 and $2 are excluded HTML tags, $3 is the part before the caps and $4 is the caps match
text.gsub(%r{
(<[^/][^>]*?>)| # Ignore any opening tag, so we don't mess up attribute values
(\s| |^|'|"|>|) # Make sure our capture is preceded by whitespace or quotes
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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.
Jekyll::TypogrifyFilter has no descriptive comment Open
module TypogrifyFilter
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.
Example
Given
class Dummy
# Do things...
end
Reek would emit the following warning:
test.rb -- 1 warning:
[1]:Dummy has no descriptive comment (IrresponsibleModule)
Fixing this is simple - just an explaining comment:
# The Dummy class is responsible for ...
class Dummy
# Do things...
end
Jekyll::TypogrifyFilter#letter_spacing doesn't depend on instance state (maybe move it to another class?) Open
def letter_spacing(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#entities doesn't depend on instance state (maybe move it to another class?) Open
def entities(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#caps doesn't depend on instance state (maybe move it to another class?) Open
def caps(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#emdash doesn't depend on instance state (maybe move it to another class?) Open
def emdash(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#smartypants doesn't depend on instance state (maybe move it to another class?) Open
def smartypants(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#widont doesn't depend on instance state (maybe move it to another class?) Open
def widont(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#amp doesn't depend on instance state (maybe move it to another class?) Open
def amp(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#custom_caps doesn't depend on instance state (maybe move it to another class?) Open
def custom_caps(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#titlecase doesn't depend on instance state (maybe move it to another class?) Open
def titlecase(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#initial_quotes doesn't depend on instance state (maybe move it to another class?) Open
def initial_quotes(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Jekyll::TypogrifyFilter#improve doesn't depend on instance state (maybe move it to another class?) Open
def improve(text)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
spec.bindir = "exe"
- Read upRead up
- Create a ticketCreate a ticket
- 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"
Redundant return
detected. Open
return emdash(text.to_s)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for redundant return
expressions.
Example:
def test
return something
end
def test
one
two
three
return something
end
It should be extended to handle methods whose body is if/else or a case expression with a default branch.
Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency titlecase
should appear before typogruby
. Open
spec.add_runtime_dependency "titlecase"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Dependencies in the gemspec should be alphabetically sorted.
Example:
# bad
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'
# good
spec.add_dependency 'rspec'
spec.add_dependency 'rubocop'
# good
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'
# bad
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'
# good
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop'
# good
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'
# bad
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'
# good
spec.add_runtime_dependency 'rspec'
spec.add_runtime_dependency 'rubocop'
# good
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'
# good only if TreatCommentsAsGroupSeparators is true
# For code quality
spec.add_dependency 'rubocop'
# For tests
spec.add_dependency 'rspec'
Line is too long. [90/80] Open
}.gsub(/(\w+)="(.*?)<span class="emdash">—<\/span>(.*?)"/, '\1="\2—\3"')
- Create a ticketCreate a ticket
- Exclude checks
Redundant return
detected. Open
return Typogruby.widont(text.to_s)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for redundant return
expressions.
Example:
def test
return something
end
def test
one
two
three
return something
end
It should be extended to handle methods whose body is if/else or a case expression with a default branch.
Use only ascii symbols in comments. Open
# converts a — (em dash) by optional whitespace or a non-breaking space
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).
Example:
# bad
# Translates from English to 日本語。
# good
# Translates from English to Japanese
Do not use parallel assignment. Open
tag, before, word = $1, $2, $3
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for simple usages of parallel assignment. This will only complain when the number of variables being assigned matched the number of assigning variables.
Example:
# bad
a, b, c = 1, 2, 3
a, b, c = [1, 2, 3]
# good
one, two = *foo
a, b = foo()
a, b = b, a
a = 1
b = 2
c = 3