dpn-admin/dpn-sync

View on GitHub

Showing 52 of 52 total issues

Parenthesize the param proc { File.expand_path(File.join(root, 'app', 'views')) } to make sure that the block will be associated with the proc method call.
Open

    set :views, proc { File.expand_path(File.join(root, 'app', 'views')) }
Severity: Minor
Found in app/dpn_sync.rb 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 }

Avoid rescuing without specifying an error class.
Open

        rescue
Severity: Minor
Found in lib/dpn/workers/bag_rsync.rb by rubocop

This cop checks for rescuing StandardError. There are two supported styles implicit and explicit. This cop will not register an offense if any error other than StandardError is specified.

Example: EnforcedStyle: implicit

# `implicit` will enforce using `rescue` instead of
# `rescue StandardError`.

# bad
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Example: EnforcedStyle: explicit (default)

# `explicit` will enforce using `rescue StandardError`
# instead of `rescue`.

# bad
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Using width with border can sometimes make elements larger than you expect.
Open

    border: 1px solid #ccc;
Severity: Minor
Found in app/public/stylesheets/main.css by csslint

Using width with padding can sometimes make elements larger than you expect.
Open

    padding: 2.08333333333%; /* 5px / 240px */
Severity: Minor
Found in app/public/stylesheets/main.css by csslint

%w-literals should be delimited by [ and ].
Open

        BAG_TYPES = %w(I R D).freeze
Severity: Minor
Found in lib/dpn/workers/sync_bags.rb by rubocop

This cop enforces the consistent usage of %-literal delimiters.

Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

Example:

# Style/PercentLiteralDelimiters:
#   PreferredDelimiters:
#     default: '[]'
#     '%i':    '()'

# good
%w[alpha beta] + %i(gamma delta)

# bad
%W(alpha #{beta})

# bad
%I(alpha beta)

Avoid rescuing without specifying an error class.
Open

                              rescue
Severity: Minor
Found in lib/dpn/workers/nodes.rb by rubocop

This cop checks for rescuing StandardError. There are two supported styles implicit and explicit. This cop will not register an offense if any error other than StandardError is specified.

Example: EnforcedStyle: implicit

# `implicit` will enforce using `rescue` instead of
# `rescue StandardError`.

# bad
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Example: EnforcedStyle: explicit (default)

# `explicit` will enforce using `rescue StandardError`
# instead of `rescue`.

# bad
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

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

          skip = [:api_root, :namespace, :auth_credential]
Severity: Minor
Found in lib/dpn/workers/node.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]

Use __dir__ to get an absolute path to the current file's directory.
Open

$LOAD_PATH << File.expand_path(File.dirname(__FILE__))
Severity: Minor
Found in config.ru by rubocop

This cop checks for places where the #__dir__ method can replace more complex constructs to retrieve a canonicalized absolute path to the current file.

Example:

# bad
path = File.expand_path(File.dirname(__FILE__))

# bad
path = File.dirname(File.realpath(__FILE__))

# good
path = __dir__

The universal selector (*) is known to be slow.
Open

  * {
Severity: Minor
Found in app/public/stylesheets/main.css by csslint

Using width with padding can sometimes make elements larger than you expect.
Open

    padding: 2.25%; /* 18px / 800px */
Severity: Minor
Found in app/public/stylesheets/main.css by csslint

TODO found
Open

            # TODO: after: last_success
Severity: Minor
Found in lib/dpn/workers/sync_replications.rb by fixme

TODO found
Open

          # TODO: consider whether to mark a replication as
Severity: Minor
Found in lib/dpn/workers/bag_store.rb by fixme
Severity
Category
Status
Source
Language