Showing 72 of 72 total issues

Line is too long. [91/80]
Open

          BosClient::Error.const_set(name.to_sym, Class.new(BosClient::Error)).new(message)
Severity: Minor
Found in lib/bos_client/error.rb by rubocop

Unnecessary utf-8 encoding comment.
Open

# encoding: UTF-8
Severity: Minor
Found in lib/bos_client/config.rb by rubocop

Unnecessary utf-8 encoding comment.
Open

# encoding: UTF-8
Severity: Minor
Found in lib/bos_client/bucket.rb by rubocop

URI.encode method is obsolete and should not be used. Instead, use CGI.escape, URI.encode_www_form or URI.encode_www_form_component depending on your specific use case.
Open

        url_path = URI.encode(uri.path)
Severity: Minor
Found in lib/bos_client/auth.rb by rubocop

This cop identifies places where URI.escape can be replaced by CGI.escape, URI.encode_www_form or URI.encode_www_form_component depending on your specific use case. Also this cop identifies places where URI.unescape can be replaced by CGI.unescape, URI.decode_www_form or URI.decode_www_form_component depending on your specific use case.

Example:

# bad
URI.escape('http://example.com')
URI.encode('http://example.com')

# good
CGI.escape('http://example.com')
URI.encode_www_form([['example', 'param'], ['lang', 'en']])
URI.encode_www_form(page: 10, locale: 'en')
URI.encode_www_form_component('http://example.com')

# bad
URI.unescape(enc_uri)
URI.decode(enc_uri)

# good
CGI.unescape(enc_uri)
URI.decode_www_form(enc_uri)
URI.decode_www_form_component(enc_uri)

Unnecessary utf-8 encoding comment.
Open

# encoding: UTF-8
Severity: Minor
Found in lib/bos_client/service.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

        if ret[:data][:code]
Severity: Minor
Found in lib/bos_client/request.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

Missing top-level class documentation comment.
Open

  class Object
Severity: Minor
Found in lib/bos_client/object.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. [82/80]
Open

          raise BosClient::Error.bos_error ret[:data][:code], ret[:data][:message]
Severity: Minor
Found in lib/bos_client/request.rb by rubocop

Add an empty line after magic comments.
Open

module BosClient
Severity: Minor
Found in lib/bos_client/error.rb by rubocop

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

Line is too long. [83/80]
Open

      @bucket_host = "#{BosClient.scheme}://#{@name}.#{@location}.#{BosClient.url}"
Severity: Minor
Found in lib/bos_client/bucket.rb by rubocop

Don't use parentheses around a method call.
Open

      objs.map { |obj| BosClient::Object.new ({bucket: self}.merge(obj)) }
Severity: Minor
Found in lib/bos_client/bucket.rb by rubocop

This cop checks for redundant parentheses.

Example:

# bad
(x) if ((y.z).nil?)

# good
x if y.z.nil?

Add an empty line after magic comments.
Open

require 'openssl'
Severity: Minor
Found in lib/bos_client/auth.rb by rubocop

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end
Severity
Category
Status
Source
Language