bayetech/ll_pay

View on GitHub

Showing 67 of 67 total issues

Missing top-level module documentation comment.
Open

  module Sign
Severity: Minor
Found in lib/ll_pay/sign.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. [95/80]
Open

      params[:oid_partner] = params[:oid_partner] || options[:oid_partner] || LlPay.oid_partner
Severity: Minor
Found in lib/ll_pay/service.rb by rubocop

Line is too long. [125/80]
Open

    REFUND_ORDER_PARAMS = %w(oid_partner sign_type no_refund dt_refund money_refund no_order dt_order oid_paybill notify_url)
Severity: Minor
Found in lib/ll_pay/refund_order.rb by rubocop

Line is too long. [87/80]
Open

      params[:sign_type] = params[:sign_type] || options[:sign_type] || LlPay.sign_type
Severity: Minor
Found in lib/ll_pay/refund_order.rb by rubocop

Line is too long. [89/80]
Open

      request(:post, 'https://queryapi.lianlianpay.com/refundquery.htm', params, options)
Severity: Minor
Found in lib/ll_pay/refund_order.rb by rubocop

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem codeclimate-test-reporter should appear before simplecov.
Open

  gem 'codeclimate-test-reporter', '~> 1.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'

Freeze mutable objects assigned to constants.
Open

    REFUND_ORDER_QUERY_PARAMS = %w(oid_partner sign_type no_refund dt_refund oid_refundno)
Severity: Minor
Found in lib/ll_pay/refund_order.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

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

      if response_hash['ret_code'] == '0000'
Severity: Minor
Found in lib/ll_pay.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

Line is too long. [88/80]
Open

        raise ArgumentError, "invalid sign_type #{sign_type}, allow value: 'MD5', 'RSA'"
Severity: Minor
Found in lib/ll_pay/sign.rb by rubocop

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

    SECURITY_PAY_REQUIRED_PARAMS = %w(busi_partner dt_order info_order money_order name_goods no_order notify_url oid_partner risk_item sign_type valid_order)
Severity: Minor
Found in lib/ll_pay/service.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)

Line is too long. [121/80]
Open

      query_order_hash = { oid_partner: LlPay.oid_partner, dt_order: dt_order, no_order: no_order, sign_type: sign_type }
Severity: Minor
Found in lib/ll_pay/query_order.rb by rubocop

Line is too long. [84/80]
Open

      request(:post, 'https://yintong.com.cn/traderapi/refund.htm', params, options)
Severity: Minor
Found in lib/ll_pay/refund_order.rb by rubocop

Missing top-level class documentation comment.
Open

    class MD5
Severity: Minor
Found in lib/ll_pay/sign/md5.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

Use only ascii symbols in comments.
Open

  # 银通公钥
Severity: Minor
Found in lib/ll_pay.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Line is too long. [90/80]
Open

    REFUND_ORDER_QUERY_PARAMS = %w(oid_partner sign_type no_refund dt_refund oid_refundno)
Severity: Minor
Found in lib/ll_pay/refund_order.rb by rubocop

Add an empty line after magic comments.
Open

lib = File.expand_path('../lib', __FILE__)
Severity: Minor
Found in ll_pay.gemspec 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. [97/80]
Open

  spec.description   = 'Helping rubyist integration with lianlian pay(lianlianpay llpay) easier.'
Severity: Minor
Found in ll_pay.gemspec by rubocop

Freeze mutable objects assigned to constants.
Open

  YT_PUB_KEY = <<-EOF
Severity: Minor
Found in lib/ll_pay.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Missing top-level module documentation comment.
Open

  module Service
Severity: Minor
Found in lib/ll_pay/service.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

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

require "ll_pay"
Severity: Minor
Found in bin/console by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Severity
Category
Status
Source
Language