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;
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
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
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) {
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';
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;
}
- 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
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' );
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(
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
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();
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 = [
Function initializeCommentForm
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeCommentForm( commentForm, comments, statusDiv ) {
const options = this.options;
if ( ! commentForm ) {
return;
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
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 ];
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;
- 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 initializeCommentForm
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
initializeCommentForm( commentForm, comments, statusDiv ) {
const options = this.options;
if ( ! commentForm ) {
return;
- 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 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);
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');
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 );
}
- 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
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,
) );