bayetech/ll_pay

View on GitHub

Showing 67 of 67 total issues

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

Use 2 spaces for indentation in a heredoc by using some library(e.g. ActiveSupport's String#strip_heredoc).
Open

-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSS/DiwdCf/aZsxxcacDnooGph3d2JOj5GXWi+
q3gznZauZjkNP8SKl3J2liP0O6rU/Y/29+IUe+GTMhMOFJuZm1htAtKiu5ekW0GlBMWxf4FPkYlQ
kPE0FtaoMP3gYfh+OwI+fIRrpW3ySn3mScnc6Z700nU/VYrRkfcSCbSnRwIDAQAB
-----END PUBLIC KEY-----
Severity: Minor
Found in lib/ll_pay.rb by rubocop

This cops checks the indentation of the here document bodies. The bodies are indented one step. In Ruby 2.3 or newer, squiggly heredocs (<<~) should be used. If you use the older rubies, you should introduce some library to your project (e.g. ActiveSupport, Powerpack or Unindent). Note: When Metrics/LineLength's AllowHeredoc is false(not default), this cop does not add any offenses for long here documents to avoid Metrics/LineLength's offenses.

Example:

# bad
<<-RUBY
something
RUBY

# good
# When EnforcedStyle is squiggly, bad code is auto-corrected to the
# following code.
<<~RUBY
  something
RUBY

# good
# When EnforcedStyle is active_support, bad code is auto-corrected to
# the following code.
<<-RUBY.strip_heredoc
  something
RUBY

Freeze mutable objects assigned to constants.
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 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

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

Use only ascii symbols in comments.
Open

    attr_accessor :rsa_pri_key # 私钥
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

Missing top-level module documentation comment.
Open

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

Missing top-level module documentation comment.
Open

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

Missing top-level module documentation comment.
Open

  module Utils
Severity: Minor
Found in lib/ll_pay/utils.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. [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)

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'

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

Unnecessary utf-8 encoding comment.
Open

# coding: utf-8
Severity: Minor
Found in ll_pay.gemspec by rubocop

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

require "irb"
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"

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/refund_order.rb by rubocop

Missing top-level class documentation comment.
Open

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

        warn("ll_pay Warn: missing required option: #{name}") unless params_keys.include?(name)
Severity: Minor
Found in lib/ll_pay/utils.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
Severity
Category
Status
Source
Language