soderlind/plugin-customizer

View on GitHub

Showing 122 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

                Spaces must be used for mid-line alignment; tabs are not allowed
                Open

                                'capability'    => 'manage_options',
                Severity: Minor
                Found in plugin-customizer-demo.php by phpcodesniffer

                Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
                Open

                                $handle = 'plugin-customizer-blank-slate';
                Severity: Minor
                Found in src/Blank_Slate.php by phpcodesniffer

                Space found before comma in function call
                Open

                            $this->slug = sanitize_title( $config['name'] , 'plugin-customizer' );
                Severity: Minor
                Found in src/Plugin_Customizer.php by phpcodesniffer

                Expected 1 space before opening brace; found 0
                Open

                                add_filter( 'pre_option_template', function(){
                Severity: Minor
                Found in src/Plugin_Customizer.php by phpcodesniffer

                Spaces must be used for mid-line alignment; tabs are not allowed
                Open

                         * @param   Object    $wp_rewrite Permalink structure
                Severity: Minor
                Found in src/Plugin_Customizer.php by phpcodesniffer

                Found precision alignment of 1 spaces.
                Open

                             return $wp_rewrite->rules;
                Severity: Minor
                Found in src/Plugin_Customizer.php by phpcodesniffer

                Array double arrow not aligned correctly; expected 7 space(s) between "'title'" and double arrow, but found 9.
                Open

                                'title'            => __( 'Content', 'plugin-customizer' ),
                Severity: Minor
                Found in plugin-customizer-demo.php by phpcodesniffer

                Array double arrow not aligned correctly; expected 2 space(s) between "'transport'" and double arrow, but found 5.
                Open

                                'transport'     => 'postMessage',
                Severity: Minor
                Found in plugin-customizer-demo.php by phpcodesniffer

                Array double arrow not aligned correctly; expected 7 space(s) between "'type'" and double arrow, but found 10.
                Open

                                'type'            => 'option',
                Severity: Minor
                Found in plugin-customizer-demo.php by phpcodesniffer

                Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space
                Open

                            $deps = array( 'customize-controls' );
                Severity: Minor
                Found in src/Plugin_Customizer.php by phpcodesniffer

                Found precision alignment of 2 spaces.
                Open

                      background-color: #333333;
                Severity: Minor
                Found in templates/content.php by phpcodesniffer

                Array double arrow not aligned correctly; expected 1 space(s) between "'description'" and double arrow, but found 3.
                Open

                                'description'    => __( 'Customize Your Logo Section', 'plugin-customizer' ),
                Severity: Minor
                Found in plugin-customizer-demo.php by phpcodesniffer
                Severity
                Category
                Status
                Source
                Language