Showing 5,566 of 7,504 total issues
Function wp_start_object_cache
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function wp_start_object_cache() {
global $blog_id;
$first_init = false;
if ( ! function_exists( 'wp_cache_init' ) ) {
- 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 add_site_option
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function add_site_option( $option, $value ) {
global $wpdb;
wp_protect_special_option( $option );
- 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 is_email
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function is_email( $email, $check_dns = false ) {
// Test for the minimum length the email can be
if ( strlen( $email ) < 3 ) {
return apply_filters( 'is_email', false, $email, 'email_too_short' );
}
- 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 EncodeHeader
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function EncodeHeader ($str, $position = 'text') {
$x = 0;
switch (strtolower($position)) {
case 'phrase':
- 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 _wp_upgrade_revisions_of_post
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function _wp_upgrade_revisions_of_post( $post, $revisions ) {
global $wpdb;
// Add post option exclusively
$lock = "revision-upgrade-{$post->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
Function start_el
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function start_el(&$output, $page, $depth, $args, $current_page) {
if ( $depth )
$indent = str_repeat("\t", $depth);
else
$indent = '';
- 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 _addFile
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function _addFile(file/**Object*/){
if( file.image ){ // This is a FileAPI.Image
queue.inc();
file.toData(function (err, image){
Function publish
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Camera.publish = function (el, options, callback){
if( typeof options == 'function' ){
callback = options;
options = {};
}
Function onload
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
onload = (function( self, callback, src ) {
return function() {
var complete = function() {
Function PageViewPerformance
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PageViewPerformance(name, url, durationMs, properties, measurements) {
_super.call(this);
this.aiDataContract = {
ver: true,
name: false,
Function onThumbLoad
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
onThumbLoad = function( thumb, callback ) {
// scale when ready
thumb.scale({
width: thumb.data.width,
Function attr
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.attr = function( elem, name, value, pass ) {
var lowerName = name.toLowerCase(),
nType = elem && elem.nodeType;
if ( pass ) {
Function PopupWindow_showPopup
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PopupWindow_showPopup(anchorname) {
this.getXYPosition(anchorname);
this.x += this.offsetX;
this.y += this.offsetY;
if (!this.populated && (this.contents != "")) {
Function historyController
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var historyController = function (dataService) {
var vm = this;
vm.History = [
{ year: 2019, province: 'QC', city: 'Gatineau' },
Function htmlToData
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function htmlToData(html) {
var data = {};
new tinymce.html.SaxParser({
validate: false,
Function set
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
set: function( selector, views, options ) {
var existing, next;
if ( ! _.isString( selector ) ) {
options = views;
Function createCropToolbar
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
createCropToolbar: function() {
var canSkipCrop, toolbarOptions;
canSkipCrop = this.get('canSkipCrop') || false;
Function onload
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
onload = (function( self, callback, src ) {
return function() {
var complete = function() {
Method delete_theme
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function delete_theme($template) {
global $wp_filesystem;
if ( empty($template) )
return false;
Function onThumbLoad
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
onThumbLoad = function( thumb, callback ) {
// scale when ready
thumb.scale({
width: thumb.data.width,