Showing 376 of 396 total issues
File class-sv-wc-payment-gateway.php
has 1556 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Payment Gateway Framework
*
* This source file is subject to the GNU General Public License v3.0
SV_WC_Payment_Gateway
has 170 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
/** Sends through sale and request for funds to be charged to cardholder's credit card. */
Function get_tokens
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
public function get_tokens( $user_id, $args = array() ) {
// default to current environment
if ( ! isset( $args['environment_id'] ) ) {
$args['environment_id'] = $this->get_environment_id();
- 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
SV_WC_Plugin
has 71 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
abstract class SV_WC_Plugin {
/** Plugin Framework Version */
File class-sv-wc-payment-gateway-direct.php
has 579 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Payment Gateway Framework
*
* This source file is subject to the GNU General Public License v3.0
File class-sv-wc-payment-gateway-plugin.php
has 568 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Payment Gateway Framework
*
* This source file is subject to the GNU General Public License v3.0
File abstract-sv-wc-plugin-admin-setup-wizard.php
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Plugin Framework
*
* This source file is subject to the GNU General Public License v3.0
SV_WC_Payment_Gateway_Plugin
has 63 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
/** Customer ID feature */
File class-sv-wc-payment-gateway-payment-tokens-handler.php
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Payment Gateway Framework
*
* This source file is subject to the GNU General Public License v3.0
Setup_Wizard
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
abstract class Setup_Wizard {
/** the "finish" step ID */
Function add_transaction_data
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public function add_transaction_data( $order, $response = null ) {
// transaction id if available
if ( $response && $response->get_transaction_id() ) {
- 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
File class-sv-wc-plugin.php
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Plugin Framework
*
* This source file is subject to the GNU General Public License v3.0
File Country_Helper.php
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Plugin Framework
*
* This source file is subject to the GNU General Public License v3.0
SV_WC_Payment_Gateway_My_Payment_Methods
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
class SV_WC_Payment_Gateway_My_Payment_Methods extends Handlers\Script_Handler {
/** @var SV_WC_Payment_Gateway_Plugin */
File class-sv-wc-helper.php
has 427 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Plugin Framework
*
* This source file is subject to the GNU General Public License v3.0
File class-sv-wc-payment-gateway-payment-form.php
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Payment Gateway Framework
*
* This source file is subject to the GNU General Public License v3.0
SV_WC_API_Base
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
abstract class SV_WC_API_Base {
/** @var string request method, defaults to POST */
File class-sv-wp-background-job-handler.php
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WooCommerce Plugin Framework
*
* This source file is subject to the GNU General Public License v3.0
Function array_to_xml
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public static function array_to_xml( $xml_writer, $element_key, $element_value = array() ) {
if ( is_array( $element_value ) ) {
// handle attributes
- 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
Function add_gateway_not_configured_notices
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
protected function add_gateway_not_configured_notices() {
$is_enhanced_admin_available = SV_WC_Plugin_Compatibility::is_enhanced_admin_available();
foreach ( $this->get_gateways() as $gateway ) {
- 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"