felixarntz/theme-boilerplate

View on GitHub

Showing 153 of 194 total issues

Function S2 has 4921 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var S2 =(function () {
  // Restore the Select2 AMD loader so it can be used
  // Needed mostly in the language files, where the loader is not inserted
  if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
    var S2 = jQuery.fn.select2.amd;
Severity: Major
Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 3 wks to fix

    File selectWoo.full.js has 4948 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * SelectWoo 1.0.1
     * https://github.com/woocommerce/selectWoo
     *
     * Released under the MIT license
    Severity: Major
    Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 2 wks to fix

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

      <?php
      /**
       * Super_Awesome_Theme_Colors class
       *
       * @package Super_Awesome_Theme
      Severity: Major
      Found in inc/library/colors/class-colors.php - About 1 day 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/vendor/selectWoo/dist/js/selectWoo.full.js - About 7 hrs to fix

          Function bind has 166 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Results.prototype.bind = function (container, $container) {
              var self = this;
          
              var id = container.id + '-results';
          
          
          Severity: Major
          Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 6 hrs to fix

            Function get_for_post has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get_for_post( $post = null ) {
                    $post = get_post( $post );
                    if ( ! $post ) {
                        return false;
                    }
            Severity: Minor
            Found in inc/library/content-types/class-attachment-metadata.php - About 6 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 print_base_color_style_general has 134 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function print_base_color_style_general() {
                    $text_color            = $this->get( 'text_color' );
                    $text_focus_color      = $this->util()->darken_color( $text_color, 25 );
                    $text_light_color      = $this->util()->lighten_color( $text_color, 100 );
                    $link_color            = $this->get( 'link_color' );
            Severity: Major
            Found in inc/library/colors/class-colors.php - About 5 hrs to fix

              Method register_default_families has 102 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function register_default_families() {
                      $families = array(
              
                          // System fonts.
                          new Super_Awesome_Theme_Font_Family( 'system', array(
              Severity: Major
              Found in inc/library/fonts/class-font-families.php - About 4 hrs to fix

                File class-content-types.php has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Super_Awesome_Theme_Content_Types class
                 *
                 * @package Super_Awesome_Theme
                Severity: Minor
                Found in inc/library/content-types/class-content-types.php - About 3 hrs to fix

                  Function initializeFontFamilySelect has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          initializeFontFamilySelect: function( $element ) {
                              const selectData   = {};
                              const includedData = {};
                              const excludedData = {};
                              const settingValue = this.setting.get();
                  Severity: Major
                  Found in assets/src/js/fonts.customize-controls.js - About 3 hrs to fix

                    File gulpfile.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* ---- THE FOLLOWING CONFIG SHOULD BE EDITED ---- */
                    
                    const pkg = require( './package.json' );
                    
                    const tags = [
                    Severity: Minor
                    Found in gulpfile.js - About 3 hrs to fix

                      Function initializeCommentForm has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          initializeCommentForm( commentForm, comments, statusDiv ) {
                              const options = this.options;
                      
                              if ( ! commentForm ) {
                                  return;
                      Severity: Major
                      Found in assets/src/js/theme/comment-form.js - About 3 hrs to fix

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

                        <?php
                        /**
                         * Super_Awesome_Theme_Fonts class
                         *
                         * @package Super_Awesome_Theme
                        Severity: Minor
                        Found in inc/library/fonts/class-fonts.php - About 3 hrs to fix

                          Method render_form_field has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function render_form_field( $id, $args, $value ) {
                                  $control_id     = $this->get_field_id( $id );
                                  $control_name   = $this->get_field_name( $id );
                                  $type           = $args[ self::FIELD_ARG_TYPE ];
                                  $title          = $args[ self::FIELD_ARG_TITLE ];
                          Severity: Major
                          Found in inc/library/widgets/class-widget.php - About 3 hrs to fix

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

                                protected function calculate_content_image_sizes( $sizes, $size ) {
                                    $settings = $this->get_dependency( 'settings' );
                                    $sidebar  = $this->get_dependency( 'sidebar' );
                            
                                    $rem         = 16;
                            Severity: Minor
                            Found in inc/library/image-sizes/class-image-sizes.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 initializeCommentForm has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                                initializeCommentForm( commentForm, comments, statusDiv ) {
                                    const options = this.options;
                            
                                    if ( ! commentForm ) {
                                        return;
                            Severity: Minor
                            Found in assets/src/js/theme/comment-form.js - 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 bind has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              Search.prototype.bind = function (decorated, container, $container) {
                                var self = this;
                                var resultsId = container.id + '-results';
                            
                                decorated.call(this, container, $container);
                            Severity: Major
                            Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 3 hrs to fix

                              Function _registerEvents has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                Select2.prototype._registerEvents = function () {
                                  var self = this;
                              
                                  this.on('open', function () {
                                    self.$container.addClass('select2-container--open');
                              Severity: Major
                              Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 3 hrs to fix

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

                                    public function add_control( $setting_id, $control_args = array() ) {
                                        if ( ! isset( $this->wp_customize ) ) {
                                            throw Super_Awesome_Theme_Customizer_Not_Loaded_Exception::from_method_and_id( __METHOD__, $setting_id );
                                        }
                                
                                
                                Severity: Minor
                                Found in inc/library/customizer/class-customizer.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 register_customize_partials has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function register_customize_partials( $customizer ) {
                                        $customizer->add_panel( 'content_types', array(
                                            Super_Awesome_Theme_Customize_Panel::PROP_TITLE    => __( 'Content Types', 'super-awesome-theme' ),
                                            Super_Awesome_Theme_Customize_Panel::PROP_PRIORITY => 140,
                                        ) );
                                Severity: Major
                                Found in inc/library/content-types/class-content-types.php - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language