mercadopago/cart-wp-commerce

View on GitHub

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
Severity: Major
Found in wpecomm-mercado-pago-module/mercadopago-custom.php - About 3 days to fix

    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
    Severity: Major
    Found in wpecomm-mercado-pago-module/mercadopago-basic.php - About 2 days to fix

      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
      Severity: Major
      Found in wpecomm-mercado-pago-module/mercadopago-ticket.php - About 2 days to fix

        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'),
        Severity: Major
        Found in wpecomm-mercado-pago-module/mercadopago-basic.php - About 1 day to fix

          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(
          Severity: Major
          Found in wpecomm-mercado-pago-module/mercadopago-custom.php - About 1 day to fix

            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
            Severity: Minor
            Found in wpecomm-mercado-pago-module/mercadopago-basic.php - About 1 day 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

            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
            Severity: Major
            Found in wpecomm-mercado-pago-module/mercadopago-basic.php - About 1 day to fix

              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(
              Severity: Major
              Found in wpecomm-mercado-pago-module/mercadopago-ticket.php - About 1 day to fix

                File MPv1.js has 520 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // MPv1
                // Handlers Form Mercado Pago v1
                
                (function (){
                
                
                Severity: Major
                Found in wpecomm-mercado-pago-module/mercadopago-lib/MPv1.js - About 1 day to fix

                  File mercadopago.php has 517 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * MercadoPago Integration Library
                   * Access MercadoPago for payments integration
                  Severity: Major
                  Found in wpecomm-mercado-pago-module/mercadopago-lib/mercadopago.php - About 1 day to fix

                    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 .
                    Severity: Major
                    Found in wpecomm-mercado-pago-module/mercadopago-custom.php - About 7 hrs to fix

                      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 .
                      Severity: Minor
                      Found in wpecomm-mercado-pago-module/mercadopago-ticket.php - About 7 hrs 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

                      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 .
                      Severity: Minor
                      Found in wpecomm-mercado-pago-module/mercadopago-custom.php - About 7 hrs 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

                      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 .
                      Severity: Major
                      Found in wpecomm-mercado-pago-module/mercadopago-ticket.php - About 7 hrs to fix

                        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(
                        Severity: Major
                        Found in wpecomm-mercado-pago-module/mercadopago-custom.php - About 6 hrs to fix

                          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(
                          Severity: Minor
                          Found in wpecomm-mercado-pago-module/mercadopago-custom.php - About 5 hrs 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

                          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'])) {
                          Severity: Minor
                          Found in wpecomm-mercado-pago-module/mercadopago-basic.php - About 4 hrs 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

                          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.");
                                  }
                          
                          
                          Severity: Minor
                          Found in wpecomm-mercado-pago-module/mercadopago-lib/mercadopago.php - About 4 hrs 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

                          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.");
                                  }
                          
                          
                          Severity: Minor
                          Found in wpecomm-mercado-pago-module/mercadopago-lib/mercadopago.php - About 4 hrs 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

                          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;
                          Severity: Minor
                          Found in wpecomm-mercado-pago-module/mercadopago-ticket.php - About 4 hrs 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

                          Severity
                          Category
                          Status
                          Source
                          Language