SebastianCarroll/jekyll-rakefile

View on GitHub

Showing 319 of 319 total issues

Line is too long. [81/80]
Open

      # strip characters and whitespace to create valid filenames, also lowercase
Severity: Minor
Found in lib/jekyll_rake/utils.rb by rubocop

Line is too long. [86/80]
Open

    # TODO: Migrate slugify from '-' to '_'. Need to write script to migrate filenames
Severity: Minor
Found in lib/jekyll_rake/utils.rb by rubocop

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

      puts "DATE and CATEGORY are optional"
Severity: Minor
Found in lib/jekyll_rake/post.rb 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"

Redundant return detected.
Open

      return title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
Severity: Minor
Found in lib/jekyll_rake/utils.rb by rubocop

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.

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

      (date != "" and date != "nil" and not date.nil?) ? date : Time.new.strftime("%Y-%m-%d %H:%M:%S %Z")
Severity: Minor
Found in lib/jekyll_rake/post.rb 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

      puts ""
Severity: Minor
Found in lib/jekyll_rake/post.rb 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

      puts "CATEGORY is a string; nil or empty for no category"
Severity: Minor
Found in lib/jekyll_rake/post.rb 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

  VERSION = "0.1.0"
Severity: Minor
Found in lib/jekyll_rake/version.rb 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 tr instead of gsub.
Open

      return title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
Severity: Minor
Found in lib/jekyll_rake/utils.rb by rubocop

This cop identifies places where gsub can be replaced by tr or delete.

Example:

# bad
'abc'.gsub('b', 'd')
'abc'.gsub('a', '')
'abc'.gsub(/a/, 'd')
'abc'.gsub!('a', 'd')

# good
'abc'.gsub(/.*/, 'a')
'abc'.gsub(/a+/, 'd')
'abc'.tr('b', 'd')
'a b c'.delete(' ')

Do not use do with multi-line while.
Open

      while File.exists?(@post_dir + filename) do
Severity: Minor
Found in lib/jekyll_rake/post.rb by rubocop

Checks for uses of do in multi-line while/until statements.

Example:

# bad
while x.any? do
  do_something(x.pop)
end

# good
while x.any?
  do_something(x.pop)
end

Example:

# bad
until x.empty? do
  do_something(x.pop)
end

# good
until x.empty?
  do_something(x.pop)
end

Omit parentheses for ternary conditions.
Open

      (date != "" and date != "nil" and not date.nil?) ? date : Time.new.strftime("%Y-%m-%d %H:%M:%S %Z")
Severity: Minor
Found in lib/jekyll_rake/post.rb by rubocop

This cop checks for the presence of parentheses around ternary conditions. It is configurable to enforce inclusion or omission of parentheses using EnforcedStyle. Omission is only enforced when removing the parentheses won't cause a different behavior.

Example: EnforcedStyle: requirenoparentheses (default)

# bad
foo = (bar?) ? a : b
foo = (bar.baz?) ? a : b
foo = (bar && baz) ? a : b

# good
foo = bar? ? a : b
foo = bar.baz? ? a : b
foo = bar && baz ? a : b

Example: EnforcedStyle: require_parentheses

# bad
foo = bar? ? a : b
foo = bar.baz? ? a : b
foo = bar && baz ? a : b

# good
foo = (bar?) ? a : b
foo = (bar.baz?) ? a : b
foo = (bar && baz) ? a : b

Example: EnforcedStyle: requireparentheseswhen_complex

# bad
foo = (bar?) ? a : b
foo = (bar.baz?) ? a : b
foo = bar && baz ? a : b

# good
foo = bar? ? a : b
foo = bar.baz? ? a : b
foo = (bar && baz) ? a : b

Freeze mutable objects assigned to constants.
Open

  VERSION = "0.1.0"
Severity: Minor
Found in lib/jekyll_rake/version.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Line is too long. [81/80]
Open

      # strip characters and whitespace to create valid filenames, also lowercase
Severity: Minor
Found in lib/jekyll_rake/utils.rb by rubocop

Missing top-level class documentation comment.
Open

  class Utils
Severity: Minor
Found in lib/jekyll_rake/utils.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

TODO found
Open

# TODO: remove deploy
Severity: Minor
Found in Rakefile.deploy.rb by fixme

TODO found
Open

      # TODO: Global Variable
Severity: Minor
Found in lib/jekyll_rake/post.rb by fixme

TODO found
Open

      # TODO: refactor - very difficult to understand without the comment
Severity: Minor
Found in lib/jekyll_rake/post.rb by fixme

TODO found
Open

    # TODO: No error handling
Severity: Minor
Found in lib/jekyll_rake/post.rb by fixme

TODO found
Open

  # TODO: Refactor to use inject or join
Severity: Minor
Found in lib/tools.rb by fixme

TODO found
Open

      # TODO: This method is still out of place
Severity: Minor
Found in lib/jekyll_rake/post.rb by fixme
Severity
Category
Status
Source
Language