Showing 449 of 644 total issues
Function is_plugin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function is_plugin() {
$is_plugin = false;
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
}
- Read upRead up
- Create a ticketCreate a ticket
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 from_hsl_array
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function from_hsl_array() {
$h = $this->hue / 360;
$s = $this->saturation / 100;
$l = $this->lightness / 100;
- Read upRead up
- Create a ticketCreate a ticket
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 exports
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
- Create a ticketCreate a ticket
Function FontWatchRunner
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
webfont.FontWatchRunner = function(activeCallback, inactiveCallback, domHelper,
font, opt_timeout, opt_metricCompatibleFonts, opt_fontTestString) {
- Create a ticketCreate a ticket
Method add_setting
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
final function add_setting( $classname, $setting, $default, $type, $capability, $transport, $sanitize_callback ) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ( 'background-color' === property ) {
processedValue = 'unset';
} else if ( 'background-image' === property ) {
processedValue = 'none';
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ( 'background-color' === output.property ) {
processedValue = 'unset';
} else if ( 'background-image' === output.property ) {
processedValue = 'none';
}
- Create a ticketCreate a ticket
Function exports
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
- Create a ticketCreate a ticket
Function 168
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{"40":40,"67":67}],168:[function(_dereq_,module,exports){
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
var $export = _dereq_(40);
var abs = Math.abs;
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if ( ! _.isUndefined( control.params.fields[ this.label.field ].type ) ) {
if ( 'select' === control.params.fields[ this.label.field ].type ) {
if ( ! _.isUndefined( control.params.fields[ this.label.field ].choices ) && ! _.isUndefined( control.params.fields[ this.label.field ].choices[ rowLabelField.val() ] ) ) {
rowLabel = control.params.fields[ this.label.field ].choices[ rowLabelField.val() ];
}
- Create a ticketCreate a ticket
Function set
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function set(view, bytes, index, conversion, value, isLittleEndian) {
- Create a ticketCreate a ticket
Function showKirkiControl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
showKirkiControl: function( control ) {
var self = this,
show = true,
isOption = (
control.params && // Check if control.params exists.
- Read upRead up
- Create a ticketCreate a ticket
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 109
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{"109":109,"117":117,"35":35}],109:[function(_dereq_,module,exports){
'use strict';
var toInteger = _dereq_(115);
var defined = _dereq_(35);
- Read upRead up
- Create a ticketCreate a ticket
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 18
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{"113":113,"117":117,"118":118}],18:[function(_dereq_,module,exports){
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
'use strict';
var toObject = _dereq_(118);
var toAbsoluteIndex = _dereq_(113);
- Read upRead up
- Create a ticketCreate a ticket
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 119
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{"35":35}],119:[function(_dereq_,module,exports){
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = _dereq_(57);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
- Read upRead up
- Create a ticketCreate a ticket
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 241
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{"107":107}],241:[function(_dereq_,module,exports){
var $export = _dereq_(40);
var toAbsoluteIndex = _dereq_(113);
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
- Read upRead up
- Create a ticketCreate a ticket
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 mustBeCropped
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) {
- Create a ticketCreate a ticket
Function getSubstitution
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
- Create a ticketCreate a ticket
Function 108
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{"35":35,"40":40,"42":42}],108:[function(_dereq_,module,exports){
// https://github.com/tc39/proposal-string-pad-start-end
var toLength = _dereq_(117);
var repeat = _dereq_(109);
var defined = _dereq_(35);
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
else if (res) switch (TYPE) {
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
- Create a ticketCreate a ticket