gocodebox/lifterlms

View on GitHub
includes/abstracts/abstract.llms.payment.gateway.php

Summary

Maintainability
C
1 day
Test Coverage
C
79%

LLMS_Payment_Gateway has 42 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class LLMS_Payment_Gateway extends LLMS_Abstract_Options_Data {

    /**
     * Optional gateway description for the admin panel
     *
Severity: Minor
Found in includes/abstracts/abstract.llms.payment.gateway.php - About 5 hrs to fix

    File abstract.llms.payment.gateway.php has 315 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * LifterLMS Payment Gateways Abstract
     *
     * @package LifterLMS/Abstracts/Classes
    Severity: Minor
    Found in includes/abstracts/abstract.llms.payment.gateway.php - About 3 hrs to fix

      Method get_admin_settings_fields has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function get_admin_settings_fields() {
      
              $fields = array();
      
              $fields[] = array(
      Severity: Minor
      Found in includes/abstracts/abstract.llms.payment.gateway.php - About 1 hr to fix

        Function retrieve_secure_strings has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function retrieve_secure_strings() {
        
                $gateway_strings = $this->secure_strings;
                foreach ( $this->get_admin_settings_fields() as $field ) {
        
        
        Severity: Minor
        Found in includes/abstracts/abstract.llms.payment.gateway.php - 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

        There are no issues that match your filters.

        Category
        Status