CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

var Insertion = {
  Before: function(element, content) {
    return Element.insert(element, {before:content});
  },

Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 4 hrs to fix
Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 4005..4021

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

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 pingback_ping has 116 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function pingback_ping($args) {
        global $wpdb;

        /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
        do_action( 'xmlrpc_call', 'pingback.ping' );
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 4 hrs to fix

    Function ColorPicker has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ColorPicker() {
        var windowMode = false;
        // Create a new PopupWindow object
        if (arguments.length==0) {
            var divname = "colorPickerDiv";
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js - About 4 hrs to fix

      Method parseMETAdata has 115 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function parseMETAdata() {
              $info = &$this->getid3->info;
              do {
                  $BlockOffset   = $this->ftell();
                  $BlockHeader   = $this->fread(4);
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.flac.php - About 4 hrs to fix

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

                    library.comparator = function( a, b ) {
                        var aInQuery = !! this.mirroring.get( a.cid ),
                            bInQuery = !! this.mirroring.get( b.cid );
        
                        if ( ! aInQuery && bInQuery ) {
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js and 1 other location - About 4 hrs to fix
        Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 1207..1218

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

        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

                $scope.unassignedArrival = function (participant) {
                    var occupants = $scope.model.arrivals
                        .filter(x => x.Occupants)
                        .map(x => x.Occupants)
                        .reduce(function (flat, toFlatten) {
        Severity: Major
        Found in Web.Admin/AdminApp/Controllers/controller.arrivals.js and 1 other location - About 4 hrs to fix
        Web.Admin/AdminApp/Controllers/controller.arrivals.js on lines 125..134

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

        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

                $scope.unassignedDeparture = function (participant) {
                    var occupants = $scope.model.departures
                        .filter(x => x.Occupants)
                        .map(x => x.Occupants)
                        .reduce(function (flat, toFlatten) {
        Severity: Major
        Found in Web.Admin/AdminApp/Controllers/controller.arrivals.js and 1 other location - About 4 hrs to fix
        Web.Admin/AdminApp/Controllers/controller.arrivals.js on lines 114..123

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

        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

                    library.comparator = function( a, b ) {
                        var aInQuery = !! this.mirroring.get( a.cid ),
                            bInQuery = !! this.mirroring.get( b.cid );
        
                        if ( ! aInQuery && bInQuery ) {
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js and 1 other location - About 4 hrs to fix
        Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 1125..1136

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

        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 dw_getRandomImage has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function dw_getRandomImage(rObj, bReturn) {
            var imgAr = rObj.images;  if (!imgAr ) return '';
            var num = Math.floor( Math.random() * imgAr.length );
            var imgStr = '';   var imgFile = imgAr[ num ];
            rObj.num = num; // hold which img selected (for ctr)
        Severity: Minor
        Found in Web.Admin/2015/js/dw_rotator_aux.js - About 4 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 dw_getRandomImage has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function dw_getRandomImage(rObj, bReturn) {
            var imgAr = rObj.images;  if (!imgAr ) return '';
            var num = Math.floor( Math.random() * imgAr.length );
            var imgStr = '';   var imgFile = imgAr[ num ];
            rObj.num = num; // hold which img selected (for ctr)
        Severity: Minor
        Found in Web.Admin/2014/js/dw_rotator_aux.js - About 4 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 generatePreview has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function generatePreview(c) {
            var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;
        
            p.innerHTML = '<!-- x --->';
        
        

        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 make_site_theme_from_default has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function make_site_theme_from_default($theme_name, $template) {
            $site_dir = WP_CONTENT_DIR . "/themes/$template";
            $default_dir = WP_CONTENT_DIR . '/themes/default';
        
            // Copy files from the default theme to the site theme.
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/upgrade.php - About 4 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 add_meta_box has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null) {
            global $wp_meta_boxes;
        
            if ( !isset($wp_meta_boxes) )
                $wp_meta_boxes = array();
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 4 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_replyto_comment has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_ajax_replyto_comment( $action ) {
            global $wp_list_table, $wpdb;
            if ( empty( $action ) )
                $action = 'replyto-comment';
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php - About 4 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 pingback_ping has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            function pingback_ping($args) {
                global $wpdb;
        
                do_action('xmlrpc_call', 'pingback.ping');
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/xmlrpc.php - About 4 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 auto_check_update_meta has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function auto_check_update_meta( $id, $comment ) {
        
                // failsafe for old WP versions
                if ( !function_exists('add_comment_meta') )
                    return false;
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/class.akismet.php - About 4 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 mw_getPost has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            function mw_getPost($args) {
        
                $this->escape($args);
        
                $post_ID     = (int) $args[0];
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 4 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_kses_attr has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) {
            # Is there a closing XHTML slash at the end of the attributes?
        
            $xhtml_slash = '';
            if (preg_match('%\s/\s*$%', $attr))
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/kses.php - About 4 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 load has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            function load()
            {
                if ($this->mysql && ($query = mysql_query('SELECT `items`, `data` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query)))
                {
                    $data = unserialize($row[1]);
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 4 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 absolutize has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            function absolutize($base, $relative)
            {
                $relative = (string) $relative;
                if ($relative !== '')
                {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 4 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

        Severity
        Category
        Status
        Source
        Language