Showing 9 of 122 total issues
Function exports
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
/**
* Files added to WordPress SVN, don't include 'assets/**' here.
* @type {Array}
Plugin_Customizer
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
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;
Method init
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
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' );
}
Method init
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init( $config = array() ) {
if ( ! count( $config ) ) {
wp_die( /*$message = '', $title = '', $args = array()*/ );
}
Function PluginCustomizer
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var PluginCustomizer = (function( api, $ ) {
'use strict';
var component = {
data: {
Function PluginCustomizerBlankSlate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var PluginCustomizerBlankSlate = (function( api, $ ) {
'use strict';
var component = {
data: {
Function init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
component.init = function init( home, sections ) {
_.extend( component.data, home );
_.extend( {}, sections );
if ( ! home || ! home.url ) {
throw new Error( 'Missing args' );
Function loadMappedFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function loadMappedFile( $prefix, $relative_class ) {
// are there any base directories for this namespace prefix?
if ( isset( $this->prefixes[ $prefix ] ) === false ) {
return false;
}
- Read upRead up
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
Open
var PluginCustomizerBlankSlate = (function( api, $ ) {
'use strict';
var component = {
data: {
- Read upRead up
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"