18F/e-manifest

View on GitHub
app/services/manifest_signer.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for perform is too high. [17.75/15]
Open

  def perform
    output_stream = StreamLogger.new(Rails.logger)

    modified_args = ManifestTokenJsonConverter.new(args).replace_with_json_cdx_token

Severity: Minor
Found in app/services/manifest_signer.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
Open

    if cdx_response.key?(:transaction_id)
Severity: Minor
Found in app/services/manifest_signer.rb by rubocop

Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

Example:

# bad
if condition
  do_stuff(bar)
end

unless qux.empty?
  Foo.do_something
end

# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?

Line is too long. [110/80]
Open

    Rails.logger.debug(ANSI.blue{ "  CDX signature time: #{sprintf('%#g', (cdx_stop - cdx_start))} seconds" })
Severity: Minor
Found in app/services/manifest_signer.rb by rubocop

Trailing whitespace detected.
Open

  
Severity: Minor
Found in app/services/manifest_signer.rb by rubocop

Missing top-level class documentation comment.
Open

class ManifestSigner
Severity: Minor
Found in app/services/manifest_signer.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

Favor format over sprintf.
Open

    Rails.logger.debug(ANSI.blue{ "  CDX signature time: #{sprintf('%#g', (cdx_stop - cdx_start))} seconds" })
Severity: Minor
Found in app/services/manifest_signer.rb by rubocop

This cop enforces the use of a single string formatting utility. Valid options include Kernel#format, Kernel#sprintf and String#%.

The detection of String#% cannot be implemented in a reliable manner for all cases, so only two scenarios are considered - if the first argument is a string literal and if the second argument is an array literal.

Example: EnforcedStyle: format(default)

# bad
puts sprintf('%10s', 'hoge')
puts '%10s' % 'hoge'

# good
puts format('%10s', 'hoge')

Example: EnforcedStyle: sprintf

# bad
puts format('%10s', 'hoge')
puts '%10s' % 'hoge'

# good
puts sprintf('%10s', 'hoge')

Example: EnforcedStyle: percent

# bad
puts format('%10s', 'hoge')
puts sprintf('%10s', 'hoge')

# good
puts '%10s' % 'hoge'

Space missing to the left of {.
Open

    Rails.logger.debug(ANSI.blue{ "  CDX signature time: #{sprintf('%#g', (cdx_stop - cdx_start))} seconds" })
Severity: Minor
Found in app/services/manifest_signer.rb 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
}

Line is too long. [84/80]
Open

    modified_args = ManifestTokenJsonConverter.new(args).replace_with_json_cdx_token
Severity: Minor
Found in app/services/manifest_signer.rb by rubocop

There are no issues that match your filters.

Category
Status