vochicong/rails-json-api

View on GitHub

Showing 154 of 154 total issues

Block has too many lines. [27/25]
Open

guard :rspec, cmd: "bundle exec rspec" do
  require "guard/rspec/dsl"
  dsl = Guard::RSpec::Dsl.new(self)

  # Feel free to open issues for suggestions and improvements
Severity: Minor
Found in config/Guardfile by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Complex method it#creates new user (21.1)
Open

  it 'creates new user' do
    params = {
      full_name: 'Michal Jackson',
      email_address: 'michale@gmail.com'
    }
Severity: Minor
Found in spec/api/user_post_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Code block style
Open

    curl http://localhost:3000/users -X POST -H "Content-Type: application/json" -d '{"fullName": "Michal Jackson", "emailAddress": "michale@gmail.com"}'
Severity: Info
Found in README.md by markdownlint

Space missing to the left of {.
Open

 .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
Severity: Minor
Found in config/Guardfile by rubocop

Checks that block braces have or don't have a space before the opening brace depending on configuration.

Example:

# bad
foo.map{ |a|
  a.bar.to_s
}

# good
foo.map { |a|
  a.bar.to_s
}

Parenthesize the param %w(app lib config test spec) \ .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")} to make sure that the block will be associated with the %w(app lib config test spec) \ .select method call.
Open

directories %w(app lib config test spec) \
 .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
Severity: Minor
Found in config/Guardfile by rubocop

This cop checks for ambiguous block association with method when param passed without parentheses.

Example:

# bad
some_method a { |val| puts val }

Example:

# good
# With parentheses, there's no ambiguity.
some_method(a) { |val| puts val }

# good
# Operator methods require no disambiguation
foo == bar { |b| b.baz }

# good
# Lambda arguments require no disambiguation
foo = ->(bar) { bar.baz }

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

    Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
Severity: Minor
Found in config/Guardfile 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

json.partial! "posts/post", post: @post
Severity: Minor
Found in app/views/posts/show.json.jbuilder 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"

Inconsistent indentation detected.
Open

    def post_params
      params.require(:post).permit(:post_content, :user_id)
    end
Severity: Minor
Found in app/controllers/posts_controller.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

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

bundle_binstub = File.expand_path("../bundle", __FILE__)
Severity: Minor
Found in bin/guard 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

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Severity: Minor
Found in bin/_guard-core 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"

Line is too long. [123/80]
Open

    return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
Severity: Minor
Found in bin/bundle by rubocop

Multiple consecutive blank lines
Open


Severity: Info
Found in README.md by markdownlint

MD012 - Multiple consecutive blank lines

Tags: whitespace, blank_lines

Aliases: no-multiple-blanks

This rule is triggered when there are multiple consecutive blank lines in the document:

Some text here


Some more text here

To fix this, delete the offending lines:

Some text here

Some more text here

Note: this rule will not be triggered if there are multiple consecutive blank lines inside code blocks.

Code block style
Open

    rails new rails_api --api
Severity: Info
Found in README.md by markdownlint

Code block style
Open

    $ RAILS_MASTER_KEY=289e1431050b365b62bb5917acabcc53 rails credentials:show
Severity: Info
Found in README.md by markdownlint

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

guard :rspec, cmd: "bundle exec rspec" do
Severity: Minor
Found in config/Guardfile 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"

Keep a blank line before and after private.
Open

  private
Severity: Minor
Found in app/controllers/users_controller.rb by rubocop

Access modifiers should be surrounded by blank lines.

Example:

# bad
class Foo
  def bar; end
  private
  def baz; end
end

# good
class Foo
  def bar; end

  private

  def baz; end
end

Inconsistent indentation detected.
Open

    def set_user
      @user = User.find(params[:id])
    end
Severity: Minor
Found in app/controllers/users_controller.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Inconsistent indentation detected.
Open

    def set_post
      @post = Post.find(params[:id])
    end
Severity: Minor
Found in app/controllers/posts_controller.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

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

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Severity: Minor
Found in bin/guard 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

load Gem.bin_path("guard", "guard")
Severity: Minor
Found in bin/guard 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