Showing 31 of 38 total issues
File mercadopago.php
has 844 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Mercado Pago plugin
*
* @author Developers Mercado Pago <modulos@mercadopago.com>
File mercadopago_checkout_custom.php
has 786 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
defined('_JEXEC') or die('Restricted access');
/**
File mercadopago.php
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MercadoPago Integration Library
* Access MercadoPago for payments integration
*
Function exec
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private static function exec($request) {
// private static function exec($method, $uri, $data, $content_type) {
$connect = self::build_request($request);
- 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 plgVmDisplayListFEPayment
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn) {
$htmla = array();
$pm;
- 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
plgVmPaymentMercadoPago
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class plgVmPaymentMercadoPago extends vmPSPlugin {
private $mercadopago_payment_status;
function __construct(&$subject, $config) {
Function build_request
has a Cognitive Complexity of 31 (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 _actionAnalytics
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function _actionAnalytics($data){
$type = "none";
switch ($data['mercadopago_product_checkout']) {
case 'basic_checkout':
- 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 paymentNotificationBasic
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function paymentNotificationBasic($payment_method){
$status_http = "HTTP/1.1 200 OK";
if(isset($_REQUEST['topic']) && isset($_REQUEST['id']) && !is_null($_REQUEST['id'])){
if($_REQUEST['topic'] == "merchant_order"){
- 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 plgVmDisplayListFEPayment
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn) {
$htmla = array();
$pm;
MP
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class MP {
const version = "0.5.2";
private $client_id;
Function setVariablesMP
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function setVariablesMP($payment_method){
$sponsor_id = "";
$site_id = "";
$mercadopago;
- 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 setVariablesMP
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setVariablesMP($payment_method){
$sponsor_id = "";
$site_id = "";
$mercadopago;
Method build_request
has 62 lines of code (exceeds 25 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.");
}
Method _actionAnalytics
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _actionAnalytics($data){
$type = "none";
switch ($data['mercadopago_product_checkout']) {
case 'basic_checkout':
Method postPreferenceCheckout
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function postPreferenceCheckout($cart, $order, $payment_method){
$this->logInfo('--------------------------------------', 'debug');
$this->logInfo('Create Preference: ' . date("Y-m-d H:i:s"), 'debug');
$this->logInfo('Order Data: ' . json_encode($order['details']), 'debug');
Method postCreditCardPaymentV1
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function postCreditCardPaymentV1($cart, $order, $payment_method){
// DELETE
// require(VMPATH_ROOT . DS.'plugins'.DS.'vmpayment'.DS.'mercadopago'.DS.'mercadopago'.DS.'lib'.DS.'test.php');
Method exec
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function exec($request) {
// private static function exec($method, $uri, $data, $content_type) {
$connect = self::build_request($request);
Method __construct
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct(&$subject, $config) {
parent::__construct($subject, $config);
$this->_loggable = TRUE;
Function updateStatusOrder
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function updateStatusOrder($payment_method, $order_id, $status, $payment){
$status_http = "HTTP/1.1 200 OK";
$orderModel=VmModel::getModel('orders');
$order = $orderModel->getOrder($order_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"