activemerchant/active_merchant

View on GitHub
lib/active_merchant/billing/gateways/skip_jack.rb

Summary

Maintainability
C
1 day
Test Coverage

File skip_jack.rb has 370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class SkipJackGateway < Gateway
      API_VERSION = '?.?'

Severity: Minor
Found in lib/active_merchant/billing/gateways/skip_jack.rb - About 4 hrs to fix

    Class SkipJackGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class SkipJackGateway < Gateway
          API_VERSION = '?.?'
    
          self.live_url = 'https://www.skipjackic.com'
          self.test_url = 'https://developer.skipjackic.com'
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/skip_jack.rb - About 3 hrs to fix

      Method message_from_authorization has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def message_from_authorization(response)
              if response[:success]
                return SUCCESS_MESSAGE
              else
                return CARD_CODE_MESSAGES[response[:szCVV2ResponseCode]] if CARD_CODE_ERRORS.include?(response[:szCVV2ResponseCode])
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/skip_jack.rb - About 45 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

      Avoid too many return statements within this method.
      Open

                return response[:szAuthorizationDeclinedMessage]
      Severity: Major
      Found in lib/active_merchant/billing/gateways/skip_jack.rb - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status