CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function get_allowed_on_site has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public static function get_allowed_on_site( $blog_id = null ) {
        static $allowed_themes = array();

        if ( ! $blog_id || ! is_multisite() )
            $blog_id = get_current_blog_id();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-theme.php - About 3 hrs 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 discover has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    function discover( $url ) {
        $providers = array();

        // Fetch URL content
        if ( $html = wp_remote_retrieve_body( wp_remote_get( $url ) ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-oembed.php - About 3 hrs 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 linkFileSelect has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile) {
    if (elem.attr('__ngf_gen__')) {
        return;
    }
    function isInputTypeFile() {
Severity: Major
Found in Web.Admin/z-scripts/ng-file-upload.js - About 3 hrs to fix

    Function linkFileSelect has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile) {
        if (elem.attr('__ngf_gen__')) {
            return;
        }
        function isInputTypeFile() {
    Severity: Major
    Found in Web.Admin/z-scripts/ng-file-upload-all.js - About 3 hrs to fix

      Function showDialog has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function showDialog() {
              var win, width, height, data;
              var generalFormItems = [
                  {name: 'source1', type: 'filepicker', filetype: 'media', size: 40, autofocus: true, label: 'Source'}
              ];

        Method create has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function create($p_filelist)
          {
            $v_result=1;
        
            // ----- Reset the error handler
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 3 hrs to fix

          Method wp_insert_user has 93 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function wp_insert_user($userdata) {
              global $wpdb;
          
              extract($userdata, EXTR_SKIP);
          
          
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/registration.php - About 3 hrs to fix

            Method __construct has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function __construct( $theme_dir, $theme_root, $_child = null ) {
                    global $wp_theme_directories;
            
                    // Initialize caching on first run.
                    if ( ! isset( self::$persistently_cache ) ) {
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-theme.php - About 3 hrs to fix

              Method _wp_ajax_menu_quick_search has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function _wp_ajax_menu_quick_search( $request = array() ) {
                  $args = array();
                  $type = isset( $request['type'] ) ? $request['type'] : '';
                  $object_type = isset( $request['object_type'] ) ? $request['object_type'] : '';
                  $query = isset( $request['q'] ) ? $request['q'] : '';
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/includes/nav-menu.php - About 3 hrs to fix

                Method get_items has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function get_items($start = 0, $end = 0)
                    {
                        if (!isset($this->data['items']))
                        {
                            if (!empty($this->multifeed_objects))
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 3 hrs to fix

                  `` has 30 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  Object.extend(String.prototype, {
                    gsub: function(pattern, replacement) {
                      var result = '', source = this, match;
                      replacement = arguments.callee.prepareReplacement(replacement);
                  
                  
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 3 hrs to fix

                    `` has 30 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    Object.extend(String.prototype, {
                      gsub: function(pattern, replacement) {
                        var result = '', source = this, match;
                        replacement = arguments.callee.prepareReplacement(replacement);
                    
                    
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 3 hrs to fix

                      WP_Filesystem_FTPext has 30 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class WP_Filesystem_FTPext extends WP_Filesystem_Base {
                          var $link;
                          var $errors = null;
                          var $options = array();
                      
                      

                        Blogger_Import has 30 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Blogger_Import {
                        
                            // Shows the welcome screen and the magic auth link.
                            function greet() {
                                $next_url = get_option('siteurl') . '/wp-admin/index.php?import=blogger&noheader=true';
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.php - About 3 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if ( $wp_query->is_singular && 'taxonomy' == $menu_item->type && in_array( $menu_item->object_id, $possible_object_parents ) ) {
                                      $active_parent_object_ids[] = (int) $menu_item->object_id;
                                      $active_parent_item_ids[] = (int) $menu_item->db_id;
                                      $active_object = $queried_object->post_type;
                          
                          
                          Severity: Critical
                          Found in Web.Admin/2014/wordpress/wp-includes/nav-menu-template.php - About 3 hrs to fix

                            File Parser.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * SimplePie
                             *
                             * A PHP-Based RSS and Atom Feed Framework.
                            Severity: Minor
                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parser.php - About 3 hrs to fix

                              Function fileUpload has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function fileUpload() {
                                      var form = $form[0];
                                      var opts = $.extend({}, $.ajaxSettings, options);
                              
                                      var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
                              Severity: Major
                              Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery.form.dev.js - About 3 hrs to fix

                                Method CopyToAppropriateCommentsSection has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {
                                        static $handyatomtranslatorarray = array();
                                        if (empty($handyatomtranslatorarray)) {
                                            $handyatomtranslatorarray['©cpy'] = 'copyright';
                                            $handyatomtranslatorarray['©day'] = 'creation_date';    // iTunes 4.0

                                  Method wp_insert_attachment has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function wp_insert_attachment($object, $file = false, $parent = 0) {
                                      global $wpdb, $user_ID;
                                  
                                      $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
                                          'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 3 hrs to fix

                                    Function init has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            init : function() {
                                    
                                                if ( lightbox.initialized ) {
                                                    return;
                                                }
                                    Severity: Major
                                    Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language