alexpeattie/nitlink

View on GitHub

Showing 119 of 119 total issues

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

    gem 'http', '>= 2.0.0'
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'

Final newline missing.
Open

end
Severity: Minor
Found in lib/nitlink/parser.rb by rubocop

Line is too long. [110/80]
Open

      @request_uri, @status, link_header, @content_location_header = ResponseNormalizer.new.metadata(response)
Severity: Minor
Found in lib/nitlink/parser.rb by rubocop

Line is too long. [98/80]
Open

      if %w(GET HEAD).include?(@http_method.upcase) && [200, 203, 204, 206, 304].include?(@status)
Severity: Minor
Found in lib/nitlink/parser.rb by rubocop

Indent when as deep as case.
Open

      when 'RestClient::Response'
Severity: Minor
Found in lib/nitlink/response_normalizer.rb by rubocop

This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

It will register a separate offense for each misaligned when.

Example:

# If Layout/EndAlignment is set to keyword style (default)
# *case* and *end* should always be aligned to same depth,
# and therefore *when* should always be aligned to both -
# regardless of configuration.

# bad for all styles
case n
  when 0
    x * 2
  else
    y / 3
end

# good for all styles
case n
when 0
  x * 2
else
  y / 3
end

Example: EnforcedStyle: case (default)

# if EndAlignment is set to other style such as
# start_of_line (as shown below), then *when* alignment
# configuration does have an effect.

# bad
a = case n
when 0
  x * 2
else
  y / 3
end

# good
a = case n
    when 0
      x * 2
    else
      y / 3
end

Example: EnforcedStyle: end

# bad
a = case n
    when 0
      x * 2
    else
      y / 3
end

# good
a = case n
when 0
  x * 2
else
  y / 3
end

Final newline missing.
Open

end
Severity: Minor
Found in lib/nitlink/response_normalizer.rb by rubocop

Missing top-level class documentation comment.
Open

  class ResponseNormalizer
Severity: Minor
Found in lib/nitlink/response_normalizer.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

Line is too long. [96/80]
Open

  Object.const_defined?(module_name) && Object.const_get(module_name).const_defined?(class_name)
Severity: Minor
Found in lib/nitlink/response.rb by rubocop

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

  gem 'httpclient', '>= 2.8'
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'

Line is too long. [114/80]
Open

 as closely as possible to RFC 5988. Has support for UTF-8 encoded parameters, URI resolution, boolean parameters,
Severity: Minor
Found in nitlink.gemspec by rubocop

Final newline missing.
Open

end

Final newline missing.
Open

end
Severity: Minor
Found in lib/nitlink/param_extractor.rb by rubocop

Missing top-level class documentation comment.
Open

  class ParamExtractor
Severity: Minor
Found in lib/nitlink/param_extractor.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

Indent when as deep as case.
Open

      when 'Curl::Easy'
Severity: Minor
Found in lib/nitlink/response_normalizer.rb by rubocop

This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

It will register a separate offense for each misaligned when.

Example:

# If Layout/EndAlignment is set to keyword style (default)
# *case* and *end* should always be aligned to same depth,
# and therefore *when* should always be aligned to both -
# regardless of configuration.

# bad for all styles
case n
  when 0
    x * 2
  else
    y / 3
end

# good for all styles
case n
when 0
  x * 2
else
  y / 3
end

Example: EnforcedStyle: case (default)

# if EndAlignment is set to other style such as
# start_of_line (as shown below), then *when* alignment
# configuration does have an effect.

# bad
a = case n
when 0
  x * 2
else
  y / 3
end

# good
a = case n
    when 0
      x * 2
    else
      y / 3
end

Example: EnforcedStyle: end

# bad
a = case n
    when 0
      x * 2
    else
      y / 3
end

# good
a = case n
when 0
  x * 2
else
  y / 3
end

Line is too long. [90/80]
Open

        [response.request.url, response.code, grab_headers(response.net_http_res.to_hash)]
Severity: Minor
Found in lib/nitlink/response_normalizer.rb by rubocop

Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency addressable should appear before simplecov-shield.
Open

  spec.add_development_dependency 'addressable', '~> 2.4.0'
Severity: Minor
Found in nitlink.gemspec by rubocop

Dependencies in the gemspec should be alphabetically sorted.

Example:

# bad
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'

# good
spec.add_dependency 'rspec'
spec.add_dependency 'rubocop'

# good
spec.add_dependency 'rubocop'

spec.add_dependency 'rspec'

# bad
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'

# good
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop'

# good
spec.add_development_dependency 'rubocop'

spec.add_development_dependency 'rspec'

# bad
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'

# good
spec.add_runtime_dependency 'rspec'
spec.add_runtime_dependency 'rubocop'

# good
spec.add_runtime_dependency 'rubocop'

spec.add_runtime_dependency 'rspec'

# good only if TreatCommentsAsGroupSeparators is true
# For code quality
spec.add_dependency 'rubocop'
# For tests
spec.add_dependency 'rspec'

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

      if %w(GET HEAD).include?(@http_method.upcase) && [200, 203, 204, 206, 304].include?(@status)
Severity: Minor
Found in lib/nitlink/parser.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)

Final newline missing.
Open

end
Severity: Minor
Found in lib/nitlink/link_collection.rb by rubocop

Use % instead of %Q.
Open

      EncodedParamSyntaxError.new(%Q{Syntax error decoding encoded parameter value "#{ val }", must be in the form: charset "'" [ language ] "'" value-chars})
Severity: Minor
Found in lib/nitlink/param_decoder.rb by rubocop

This cop checks if usage of %() or %Q() matches configuration.

Example: EnforcedStyle: bare_percent (default)

# bad
%Q(He said: "#{greeting}")
%q{She said: 'Hi'}

# good
%(He said: "#{greeting}")
%{She said: 'Hi'}

Example: EnforcedStyle: percent_q

# bad
%|He said: "#{greeting}"|
%/She said: 'Hi'/

# good
%Q|He said: "#{greeting}"|
%q/She said: 'Hi'/

Missing top-level class documentation comment.
Open

  class HashWithIndifferentAccess < ::Hash

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
Severity
Category
Status
Source
Language