CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function interleave_changed_lines has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    function interleave_changed_lines( $orig, $final ) {

        // Contains all pairwise string comparisons.  Keys are such that this need only be a one dimensional array.
        $matches = array();
        foreach ( array_keys($orig) as $o ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/wp-diff.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_fix_server_vars has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

function wp_fix_server_vars() {
    global $PHP_SELF;

    $default_server_values = array(
        'SERVER_SOFTWARE' => '',
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/load.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

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

    function build_query_string() {
        $this->query_string = '';
        foreach ( (array) array_keys($this->query_vars) as $wpvar) {
            if ( '' != $this->query_vars[$wpvar] ) {
                $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&';
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/classes.php and 1 other location - About 4 hrs to fix
Web.Admin/2014/wordpress/wp-includes/class-wp.php on lines 459..482

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

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 3 locations. Consider refactoring.
Open

            case 'stss': // Sample Table Sync Sample (key frames) atom
                if ($ParseAllPossibleAtoms) {
                    $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
                    $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
                    $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.quicktime.php on lines 932..943
Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.quicktime.php on lines 946..957

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

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 3 locations. Consider refactoring.
Open

            case 'stco': // Sample Table Chunk Offset atom
                if ($ParseAllPossibleAtoms) {
                    $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
                    $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
                    $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.quicktime.php on lines 883..894
Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.quicktime.php on lines 946..957

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

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 build_query_string() {
        $this->query_string = '';
        foreach ( (array) array_keys($this->query_vars) as $wpvar) {
            if ( '' != $this->query_vars[$wpvar] ) {
                $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&';
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-wp.php and 1 other location - About 4 hrs to fix
Web.Admin/2014/wordpress/wp-includes/classes.php on lines 379..395

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

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 3 locations. Consider refactoring.
Open

            case 'co64': // Chunk Offset 64-bit (version of "stco" that supports > 2GB files)
                if ($ParseAllPossibleAtoms) {
                    $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
                    $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
                    $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.quicktime.php on lines 883..894
Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.quicktime.php on lines 932..943

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

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.removeFromArrival = function (participantId) {
            $scope.model.arrivals.forEach(function (travelPlan) {
                if (!travelPlan.Occupants) return;
                var participant = travelPlan.Occupants.find(x => x.Id == participantId);
                if (!participant) return;
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 103..112

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

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

angular.module('repeatFilters', []).
    filter('unique', function () {
        return function (collection, keyname) {
            var output = [],
                keys = [];
Severity: Major
Found in Web.Admin/AdminApp/Filters/filter.repeat.js and 1 other location - About 4 hrs to fix
Web.Admin/ClientApp/app.js on lines 70..86

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

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

angular.module('repeatFilters', [])
    .filter('unique', function () {
        return function (collection, keyname) {
            var output = [],
                keys = [];
Severity: Major
Found in Web.Admin/ClientApp/app.js and 1 other location - About 4 hrs to fix
Web.Admin/AdminApp/Filters/filter.repeat.js on lines 1..17

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

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.removeFromDeparture = function (participantId) {
            $scope.model.departures.forEach(function (travelPlan) {
                if (!travelPlan.Occupants) return;
                var participant = travelPlan.Occupants.find(x => x.Id == participantId);
                if (!participant) return;
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 92..101

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

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 wp-settings.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Used to setup and fix common variables and include
 * the WordPress procedural and class library.
 *
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-settings.php - About 4 hrs to fix

    Function study has 113 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.study = function (invocables) {
        if (!isObject(invocables)) throw new Error("'invocables' must be an object");
        var invocableKeys = objectKeys(invocables || {});
        
        // Perform a topological sort of invocables to build an ordered plan
    Severity: Major
    Found in Web.Admin/z-scripts/angular-ui-router.js - About 4 hrs to fix

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

      case 'trash':
          $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']);
          check_admin_referer('trash-page_' . $post_id);
      
          $post = & get_post($post_id);
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/page.php and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-admin/post.php on lines 193..207

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

      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

      case 'trash':
          $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']);
          check_admin_referer('trash-post_' . $post_id);
      
          $post = & get_post($post_id);
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/post.php and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-admin/page.php on lines 153..167

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

      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

      WP_List_Table has 35 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class WP_List_Table {
      
          /**
           * The current list of items
           *
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 4 hrs to fix

        SimplePie_Misc has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class SimplePie_Misc
        {
            function time_hms($seconds)
            {
                $time = '';
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 4 hrs to fix

          WP_Rewrite has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class WP_Rewrite {
              /**
               * Default permalink structure for WordPress.
               *
               * @since 1.5.0
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/rewrite.php - About 4 hrs to fix

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

                function aspectRatioXY() {
                    x2 = max(left, min(left + imgWidth,
                        x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)));
            
                    y2 = round(max(top, min(top + imgHeight,
            Web.Admin/2014/wordpress/wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js on lines 296..302

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

            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 aspectRatioYX() {
                    y2 = max(top, min(top + imgHeight,
                        y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)));
                    x2 = round(max(left, min(left + imgWidth,
                        x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))));
            Web.Admin/2014/wordpress/wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js on lines 287..294

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

            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