Showing 1,501 of 1,501 total issues
Class MitGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class MitGateway < Gateway
self.live_url = 'https://wpy.mitec.com.mx/ModuloUtilWS/activeCDP.htm'
self.test_url = 'https://scqa.mitec.com.mx/ModuloUtilWS/activeCDP.htm'
self.supported_countries = ['MX']
Class InspireGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class InspireGateway < Gateway
self.live_url = self.test_url = 'https://secure.inspiregateway.net/api/transact.php'
self.supported_countries = ['US']
self.supported_cardtypes = %i[visa master american_express]
Class ModernPaymentsCimGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ModernPaymentsCimGateway < Gateway #:nodoc:
self.test_url = 'https://secure.modpay.com/netservices/test/ModpayTest.asmx'
self.live_url = 'https://secure.modpay.com/ws/modpay.asmx'
LIVE_XMLNS = 'https://secure.modpay.com/ws/'
Class WepayGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class WepayGateway < Gateway
self.test_url = 'https://stage.wepayapi.com/v2'
self.live_url = 'https://wepayapi.com/v2'
self.supported_countries = %w[US CA]
Class ItransactGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ItransactGateway < Gateway
self.live_url = self.test_url = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltrans2.cgi'
# The countries the gateway supports merchants from as 2 digit ISO country codes
self.supported_countries = ['US']
Class SoEasyPayGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class SoEasyPayGateway < Gateway
self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
self.money_format = :cents
self.supported_countries = %w[
Similar blocks of code found in 2 locations. Consider refactoring. Open
first_name, last_name = split_names(billing_address[:name])
add_pair(post, :BillingSurname, truncate(last_name, 20))
add_pair(post, :BillingFirstnames, truncate(first_name, 20))
add_pair(post, :BillingAddress1, truncate(billing_address[:address1], 100))
add_pair(post, :BillingAddress2, truncate(billing_address[:address2], 100))
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
PAYMENT_GATEWAY_RESPONSES = {
'P01' => 'AVS Mismatch Failure',
'P02' => 'CVV2 Mismatch Failure',
'P21' => 'Transaction may not be marked',
'P30' => 'Test Tran. Bad Card',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
first_name, last_name = split_names(shipping_address[:name])
add_pair(post, :DeliverySurname, truncate(last_name, 20))
add_pair(post, :DeliveryFirstnames, truncate(first_name, 20))
add_pair(post, :DeliveryAddress1, truncate(shipping_address[:address1], 100))
add_pair(post, :DeliveryAddress2, truncate(shipping_address[:address2], 100))
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
TRANSACTION_RESPONSE_CODES = {
'00' => 'Success',
'1' => 'Transaction blocked by issuer',
'4' => 'Pick up card and deny transaction',
'5' => 'Problem with the account',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File data_cash.rb
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/core_ext/string/access'
module ActiveMerchant
module Billing
class DataCashGateway < Gateway
Method build_xml_request
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_xml_request(action, data)
xml = Builder::XmlMarkup.new indent: 2
xml.Request(version: '1.0') do
xml.Header do
xml.Security(sender: @options[:sender], type: 'MERCHANT')
File optimal_payment.rb
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class OptimalPaymentGateway < Gateway
self.test_url = 'https://webservices.test.optimalpayments.com/creditcardWS/CreditCardServlet/v1'
self.live_url = 'https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1'
File qvalent.rb
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class QvalentGateway < Gateway
self.display_name = 'Qvalent'
self.homepage_url = 'https://www.qvalent.com/'
Method add_payment_profile
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_payment_profile(xml, payment_profile)
# 'individual' or 'business' (optional)
xml.tag!('customerType', payment_profile[:customer_type]) if payment_profile[:customer_type]
if payment_profile[:bill_to]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method add_billing_address
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_billing_address(xml, payment_source, options)
address = options[:billing_address] || options[:address] || {}
xml.billTo do
first_name, last_name = names_from(payment_source, address, options)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method add_address
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_address(xml, address, options)
return unless address
address = address_with_defaults(address)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method build_merchant_mpi_external
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def build_merchant_mpi_external(xml, data)
return unless data[:txid] || data[:threeDSServerTransID]
ds_merchant_mpi_external = {}
ds_merchant_mpi_external[:TXID] = data[:txid] if data[:txid]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def parse(action, soap)
xml = REXML::Document.new(soap)
root = REXML::XPath.first(xml, '//SOAP-ENV:Body')
response = root ? parse_element(root[0]) : { response: soap }
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method add_lodging_data
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_lodging_data(post, options)
return unless lodging_options = options[:lodging_data]
lodging_data = {}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"