CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function get_feed_link has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function get_feed_link($feed = '') {
    global $wp_rewrite;

    $permalink = $wp_rewrite->get_feed_permastruct();
    if ( '' != $permalink ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/link-template.php - About 1 hr to fix

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

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;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/link-template.php - About 1 hr to fix

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

                                    , callback: _wrap(function _(err, base64){
                                        api.log('FlashAPI.Image._apply.callback:', err);
                                        _unwrap(_);

                                        if( err ){
Severity: Minor
Found in Web.Admin/z-scripts/FileAPI.js - About 1 hr to fix

    Function lazyLoadChunks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        lazyLoadChunks: function( size, delay ) {
    
            var len = this.getDataLength(),
                i = 0,
                n = 0,
    Severity: Minor
    Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

      Function trackPageViewInternal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      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;
      Severity: Minor
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 1 hr to fix

        Function _wp_Nop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _wp_Nop : function(content) {
                var blocklist1, blocklist2;
        
                // Protect pre|script tags
                content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/js/editor.dev.js - About 1 hr to fix

          Function PopupWindow_refresh has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function PopupWindow_refresh() {
              if (this.divName != null) {
                  // refresh the DIV object
                  if (this.use_gebi) {
                      document.getElementById(this.divName).innerHTML = this.contents;
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js - About 1 hr to fix

            Function slide has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    slide: function( event, ui ) {
                        var attributes, movedRevision;
                        // Compare two revisions mode
                        if ( this.model.get('compareTwoMode') ) {
                            // Prevent sliders from occupying same spot
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/js/revisions.js - About 1 hr to fix

              Function save has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  save : function(postid, nonce) {
                      var data, target = this.getTarget(postid), history = this.filterHistory(postid, 0);
              
                      if ( '' == history )
                          return false;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/js/image-edit.dev.js - About 1 hr to fix

                Function decrementCount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    wp.updates.decrementCount = function( upgradeType ) {
                        var count, pluginCount, $elem;
                
                        $elem = $( '#wp-admin-bar-updates .ab-label' );
                        count = $elem.text();
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/js/updates.js - About 1 hr to fix

                  Function clean has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  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;
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery-migrate.js - About 1 hr to fix

                    Function _audioVideo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _audioVideo: function( type, props, attachment ) {
                                var shortcode, html, extension;
                    
                                props = wp.media.string.props( props, attachment );
                                if ( props.link !== 'embed' )
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/media-editor.js - About 1 hr to fix

                      Function insert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              insert: function( html ) {
                                  var editor,
                                      hasTinymce = ! _.isUndefined( window.tinymce ),
                                      hasQuicktags = ! _.isUndefined( window.QTags ),
                                      wpActiveEditor = window.wpActiveEditor;
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/js/media-editor.js - About 1 hr to fix

                        Function add has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        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

                                  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

                                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

                              Event.simulateMouse = function(element, eventName) {
                                var options = Object.extend({
                                  pointerX: 0,
                                  pointerY: 0,
                                  buttons:  0,
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/unittest.js - About 1 hr to fix

                                Function open has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        open: function( editorId ) {
                                            var ed;
                                            
                                            wpLink.range = null;
                                
                                
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/js/wplink.js - About 1 hr to fix

                                  Function setupBDDExtensionMethods has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Test.setupBDDExtensionMethods = function(){
                                    var METHODMAP = {
                                      shouldEqual:     'assertEqual',
                                      shouldNotEqual:  'assertNotEqual',
                                      shouldEqualEnum: 'assertEnumEqual',
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/unittest.js - About 1 hr to fix

                                    Function setErrorState has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            function setErrorState( error, status ) {
                                                var trigger;
                                    
                                                if ( error ) {
                                                    switch ( error ) {
                                    Severity: Minor
                                    Found in Web.Admin/2014/wordpress/wp-includes/js/heartbeat.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language