tuhin18003/WooCommerce-AltCoin-Payment-Gateway

View on GitHub

Showing 92 of 92 total issues

Method altCoinCustomScript has 301 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function altCoinCustomScript() {
        global $woocommerce;

        ?>
            <script type="text/javascript">
Severity: Major
Found in core/frontend/scripts/CsWapgScript.php - About 1 day to fix

    Method add_new_coin has 222 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function add_new_coin( $args ) {
    
            $coin_data      = '';
            $coin_addresses = array();
            $hidden_block   = ' hidden ';
    Severity: Major
    Found in core/admin/options/pages/addNewCoin.php - About 1 day to fix

      Method track_coin has 139 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function track_coin( $raw_data ) {
              global $woocommerce;
      
              $raw_data = $raw_data['form_data'];
              $data     = array();
      Severity: Major
      Found in core/frontend/functions/CsWapgAutoOrderConfirm.php - About 5 hrs to fix

        Method calcualteCoinPrice has 137 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function calcualteCoinPrice() {
                global $woocommerce;
        
                $coin_id = Util::check_evil_script( ( $_POST['data']['coin_id'] ) );
                if ( empty( $coin_id ) ) {
        Severity: Major
        Found in core/frontend/functions/CsWapgCoinCal.php - About 5 hrs to fix

          Method generate_settings has 117 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function generate_settings( $args ) {
          
                  $settings_data = CsAutomaticOrderConfirmationSettings::get_order_confirm_settings_data();
                  $fields        = array(
                      'cs_altcoin_config[cms_username]'       => array(
          Severity: Major
          Found in core/admin/options/pages/autoOrderSettings.php - About 4 hrs to fix

            File CsAdminQuery.php has 338 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php namespace WooGateWayCoreLib\admin\functions;
            
            /**
             * Retrive Settings Data
             *
            Severity: Minor
            Found in core/admin/functions/CsAdminQuery.php - About 4 hrs to fix

              Method add_new_coin has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function add_new_coin( $user_data ) {
                      global $wpdb, $wapg_tables;
                      $coin_info = Util::check_evil_script( $user_data['cs_add_new'] );
              
                      if ( empty( $coin_info['coin_address'] ) || empty( $coin_info['checkout_type'] ) || empty( $coin_info['coin_name'] ) ) {
              Severity: Major
              Found in core/admin/functions/CsAdminQuery.php - About 3 hrs to fix

                File CsWapgScript.php has 314 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php namespace WooGateWayCoreLib\frontend\scripts;
                
                /**
                 * Frontend Script
                 *
                Severity: Minor
                Found in core/frontend/scripts/CsWapgScript.php - About 3 hrs to fix

                  Method cs_register_wapg_menu has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function cs_register_wapg_menu() {
                          global $altcoin_menu;
                          add_menu_page(
                              __( 'WooAltCoin Payment', 'woo-altcoin-payment-gateway' ),
                              'AltCoin Payment',
                  Severity: Major
                  Found in core/actions/RegisterCustomMenu.php - About 3 hrs to fix

                    Method generate_checkout_settings has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function generate_checkout_settings( $args ) {
                            $settings = CsPaymentGateway::get_checkout_page_options();
                    
                            $fields = array(
                                'st1'                                        => array(
                    Severity: Major
                    Found in core/admin/options/pages/checkoutPageSettings.php - About 3 hrs to fix

                      Function generate_field has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function generate_field( $field_name, $field, $field_id ) {
                              $input  = '<div class="label"><label>';
                              $input .= $this->generate_title( $field );
                              $input .= '</label></div>';
                              $input .= '<div class="input-group">';
                      Severity: Minor
                      Found in core/admin/builders/CsFormBuilder.php - About 3 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 track_coin has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function track_coin( $raw_data ) {
                              global $woocommerce;
                      
                              $raw_data = $raw_data['form_data'];
                              $data     = array();
                      Severity: Minor
                      Found in core/frontend/functions/CsWapgAutoOrderConfirm.php - About 3 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 calcualteCoinPrice has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function calcualteCoinPrice() {
                              global $woocommerce;
                      
                              $coin_id = Util::check_evil_script( ( $_POST['data']['coin_id'] ) );
                              if ( empty( $coin_id ) ) {
                      Severity: Minor
                      Found in core/frontend/functions/CsWapgCoinCal.php - About 3 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 generate_product_options_settings has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function generate_product_options_settings( $args ) {
                      
                              $fields = array(
                                  'st1'                                     => array(
                                      'type'     => 'section_title',
                      Severity: Major
                      Found in core/admin/options/pages/productPageOptions.php - About 3 hrs to fix

                        Function check_db_status has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function check_db_status() {
                                global $wapg_current_db_version, $wpdb, $wapg_tables;
                                $get_installed_db_version = get_site_option( 'wapg_db_version' );
                                if ( empty( $get_installed_db_version ) ) {
                                    self::on_activate();
                        Severity: Minor
                        Found in core/install/Activate.php - About 3 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 udpate_coin has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function udpate_coin( $user_data ) {
                                global $wpdb, $wapg_tables;
                                $coin_info           = Util::check_evil_script( $user_data['cs_add_new'] );
                                $more_address_fields = Util::check_evil_script( $user_data['more_coin_address'] );
                        
                        
                        Severity: Major
                        Found in core/admin/functions/CsAdminQuery.php - About 2 hrs to fix

                          Method generate_default_settings has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function generate_default_settings( $args ) {
                          
                                  $settings = isset( $args['gateway_settings'] ) ? (object) $args['gateway_settings'] : '';
                                  $option   = isset( $settings->defaultOptn ) ? $settings->defaultOptn : '';
                          
                          
                          Severity: Major
                          Found in core/admin/options/pages/defaultSettings.php - About 2 hrs to fix

                            Util has 24 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Util {
                            
                            
                                /**
                                 * Encode Html Entites
                            Severity: Minor
                            Found in core/lib/Util.php - About 2 hrs to fix

                              Function widget_get_live_coin_prices has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function widget_get_live_coin_prices( $user_data ) {
                              
                                      // get widget options
                                      $widget_options = CsSaveWidgetOptions::get_widget_options();
                              
                              
                              Severity: Minor
                              Found in core/frontend/functions/widgets/CsWidgets.php - About 2 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

                              CsFormBuilder has 23 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class CsFormBuilder {
                              
                                  /**
                                   * Generate html form fields
                                   *
                              Severity: Minor
                              Found in core/admin/builders/CsFormBuilder.php - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language