myles/jekyll-typogrify

View on GitHub

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|&nbsp;|^|'|"|>|)                                 # Make sure our capture is preceded by whitespace or quotes
Severity: Minor
Found in lib/jekyll/typogrify.rb by rubocop

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
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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#custom_caps doesn't depend on instance state (maybe move it to another class?)
Open

    def custom_caps(text)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

Jekyll::TypogrifyFilter#letter_spacing doesn't depend on instance state (maybe move it to another class?)
Open

    def letter_spacing(text)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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)
Severity: Minor
Found in lib/jekyll/typogrify.rb by reek

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.add_development_dependency "rspec", "~> 3.0"
Severity: Minor
Found in jekyll-typogrify.gemspec by rubocop

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"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  spec.add_development_dependency "rake", "~> 10.0"
Severity: Minor
Found in jekyll-typogrify.gemspec by rubocop

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"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  spec.add_development_dependency "jekyll"
Severity: Minor
Found in jekyll-typogrify.gemspec by rubocop

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 %q only for strings that contain both single quotes and double quotes.
Open

  spec.description   = %q{A Jekyll plugin that improves the typography of your Liquid templates.}
Severity: Minor
Found in jekyll-typogrify.gemspec by rubocop

Avoid using {...} for multi-line blocks.
Open

      text.gsub(/(click\S*|clint\S*|final\S*|curt\S*|flick\S*)\b/im) { |str|
Severity: Minor
Found in lib/jekyll/typogrify.rb by rubocop

Check for uses of braces or do/end around single line or multi-line blocks.

Example: EnforcedStyle: linecountbased (default)

# bad - single line block
items.each do |item| item / 5 end

# good - single line block
items.each { |item| item / 5 }

# bad - multi-line block
things.map { |thing|
  something = thing.some_method
  process(something)
}

# good - multi-line block
things.map do |thing|
  something = thing.some_method
  process(something)
end

Example: EnforcedStyle: semantic

# Prefer `do...end` over `{...}` for procedural blocks.

# return value is used/assigned
# bad
foo = map do |x|
  x
end
puts (map do |x|
  x
end)

# return value is not used out of scope
# good
map do |x|
  x
end

# Prefer `{...}` over `do...end` for functional blocks.

# return value is not used out of scope
# bad
each { |x|
  x
}

# return value is used/assigned
# good
foo = map { |x|
  x
}
map { |x|
  x
}.inspect

Example: EnforcedStyle: bracesforchaining

# bad
words.each do |word|
  word.flip.flop
end.join("-")

# good
words.each { |word|
  word.flip.flop
}.join("-")

Avoid the use of Perl-style backrefs.
Open

        elsif $3 =~ /^[\d\.]+$/
Severity: Minor
Found in lib/jekyll/typogrify.rb by rubocop

This cop looks for uses of Perl-style regexp match backreferences like $1, $2, etc.

Example:

# bad
puts $1

# good
puts Regexp.last_match(1)

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  spec.add_runtime_dependency "titlecase"
Severity: Minor
Found in jekyll-typogrify.gemspec by rubocop

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"
Severity
Category
Status
Source
Language