CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

        {
            var midvert  = Math.round((c.h / 2) - hhs),
                midhoriz = Math.round((c.w / 2) - hhs),
                north = west = -hhs+1,
                east = c.w - hhs,
Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js on lines 70..70

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 382.

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

{var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;'e'in handle&&handle.e.css({top:px(midvert),left:px(east)})&&handle.w.css({top:px(midvert)})&&handle.s.css({top:px(south),left:px(midhoriz)})&&handle.n.css({left:px(midhoriz)});'ne'in handle&&handle.ne.css({left:px(east)})&&handle.se.css({top:px(south),left:px(east)})&&handle.sw.css({top:px(south)});'b'in handle&&handle.b.css({top:px(south)})&&handle.r.css({left:px(east)});};function moveto(x,y)
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js and 1 other location - About 2 days to fix
Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js on lines 497..519

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 382.

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

File ng-file-upload-all.js has 888 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**!
 * AngularJS file upload/drop directive and service with progress and abort
 * @author  Danial  <danial.farid@gmail.com>
 * @version 4.2.1
 */
Severity: Major
Found in Web.Admin/z-scripts/ng-file-upload-all.js - About 2 days to fix

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

    function media_upload_video() {
        $errors = array();
        $id = 0;
    
        if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/includes/media.php and 1 other location - About 2 days to fix
    Web.Admin/2014/wordpress/wp-admin/includes/media.php on lines 574..623

    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 435.

    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 media_upload_audio() {
        $errors = array();
        $id = 0;
    
        if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/includes/media.php and 1 other location - About 2 days to fix
    Web.Admin/2014/wordpress/wp-admin/includes/media.php on lines 632..681

    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 435.

    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

        function remove_dot_segments($input)
        {
            $output = '';
            while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
            {
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 2 days to fix
    Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 9107..9159

    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 434.

    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

        function remove_dot_segments($input)
        {
            $output = '';
            while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
            {
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 2 days to fix
    Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 11776..11828

    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 434.

    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

                        for (var i = 0; i < shots.length && currentFrame.number <= 10; i++) {
                            var shot = shots[i];
    
                            var shotScore = calcShotScore(shots, i);
                            currentFrame.shots.push(shot);
    Severity: Major
    Found in Web.Admin/ClientApp/Controllers/controller.results.js and 1 other location - About 2 days to fix
    Web.Admin/AdminApp/Controllers/controller.stepladder.js on lines 123..151

    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 377.

    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

                        for (var i = 0; i < shots.length && currentFrame.number <= 10; i++) {
                            var shot = shots[i];
    
                            var shotScore = calcShotScore(shots, i);
                            currentFrame.shots.push(shot);
    Severity: Major
    Found in Web.Admin/AdminApp/Controllers/controller.stepladder.js and 1 other location - About 2 days to fix
    Web.Admin/ClientApp/Controllers/controller.results.js on lines 164..192

    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 377.

    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

    Function import has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
    Open

        function import() {
            global $wpdb;
    
            $wpvarstoreset = array('gmpath', 'archivespath', 'lastentry');
            for ($i=0; $i<count($wpvarstoreset); $i += 1) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/import/greymatter.php - About 2 days 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

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

            while (false !== ($entry = $dir->read()) ) {
                $struc = array();
                $struc['name'] = $entry;
    
                if ( '.' == $struc['name'] || '..' == $struc['name'] )
    Web.Admin/2014/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on lines 327..359

    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 429.

    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

            while (false !== ($entry = $dir->read()) ) {
                $struc = array();
                $struc['name'] = $entry;
    
                if ( '.' == $struc['name'] || '..' == $struc['name'] )
    Web.Admin/2014/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php on lines 342..374

    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 429.

    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

    Function _wp_comment_row has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
    Open

    function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) {
        global $comment, $post, $_comment_pending_count;
        $comment = get_comment( $comment_id );
        $post = get_post($comment->comment_post_ID);
        $the_comment_status = wp_get_comment_status($comment->comment_ID);
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 days 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

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

    function dw_Rotator(rObj) {
        var imgObj = document.getElementById(rObj.id); 
        if ( !imgObj || !rObj.images ) { return; }
        this.id = rObj.id; this.speed = rObj.speed || 4500; // default speed of rotation
        this.path = rObj.path || ""; this.bRand = rObj.bRand; this.bMouse = rObj.bMouse;
    Severity: Major
    Found in Web.Admin/2014/js/dw_rotator.js and 1 other location - About 2 days to fix
    Web.Admin/2015/js/dw_rotator.js on lines 15..29

    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 368.

    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

    function dw_Rotator(rObj) {
        var imgObj = document.getElementById(rObj.id); 
        if ( !imgObj || !rObj.images ) { return; }
        this.id = rObj.id; this.speed = rObj.speed || 4500; // default speed of rotation
        this.path = rObj.path || ""; this.bRand = rObj.bRand; this.bMouse = rObj.bMouse;
    Severity: Major
    Found in Web.Admin/2015/js/dw_rotator.js and 1 other location - About 2 days to fix
    Web.Admin/2014/js/dw_rotator.js on lines 15..29

    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 368.

    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

    File customize-controls.js has 859 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* globals _wpCustomizeHeader, _wpMediaViewsL10n */
    (function( exports, $ ){
        var api = wp.customize;
    
        /**
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/js/customize-controls.js - About 2 days to fix

      File jquery.Jcrop.dev.js has 859 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * jquery.Jcrop.js v0.9.8
       * jQuery Image Cropping Plugin
       * @author Kelly Hallman <khallman@gmail.com>
       * Copyright (c) 2008-2009 Kelly Hallman - released under MIT License {{{
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js - About 2 days to fix

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

        <?php
        /**
         * Atom Publishing Protocol support for WordPress
         *
         * @author Original by Elias Torres <http://torrez.us/archives/2006/08/31/491/>
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-app.php - About 2 days to fix

          Function _wp_menu_output has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
          Open

          function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
              global $self, $parent_file, $submenu_file, $plugin_page, $pagenow;
          
              $first = true;
              // 0 = name, 1 = capability, 2 = file, 3 = class, 4 = id, 5 = icon src
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/menu-header.php - About 2 days 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

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

          Language.snippets = [
          //Conditional
              { input : 'if', output : 'If $0 Then\n\t\nEnd If' },
              { input : 'ifelse', output : 'If $0 Then\n\t\n\nElse\n\t\nEnd If' },
              { input : 'case', output : 'Select Case $0\n\tCase ?\n\tCase Else\nEnd Select'},
          Web.Admin/2014/wordpress/wp-includes/js/codepress/languages/asp.js on lines 63..102

          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 366.

          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