woothemes/woocommerce

View on GitHub

Showing 3,141 of 4,341 total issues

Method get_item_schema has 194 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get_item_schema() {
        $schema = array(
            '$schema'    => 'http://json-schema.org/draft-04/schema#',
            'title'      => $this->post_type,
            'type'       => 'object',

    Method get_settings has 193 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_settings() {
            $erasure_text = esc_html__( 'account erasure request', 'woocommerce' );
            $privacy_text = esc_html__( 'privacy page', 'woocommerce' );
            if ( current_user_can( 'manage_privacy_options' ) ) {
                if ( version_compare( get_bloginfo( 'version' ), '5.3', '<' ) ) {
    Severity: Major
    Found in includes/admin/settings/class-wc-settings-accounts.php - About 7 hrs to fix

      Function apply has 191 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Defaults.prototype.apply = function (options) {
          options = $.extend(true, {}, this.defaults, options);
      
          if (options.dataAdapter == null) {
            if (options.ajax != null) {
      Severity: Major
      Found in assets/js/select2/select2.js - About 7 hrs to fix

        Function apply has 191 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Defaults.prototype.apply = function (options) {
            options = $.extend(true, {}, this.defaults, options);
        
            if (options.dataAdapter == null) {
              if (options.ajax != null) {
        Severity: Major
        Found in assets/js/select2/select2.full.js - About 7 hrs to fix

          Function apply has 191 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Defaults.prototype.apply = function (options) {
              options = $.extend(true, {}, this.defaults, options);
          
              if (options.dataAdapter == null) {
                if (options.ajax != null) {
          Severity: Major
          Found in assets/js/selectWoo/selectWoo.full.js - About 7 hrs to fix

            Function apply has 191 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              Defaults.prototype.apply = function (options) {
                options = $.extend(true, {}, this.defaults, options);
            
                if (options.dataAdapter == null) {
                  if (options.ajax != null) {
            Severity: Major
            Found in assets/js/selectWoo/selectWoo.js - About 7 hrs to fix

              Function exports has 190 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function( grunt ) {
                  'use strict';
                  var sass = require( 'node-sass' );
              
                  grunt.initConfig({
              Severity: Major
              Found in Gruntfile.js - About 7 hrs to fix

                Method register_post_types has 190 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function register_post_types() {
                        if ( ! is_blog_installed() || post_type_exists( 'product' ) ) {
                            return;
                        }
                
                
                Severity: Major
                Found in includes/class-wc-post-types.php - About 7 hrs to fix

                  Method get_main_chart has 189 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function get_main_chart() {
                          global $wp_locale;
                  
                          if ( empty( $this->product_ids ) ) {
                              ?>
                  Severity: Major
                  Found in includes/admin/reports/class-wc-report-sales-by-product.php - About 7 hrs to fix

                    Function drawSeriesLines has 187 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function drawSeriesLines(series) {
                                function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                                    var points = datapoints.points,
                                        ps = datapoints.pointsize,
                                        prevx = null, prevy = null;
                    Severity: Major
                    Found in assets/js/jquery-flot/jquery.flot.js - About 7 hrs to fix

                      File class-wc-api-customers.php has 477 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * WooCommerce API Customers Class
                       *
                       * Handles requests to the /customers endpoint
                      Severity: Minor
                      Found in includes/legacy/api/v2/class-wc-api-customers.php - About 7 hrs to fix

                        File class-woocommerce.php has 473 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * WooCommerce setup
                         *
                         * @package WooCommerce
                        Severity: Minor
                        Found in includes/class-woocommerce.php - About 7 hrs to fix

                          File class-wc-rest-webhooks-v1-controller.php has 472 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * REST API Webhooks controller
                           *
                           * Handles requests to the /webhooks endpoint.

                            File class-wc-rest-legacy-products-controller.php has 471 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * REST API Legacy Products controller
                             *
                             * Handles requests to the /products endpoint.
                            Severity: Minor
                            Found in includes/legacy/api/class-wc-rest-legacy-products-controller.php - About 7 hrs to fix

                              File class-wc-report-coupon-usage.php has 468 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * Coupon usage report functionality
                               *
                               * @package WooCommerce\Admin\Reports
                              Severity: Minor
                              Found in includes/admin/reports/class-wc-report-coupon-usage.php - About 7 hrs to fix

                                File class-wc-api-customers.php has 468 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /**
                                 * WooCommerce API Customers Class
                                 *
                                 * Handles requests to the /customers endpoint
                                Severity: Minor
                                Found in includes/legacy/api/v3/class-wc-api-customers.php - About 7 hrs to fix

                                  Method get_main_chart has 180 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function get_main_chart() {
                                          $query_data = array(
                                              '_order_tax'          => array(
                                                  'type'     => 'meta',
                                                  'function' => 'SUM',
                                  Severity: Major
                                  Found in includes/admin/reports/class-wc-report-taxes-by-date.php - About 7 hrs to fix

                                    File class-wc-frontend-scripts.php has 466 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    <?php
                                    /**
                                     * Handle frontend scripts
                                     *
                                     * @package WooCommerce\Classes
                                    Severity: Minor
                                    Found in includes/class-wc-frontend-scripts.php - About 7 hrs to fix

                                      Method widget has 179 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function widget( $args, $instance ) {
                                              global $wp_query, $post;
                                      
                                              $count              = isset( $instance['count'] ) ? $instance['count'] : $this->settings['count']['std'];
                                              $hierarchical       = isset( $instance['hierarchical'] ) ? $instance['hierarchical'] : $this->settings['hierarchical']['std'];
                                      Severity: Major
                                      Found in includes/widgets/class-wc-widget-product-categories.php - About 7 hrs to fix

                                        Method prepare_item_for_response has 178 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function prepare_item_for_response( $post, $request ) {
                                                $order = wc_get_order( $post );
                                                $dp    = is_null( $request['dp'] ) ? wc_get_price_decimals() : absint( $request['dp'] );
                                        
                                                $data = array(
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language