CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Avoid deeply nested control flow statements.
Open

                            for ($i = $top['where']; $i <= $c; ++$i)
                                $chrs = substr_replace($chrs, ' ', $i, 1);
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-json.php - About 45 mins to fix

    Function get_category_feed_link has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function get_category_feed_link($cat_id, $feed = '') {
        $cat_id = (int) $cat_id;
    
        $category = get_category($cat_id);
    
    
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/link-template.php - About 45 mins 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 wpmu_admin_do_redirect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function wpmu_admin_do_redirect( $url = '' ) {
        _deprecated_function( __FUNCTION__, '3.3' );
    
        $ref = '';
        if ( isset( $_GET['ref'] ) )
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ms-deprecated.php - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                                    if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
                                    ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
                                        $utf8 .= $chrs{++$c};
                                    }
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-json.php - About 45 mins to fix

      Function Send has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        function Send() {
          $header = '';
          $body = '';
          $result = true;
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.php - About 45 mins 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

      Method display_element has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/classes.php - About 45 mins to fix

        Function delete_metadata has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = false) {
            if ( !$meta_type || !$meta_key || (!$delete_all && ! (int)$object_id) )
                return false;
        
            if ( ! $table = _get_meta_table($meta_type) )
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/meta.php - About 45 mins 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_lines has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          function get_lines() {
            $data = "";
            while($str = @fgets($this->smtp_conn,515)) {
              if($this->do_debug >= 4) {
                echo "SMTP -> get_lines(): \$data was \"$data\"" .
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-smtp.php - About 45 mins 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_put_post_revision has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function _wp_put_post_revision( $post = null, $autosave = false ) {
            if ( is_object($post) )
                $post = get_object_vars( $post );
            elseif ( !is_array($post) )
                $post = get_post($post, ARRAY_A);
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/revision.php - About 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                                    if (++i == bowler.QualifyingPosition)
                                        continue;
        Severity: Major
        Found in Aggregates/Admin/QualifyingPositionFixer.cs - About 45 mins to fix

          Function build_query_string has a Cognitive Complexity of 8 (exceeds 5 allowed). 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: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/classes.php - About 45 mins 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

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

                          var homeSingleParticipant = CommandQueries.GetTeamParticipants(command.Home.Id)
                              .Where(x => !x.IsReplaced)
                              .OrderBy(x => x.QualifyingPosition)
                              .FirstOrDefault() ?? new CommandQueries.Participant();
          Severity: Minor
          Found in Aggregates/Scores/ScoresCommandHandlers.cs and 1 other location - About 45 mins to fix
          Aggregates/Scores/ScoresCommandHandlers.cs on lines 40..43

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

          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 awaySingleParticipant = CommandQueries.GetTeamParticipants(command.Away.Id)
                              .Where(x => !x.IsReplaced)
                              .OrderBy(x => x.QualifyingPosition)
                              .FirstOrDefault() ?? new CommandQueries.Participant();
          Severity: Minor
          Found in Aggregates/Scores/ScoresCommandHandlers.cs and 1 other location - About 45 mins to fix
          Aggregates/Scores/ScoresCommandHandlers.cs on lines 49..52

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

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

                  defaults: {
                      id:      'embed',
                      url:     '',
                      menu:    'default',
                      content: 'embed',
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js and 3 other locations - About 45 mins to fix
          Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 528..537
          Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 595..604
          Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 2743..2752

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

          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

                  onPostRender: function() {
                      var self = this;
          
                      editor.on('FullscreenStateChanged', function(e) {
                          self.active(e.state);
          Web.Admin/2014/wordpress/wp-includes/js/tinymce/plugins/fullscreen/plugin.js on lines 108..114

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

          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

                  {
                      $trk.css({zIndex:290});
                      if (trackDoc)
                      {
                          $(document)
          Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js on lines 92..93

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

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

                  defaults: {
                      id:      'image',
                      url:     '',
                      menu:    'image-details',
                      content: 'image-details',
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js and 3 other locations - About 45 mins to fix
          Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 528..537
          Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 595..604
          Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 1329..1339

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

          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

          {$trk.css({zIndex:290});if(trackDoc)
          {$(document).unbind('mousemove',trackMove).unbind('mouseup',trackUp);}}
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js and 1 other location - About 45 mins to fix
          Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js on lines 666..675

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

          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

          Form.EventObserver = Class.create(Abstract.EventObserver, {
            getValue: function() {
              return Form.serialize(this.element);
            }
          });
          Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 3677..3681

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

          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

                  onPostRender: function() {
                      var self = this;
          
                      editor.on('FullscreenStateChanged', function(e) {
                          self.active(e.state);
          Web.Admin/2014/wordpress/wp-includes/js/tinymce/plugins/fullscreen/plugin.js on lines 122..128

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

          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