Showing 90 of 163 total issues
File mercadopago-custom.php
has 1371 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of WPeComm Mercado Pago Module
* Author - Mercado Pago
File mercadopago-basic.php
has 1110 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of WPeComm Mercado Pago Module
* Author - Mercado Pago
File mercadopago-ticket.php
has 990 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of WPeComm Mercado Pago Module
* Author - Mercado Pago
Method form_mercadopago_basic
has 309 lines of code (exceeds 25 allowed). Consider refactoring. Open
function form_mercadopago_basic() {
global $wpdb, $wpsc_gateways;
$result = validateCredentials(
get_option('mercadopago_certified_clientid'),
Method form_mercadopago_custom
has 280 lines of code (exceeds 25 allowed). Consider refactoring. Open
function form_mercadopago_custom() {
global $wpdb, $wpsc_gateways;
// labels
$form_labels = array(
Function function_mercadopago_basic
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
function function_mercadopago_basic($seperator, $sessionid) {
global $wpdb, $wpsc_cart;
// this grabs the purchase log id from the database that refers to the $sessionid
- 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 function_mercadopago_basic
has 215 lines of code (exceeds 25 allowed). Consider refactoring. Open
function function_mercadopago_basic($seperator, $sessionid) {
global $wpdb, $wpsc_cart;
// this grabs the purchase log id from the database that refers to the $sessionid
Method form_mercadopago_ticket
has 212 lines of code (exceeds 25 allowed). Consider refactoring. Open
function form_mercadopago_ticket() {
global $wpdb, $wpsc_gateways;
// labels
$form_labels = array(
File MPv1.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
// MPv1
// Handlers Form Mercado Pago v1
(function (){
File mercadopago.php
has 517 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MercadoPago Integration Library
* Access MercadoPago for payments integration
Method create_preference
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_preference($wpdb, $wpsc_cart, $form_labels) {
// this grabs the purchase log id from the database that refers to the $sessionid
$purchase_log = $wpdb->get_row(
"SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS .
Function create_preference
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function create_preference($wpdb, $wpsc_cart, $form_labels) {
// this grabs the purchase log id from the database that refers to the $sessionid
$purchase_log = $wpdb->get_row(
"SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS .
- 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 create_preference
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function create_preference($wpdb, $wpsc_cart, $form_labels) {
// this grabs the purchase log id from the database that refers to the $sessionid
$purchase_log = $wpdb->get_row(
"SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS .
- 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 create_preference
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_preference($wpdb, $wpsc_cart, $form_labels) {
// this grabs the purchase log id from the database that refers to the $sessionid
$purchase_log = $wpdb->get_row(
"SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS .
Method submit
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
function submit() {
global $wpdb, $wpsc_cart;
// labels
$form_labels = json_decode(stripslashes(
Function submit
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function submit() {
global $wpdb, $wpsc_cart;
// labels
$form_labels = json_decode(stripslashes(
- 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 submit_mercadopago_basic
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
function submit_mercadopago_basic() {
if (isset($_POST['mercadopago_certified_clientid'])) {
update_option('mercadopago_certified_clientid', trim($_POST['mercadopago_certified_clientid']));
}
if (isset($_POST['mercadopago_certified_clientsecret'])) {
- 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 build_request_ml
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private static function build_request_ml($request) {
if (!extension_loaded ("curl")) {
throw new MercadoPagoException("cURL extension not found. You need to enable cURL in your php.ini or another configuration you have.");
}
- 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 build_request
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private static function build_request($request) {
if (!extension_loaded ("curl")) {
throw new MercadoPagoException("cURL extension not found. You need to enable cURL in your php.ini or another configuration you have.");
}
- 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 validateCredentials_ticket
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
function validateCredentials_ticket($access_token) {
$result = array();
if (empty($access_token)) {
$result['site_id'] = null;
$result['is_valid'] = false;
- 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"