Showing 5,566 of 7,504 total issues
Function get_feed_link
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function get_feed_link($feed = '') {
global $wp_rewrite;
$permalink = $wp_rewrite->get_feed_permastruct();
if ( '' != $permalink ) {
- 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 plugins_url
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function plugins_url($path = '', $plugin = '') {
$scheme = ( is_ssl() ? 'https' : 'http' );
if ( $plugin !== '' && preg_match('#^' . preg_quote(WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR, '#') . '#', $plugin) ) {
$url = WPMU_PLUGIN_URL;
- 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 _
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, callback: _wrap(function _(err, base64){
api.log('FlashAPI.Image._apply.callback:', err);
_unwrap(_);
if( err ){
Function lazyLoadChunks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lazyLoadChunks: function( size, delay ) {
var len = this.getDataLength(),
i = 0,
n = 0,
Function trackPageViewInternal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AppInsights.prototype.trackPageViewInternal = function (name, url, properties, measurements) {
var _this = this;
var durationMs = 0;
if (ApplicationInsights.Telemetry.PageViewPerformance.isPerformanceTimingSupported()) {
var startTime = window.performance.timing.navigationStart;
Function _wp_Nop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_wp_Nop : function(content) {
var blocklist1, blocklist2;
// Protect pre|script tags
content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
Function PopupWindow_refresh
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PopupWindow_refresh() {
if (this.divName != null) {
// refresh the DIV object
if (this.use_gebi) {
document.getElementById(this.divName).innerHTML = this.contents;
Function slide
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
slide: function( event, ui ) {
var attributes, movedRevision;
// Compare two revisions mode
if ( this.model.get('compareTwoMode') ) {
// Prevent sliders from occupying same spot
Function save
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
save : function(postid, nonce) {
var data, target = this.getTarget(postid), history = this.filterHistory(postid, 0);
if ( '' == history )
return false;
Function decrementCount
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
wp.updates.decrementCount = function( upgradeType ) {
var count, pluginCount, $elem;
$elem = $( '#wp-admin-bar-updates .ab-label' );
count = $elem.text();
Function clean
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.clean = function( elems, context, fragment, scripts ) {
// Set context per 1.8 logic
context = context || document;
context = !context.nodeType && context[0] || context;
context = context.ownerDocument || context;
Function _audioVideo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_audioVideo: function( type, props, attachment ) {
var shortcode, html, extension;
props = wp.media.string.props( props, attachment );
if ( props.link !== 'embed' )
Function insert
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
insert: function( html ) {
var editor,
hasTinymce = ! _.isUndefined( window.tinymce ),
hasQuicktags = ! _.isUndefined( window.QTags ),
wpActiveEditor = window.wpActiveEditor;
Function add
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.add = function(callback, scope, prepend) {
log('<target>.on' + newEventName + ".add(..)");
// Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
function patchedEventCallback(e) {
Function removeWebKitStyles
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function removeWebKitStyles(content) {
// Passthrough all styles from Word and let the WordFilter handle that junk
if (WordFilter.isWordContent(content)) {
return content;
}
Function renderUI
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.renderUI = function(args) {
var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
if (skin) {
var skinUrl = settings.skin_url;
Function simulateMouse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Event.simulateMouse = function(element, eventName) {
var options = Object.extend({
pointerX: 0,
pointerY: 0,
buttons: 0,
Function open
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open: function( editorId ) {
var ed;
wpLink.range = null;
Function setupBDDExtensionMethods
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Test.setupBDDExtensionMethods = function(){
var METHODMAP = {
shouldEqual: 'assertEqual',
shouldNotEqual: 'assertNotEqual',
shouldEqualEnum: 'assertEnumEqual',
Function setErrorState
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setErrorState( error, status ) {
var trigger;
if ( error ) {
switch ( error ) {