yurijmi/better_offsite_payments

View on GitHub
lib/offsite_payments/integrations/wirecard_checkout_page.rb

Summary

Maintainability
B
7 hrs
Test Coverage

Method verify_response has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        def verify_response(params, secret)
          logstr = ''
          params.each { |key, value|
            logstr += "#{key} #{value}\n"
          }
Severity: Minor
Found in lib/offsite_payments/integrations/wirecard_checkout_page.rb - About 2 hrs to fix

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

File wirecard_checkout_page.rb has 262 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module OffsitePayments #:nodoc:
  module Integrations #:nodoc:
    # Shop System Plugins - Terms of use
    #
    # This terms of use regulates warranty and liability between Wirecard Central Eastern Europe (subsequently referred to as WDCEE) and it's
Severity: Minor
Found in lib/offsite_payments/integrations/wirecard_checkout_page.rb - About 2 hrs to fix

    Method verify_response has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def verify_response(params, secret)
              logstr = ''
              params.each { |key, value|
                logstr += "#{key} #{value}\n"
              }
    Severity: Minor
    Found in lib/offsite_payments/integrations/wirecard_checkout_page.rb - About 1 hr to fix

      Method add_standard_fields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

              def add_standard_fields
                addfields = {}
                addfields['shopId'] = @shop_id if !@shop_id.blank?
                addfields['paymentType'] = @paymenttype
      
      
      Severity: Minor
      Found in lib/offsite_payments/integrations/wirecard_checkout_page.rb - About 35 mins to fix

      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 response has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

              def response(umessage = nil)
                if @message || umessage
                  '<QPAY-CONFIRMATION-RESPONSE result="NOK" message="' + CGI.escapeHTML(umessage ? umessage : @message) + '"/>'
                else
                  '<QPAY-CONFIRMATION-RESPONSE result="OK"/>'
      Severity: Minor
      Found in lib/offsite_payments/integrations/wirecard_checkout_page.rb - About 25 mins to fix

      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

      There are no issues that match your filters.

      Category
      Status