Showing 5,566 of 7,504 total issues
Function get_site_transient
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function get_site_transient( $transient ) {
/**
* Filter the value of an existing site transient.
*
- 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 display_element
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
if ( !$element )
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 get_most_active_blogs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function get_most_active_blogs( $num = 10, $display = true ) {
_deprecated_function( __FUNCTION__, '3.0' );
$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details
if ( is_array( $blogs ) ) {
- 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 site_url
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function site_url($path = '', $scheme = null) {
// should the list of allowed schemes be maintained elsewhere?
$orig_scheme = $scheme;
if ( !in_array($scheme, array('http', 'https')) ) {
if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) )
- 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 make_absolute_url
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static function make_absolute_url( $maybe_relative_path, $url ) {
if ( empty( $url ) )
return $maybe_relative_path;
// Check for a scheme
- 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 get_comments_pagenum_link
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {
global $post, $wp_rewrite;
$pagenum = (int) $pagenum;
- 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 queue
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
queue: function (fn){
var
_idx = 0
, _length = 0
, _fail = false
Function workFn
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function workFn() {
var modules = currentSpec.$modules || [];
var strictDi = !!currentSpec.$injectorStrict;
modules.unshift('ngMock');
modules.unshift('ng');
Function add
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function(elem, to, from, hide) {
if ( !elem || Galleria.TOUCH ) {
return;
}
if (!idle.bound) {
Function _getSizes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getSizes: function() {
var self = this,
norm = {
small: '72c',
Function save
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
save : function(id) {
var params, fields, page = $('.post_status_page').val() || '';
if( typeof(id) == 'object' )
id = this.getId(id);
Function start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function(e, ui) {
var height, width, parent, children, tempHolder;
// handle placement for rtl orientation
if ( api.isRTL )
Function setNumSelection
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
setNumSelection : function(postid) {
var sel, elX = $('#imgedit-sel-width-' + postid), elY = $('#imgedit-sel-height-' + postid),
x = this.intval( elX.val() ), y = this.intval( elY.val() ),
img = $('#image-preview-' + postid), imgh = img.height(), imgw = img.width(),
sizer = this.hold['sizer'], x1, y1, x2, y2, ias = this.iasapi;
Function request
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
request: function(url) {
this.url = url;
this.method = this.options.method;
var params = Object.clone(this.options.parameters);
Function convertParagraphToLi
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convertParagraphToLi(paragraphNode, listStartTextNode, listName, start) {
var level = paragraphNode._listLevel || lastLevel;
// Handle list nesting
if (level != lastLevel) {
Function editImage
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editImage( img ) {
var frame, callback, metadata;
if ( typeof wp === 'undefined' || ! wp.media ) {
editor.execCommand( 'mceImage' );
Function start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function(name, attrs) {
if (!data.source1 && name == "param") {
data.source1 = attrs.map.movie;
}
Function renderColorPicker
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderColorPicker() {
var ctrl = this, colors, color, html, last, rows, cols, x, y, i;
colors = mapColors();
Function initialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function( element, options ) {
var self = this,
synchronizer = api.Element.synchronizer.html,
type, update, refresh;
Function setPlayer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
setPlayer: function(e, node) {
// if the ready event fires on an empty node
if ( ! node ) {
return;
}