CaffGeek/MBACNationals

View on GitHub

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' ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/load.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 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 );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/option.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 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' );
    }
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 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':
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.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 _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}";
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/revision.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 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 = '';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/classes.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 _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){
Severity: Minor
Found in Web.Admin/z-scripts/FileAPI.js - About 1 hr to fix

    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 = {};
            }
    Severity: Minor
    Found in Web.Admin/z-scripts/FileAPI.js - About 1 hr to fix

      Function onload has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  onload = (function( self, callback, src ) {
      
                      return function() {
      
                          var complete = function() {
      Severity: Minor
      Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

        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,
        Severity: Minor
        Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 1 hr to fix

          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,
          Severity: Minor
          Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

            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 ) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery-migrate.js - About 1 hr to fix

              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 != "")) {
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js - About 1 hr to fix

                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' },
                Severity: Minor
                Found in Web.Admin/ClientApp/Controllers/controller.history.js - About 1 hr to fix

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

                      Function createCropToolbar has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              createCropToolbar: function() {
                                  var canSkipCrop, toolbarOptions;
                      
                                  canSkipCrop = this.get('canSkipCrop') || false;
                      
                      
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js - About 1 hr to fix

                        Function onload has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    onload = (function( self, callback, src ) {
                        
                                        return function() {
                        
                                            var complete = function() {
                        Severity: Minor
                        Found in Web.Admin/Content/galleria/galleria-1.4.2.js - About 1 hr to fix

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

                            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,
                            Severity: Minor
                            Found in Web.Admin/Content/galleria/galleria-1.4.2.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language