18F/micropurchase

View on GitHub

Showing 122 of 122 total issues

Use %i or %I for an array of symbols.
Open

        resource '*', headers: :any, methods: [:get, :put, :post, :options]
Severity: Minor
Found in config/application.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

Avoid qualifying attribute selectors with an element.
Open

drawer button[data-drawer-toggle="menu"],

Avoid qualifying attribute selectors with an element.
Open

drawer[aria-hidden=false],

Avoid using id selectors
Open

drawer[aria-hidden=false],

Prefer using YAML.safe_load over YAML.load.
Open

    @github_ids ||= YAML.load(File.read(File.expand_path("../../../config/admins.yml", __FILE__)))['github_ids']
Severity: Minor
Found in app/models/admins.rb by rubocop

This cop checks for the use of YAML class methods which have potential security issues leading to remote code execution when loading from an untrusted source.

Example:

# bad
YAML.load("--- foo")

# good
YAML.safe_load("--- foo")
YAML.dump("foo")

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem brakeman should appear before database_cleaner.
Open

  gem 'brakeman', require: false
Severity: Minor
Found in Gemfile by rubocop

Gems should be alphabetically sorted within groups.

Example:

# bad
gem 'rubocop'
gem 'rspec'

# good
gem 'rspec'
gem 'rubocop'

# good
gem 'rubocop'

gem 'rspec'

# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'

Merge rule drawer button[data-drawer-toggle="close"] with rule on line 3
Open

drawer button[data-drawer-toggle="close"] {

Prefer annotated tokens (like %<foo>s</foo>) over unannotated tokens (like %s).
Open

  FORMAT = "%B %d, %Y %r".freeze
Severity: Minor
Found in app/presenters/dc_time_presenter.rb by rubocop

Use a consistent style for named format string tokens.

Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

Example: EnforcedStyle: annotated (default)

# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%<greeting>s', greeting: 'Hello')</greeting>

Example: EnforcedStyle: template

# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%{greeting}', greeting: 'Hello')</greeting>

Example: EnforcedStyle: unannotated

# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')

# good
format('%s', 'Hello')</greeting>

Prefer annotated tokens (like %<foo>s</foo>) over unannotated tokens (like %s).
Open

      date = convert_and_format('%b %-d, %Y', timezone_label: false)
Severity: Minor
Found in app/presenters/dc_time_presenter.rb by rubocop

Use a consistent style for named format string tokens.

Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

Example: EnforcedStyle: annotated (default)

# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%<greeting>s', greeting: 'Hello')</greeting>

Example: EnforcedStyle: template

# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%{greeting}', greeting: 'Hello')</greeting>

Example: EnforcedStyle: unannotated

# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')

# good
format('%s', 'Hello')</greeting>

Use %i or %I for an array of symbols.
Open

  match 'auth/saml/logout', to: 'saml_authentications#destroy', via: [:get, :post, :delete]
Severity: Minor
Found in config/routes.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

Method Swagger::Path#operations is defined at both lib/swagger/path.rb:4 and lib/swagger/path.rb:12.
Open

  def operations
Severity: Minor
Found in lib/swagger/path.rb by rubocop

This cop checks for duplicated instance (or singleton) method definitions.

Example:

# bad

def duplicated
  1
end

def duplicated
  2
end

Example:

# bad

def duplicated
  1
end

alias duplicated other_duplicated

Example:

# good

def duplicated
  1
end

def other_duplicated
  2
end

Avoid vendor prefixes.
Open

  -ms-flex-wrap: wrap;

Rule set contains (13/10) properties
Open

  .clipboard-input {

!important should not be used
Open

    display: block !important;

Avoid qualifying attribute selectors with an element.
Open

drawer button[data-drawer-toggle="close"] {

Begin pseudo elements with double colons: ::
Open

ul li:before {

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem database_cleaner should appear before pry.
Open

  gem 'database_cleaner'
Severity: Minor
Found in Gemfile by rubocop

Gems should be alphabetically sorted within groups.

Example:

# bad
gem 'rubocop'
gem 'rspec'

# good
gem 'rspec'
gem 'rubocop'

# good
gem 'rubocop'

gem 'rspec'

# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem dotenv-rails should appear before hakiri.
Open

  gem 'dotenv-rails'
Severity: Minor
Found in Gemfile by rubocop

Gems should be alphabetically sorted within groups.

Example:

# bad
gem 'rubocop'
gem 'rspec'

# good
gem 'rspec'
gem 'rubocop'

# good
gem 'rubocop'

gem 'rspec'

# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'

Use %i or %I for an array of symbols.
Open

    resources :users, only: [:show, :edit, :update]
Severity: Minor
Found in config/routes.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

Rule set contains (13/10) properties
Open

drawer {
Severity
Category
Status
Source
Language