Showing 376 of 396 total issues
Function validate_fields
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function validate_fields() {
$is_valid = parent::validate_fields();
if ( $this->supports_tokenization() ) {
- 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
Setting
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
class Setting {
/** @var string the string setting type */
Function process_payment
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function process_payment( $payment_data, $product_id ) {
$order = null;
try {
- 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 perform_capture
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function perform_capture( \WC_Order $order, $amount = null ) {
$order = $this->get_gateway()->get_order_for_capture( $order, $amount );
try {
- 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 get_fields
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_fields( $type = '' ) {
if ( ! $type ) {
$type = $this->get_gateway()->get_payment_type();
}
Lifecycle
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
class Lifecycle {
/** @var array the version numbers that have an upgrade routine */
SV_WC_Payment_Gateway_Direct
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
/**
Function get_tokens
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function get_tokens() {
if ( ! empty( $this->tokens ) ) {
return $this->tokens;
}
- 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 get_incompatible_php_settings
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function get_incompatible_php_settings() {
$incompatible_settings = [];
if ( function_exists( 'ini_get' ) ) {
- 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 enqueue_scripts
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function enqueue_scripts( $hook_suffix ) {
global $post, $theorder;
// Order screen assets
if ( SV_WC_Order_Compatibility::is_order( $post ) || SV_WC_Order_Compatibility::is_order( $theorder ) ) {
- 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 init_form_fields
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function init_form_fields() {
// common top form fields
$this->form_fields = array(
- 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 process_payment
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process_payment( $payment_data, $product_id ) {
$order = null;
try {
SV_WC_Payment_Gateway_Admin_Payment_Token_Editor
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
/** @var SV_WC_Payment_Gateway_Direct the gateway object **/
SV_WC_Payment_Gateway_Integration_Subscriptions
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gateway_Integration {
/** @var string|float renewal payment total for Subs 2.0.x renewals */
Frontend
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
abstract class Frontend extends Script_Handler {
/** @var SV_WC_Payment_Gateway_Plugin $plugin the gateway plugin instance */
Method init_form_fields
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init_form_fields() {
// common top form fields
$this->form_fields = array(
Function constructor
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor( params ) {
let {
plugin_id,
merchant_id,
Function is_plugin_active
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function is_plugin_active( $plugin_name ) {
$is_active = false;
if ( is_string( $plugin_name ) ) {
- 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_capture_button
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function add_capture_button( $order ) {
// only display the button for core orders
if ( ! SV_WC_Order_Compatibility::is_order( $order ) ) {
return;
- 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_ssl_admin_notices
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function add_ssl_admin_notices() {
if ( ! $this->requires_ssl() ) {
return;
}
- 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"