soderlind/plugin-customizer

View on GitHub

Showing 9 of 122 total issues

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

module.exports = function (grunt) {

    /**
     * Files added to WordPress SVN, don't include 'assets/**' here.
     * @type {Array}
Severity: Major
Found in Gruntfile.js - About 1 day to fix

    Plugin_Customizer has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

        abstract class Plugin_Customizer implements Plugin_Customizer_Interface {
    
            private  $customize_register_priority = 9; // Priority must be between 2 and 9
            private  $slug;
            private  $org_theme;
    Severity: Minor
    Found in src/Plugin_Customizer.php - About 2 hrs to fix

      Method init has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function init( $slug = '', $plugin_url, $plugin_root ) {
                  // self::$param_name = sanitize_title( get_called_class() , 'plugin_customizer' );
                  if ( '' == $slug ) {
                      wp_die( 'slug missing', $title = 'BlankSlate::init' );
                  }
      Severity: Major
      Found in src/Blank_Slate.php - About 2 hrs to fix

        Method init has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function init( $config = array() ) {
        
                    if ( ! count( $config ) ) {
                        wp_die( /*$message = '', $title = '', $args = array()*/ );
                    }
        Severity: Minor
        Found in src/Plugin_Customizer.php - About 1 hr to fix

          Function PluginCustomizer has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var PluginCustomizer = (function( api, $ ) {
              'use strict';
          
              var component = {
                  data: {
          Severity: Minor
          Found in src/assets/js/plugin-customizer-preview-templates.js - About 1 hr to fix

            Function PluginCustomizerBlankSlate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var PluginCustomizerBlankSlate = (function( api, $ ) {
                'use strict';
            
                var component = {
                    data: {
            Severity: Minor
            Found in src/assets/js/plugin-customizer-blank-slate.js - About 1 hr to fix

              Function init has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  component.init = function init( home, sections ) {
                      _.extend( component.data, home );
                      _.extend( {}, sections );
                      if ( ! home || ! home.url  ) {
                          throw new Error( 'Missing args' );
              Severity: Minor
              Found in src/assets/js/plugin-customizer-preview-templates.js - About 1 hr to fix

                Function loadMappedFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        protected function loadMappedFile( $prefix, $relative_class ) {
                            // are there any base directories for this namespace prefix?
                            if ( isset( $this->prefixes[ $prefix ] ) === false ) {
                                return false;
                            }
                Severity: Minor
                Found in inc/ps-auto-loader.php - About 35 mins 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 PluginCustomizerBlankSlate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                var PluginCustomizerBlankSlate = (function( api, $ ) {
                    'use strict';
                
                    var component = {
                        data: {
                Severity: Minor
                Found in src/assets/js/plugin-customizer-blank-slate.js - About 25 mins 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