CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Consider simplifying this complex logical expression.
Open

                if (
                    // Invalid sequences
                    !$valid
                    // Non-shortest form sequences are invalid
                    || $length > 1 && $character <= 0x7F
Severity: Critical
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/IRI.php - About 6 hrs to fix

    File wp-db.php has 430 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * WordPress DB Class
     *
     * Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/wp-db.php - About 6 hrs to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      Object.extend(Event, {
        KEY_BACKSPACE: 8,
        KEY_TAB:       9,
        KEY_RETURN:   13,
        KEY_ESC:      27,
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 6 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 3684..3711

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 161.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      Object.extend(Event, {
        KEY_BACKSPACE: 8,
        KEY_TAB:       9,
        KEY_RETURN:   13,
        KEY_ESC:      27,
      Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 3684..3711

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 161.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Method wp_nav_menu_item_taxonomy_meta_box has 157 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
          global $nav_menu_selected_id;
          $taxonomy_name = $taxonomy['args']->name;
      
          // paginate browsing for large numbers of objects
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/nav-menu.php - About 6 hrs to fix

        Method get_calendar has 157 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function get_calendar($initial = true) {
            global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
        
            $cache = array();
            $key = md5( $m . $monthnum . $year );
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 6 hrs to fix

          File theme.js has 428 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * theme.js
           *
           * Copyright, Moxiecode Systems AB
           * Released under LGPL License.

            File class-json.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
            /**
             * Converts to and from JSON format.
             *
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/class-json.php - About 6 hrs to fix

              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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
                    
                        _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()');
                    
                        if ( empty($in_same_cat) || 'no' == $in_same_cat )
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php and 1 other location - About 6 hrs to fix
                    Web.Admin/2014/wordpress/wp-includes/deprecated.php on lines 233..252

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 208.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
                        _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()');
                    
                        if ( empty($in_same_cat) || 'no' == $in_same_cat )
                            $in_same_cat = false;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php and 1 other location - About 6 hrs to fix
                    Web.Admin/2014/wordpress/wp-includes/deprecated.php on lines 197..217

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 208.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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' ) ),

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                {
                                    var c = Coords.getFixed();
                        
                                    resize(c.w,c.h);
                                    moveto(c.x,c.y);
                        Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js on lines 75..75

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 158.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        if(_4f.match(/E/)){
                        this.transformCoords(_50.x,this.startCoords.x1,_51,"x");
                        if(_50.x<this.startCoords.x1){
                        _52.x=-1;
                        }
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/js/crop/cropper.js and 1 other location - About 6 hrs to fix
                        Web.Admin/2014/wordpress/wp-includes/js/crop/cropper.js on lines 448..460

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 158.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language