CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function unzip_file has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

function unzip_file($file, $to) {
    global $wp_filesystem;

    if ( ! $wp_filesystem || !is_object($wp_filesystem) )
        return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/file.php - About 6 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 get_plugin_files has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

function get_plugin_files($plugin) {
    $plugin_file = WP_PLUGIN_DIR . '/' . $plugin;
    $dir = dirname($plugin_file);
    $plugin_files = array($plugin);
    if ( is_dir($dir) && $dir != WP_PLUGIN_DIR ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 6 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 ASF_HeaderExtensionObjectDataParse has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    public function ASF_HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {
        // http://msdn.microsoft.com/en-us/library/bb643323.aspx

        $offset = 0;
        $objectOffset = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 6 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

File wp-langs-en.js has 426 lines of code (exceeds 250 allowed). Consider refactoring.
Open

tinyMCE.addI18n({en:{
common:{
edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
apply:"Apply",
insert:"Insert",
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/js/tinymce/langs/wp-langs-en.js - About 6 hrs to fix

    File class-wp-comments-list-table.php has 426 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Comments and Post Comments List Table classes.
     *
     * @package WordPress

      File ms-blogs.php has 426 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * Site/blog functions that work with the blogs table and related data.
       *
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/ms-blogs.php - About 6 hrs to fix

        Method wp_image_editor has 155 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function wp_image_editor($post_id, $msg = false) {
            $nonce = wp_create_nonce("image_editor-$post_id");
            $meta = wp_get_attachment_metadata($post_id);
            $thumb = image_get_intermediate_size($post_id, 'thumbnail');
            $sub_sizes = isset($meta['sizes']) && is_array($meta['sizes']);
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/includes/image-edit.php - About 6 hrs to fix

          Method display_rows has 154 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function display_rows() {
                  global $mode;
          
                  $status_list = array(
                      'archived' => array( 'site-archived', __( 'Archived' ) ),

            Function svgPainter has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

            wp.svgPainter = ( function( $, window, document, undefined ) {
                'use strict';
                var selector, base64, painter,
                    colorscheme = {},
                    elements = [];
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/js/svg-painter.js - About 6 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 privFileDescrParseAtt has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

              function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false)
              {
                $v_result=1;
            
                // ----- For each file in the list check the attributes
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 6 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 _wp_translate_postdata has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

            function _wp_translate_postdata( $update = false, $post_data = null ) {
            
                if ( empty($post_data) )
                    $post_data = &$_POST;
            
            
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/post.php - About 6 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 wp_ajax_add_meta has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

            function wp_ajax_add_meta() {
                check_ajax_referer( 'add-meta', '_ajax_nonce-add-meta' );
                $c = 0;
                $pid = (int) $_POST['post_id'];
                $post = get_post( $pid );
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php - About 6 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 analyze has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

                public function analyze($filename) {
                    try {
                        if (!$this->openfile($filename)) {
                            return $this->info;
                        }
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.php - About 6 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 scale has 152 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                scale: function( options ) {
            
                    var self = this;
            
                    // extend some defaults
            Severity: Major
            Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 6 hrs to fix

              Function scale has 152 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  scale: function( options ) {
              
                      var self = this;
              
                      // extend some defaults
              Severity: Major
              Found in Web.Admin/Content/galleria/galleria-1.4.2.js - About 6 hrs to fix

                File mt.php has 420 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Movable Type and TypePad Importer
                 *
                 * @package WordPress
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/import/mt.php - About 6 hrs to fix

                  Method map_meta_cap has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function map_meta_cap( $cap, $user_id ) {
                      $args = array_slice( func_get_args(), 2 );
                      $caps = array();
                  
                      switch ( $cap ) {
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/capabilities.php - About 6 hrs to fix

                    Method wp_get_archives has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function wp_get_archives($args = '') {
                        global $wpdb, $wp_locale;
                    
                        $defaults = array(
                            'type' => 'monthly', 'limit' => '',
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 6 hrs to fix

                      File capabilities.php has 419 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * WordPress Roles and Capabilities.
                       *
                       * @package WordPress
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/capabilities.php - About 6 hrs to fix

                        Function createHttpBackendMock has 151 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
                          var definitions = [],
                              expectations = [],
                              responses = [],
                              responsesPush = angular.bind(responses, responses.push),
                        Severity: Major
                        Found in Web.Admin/z-scripts/angular-mocks.js - About 6 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language