CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

    function atom_10_content_construct_type($attribs)
    {
        if (isset($attribs['']['type']))
        {
            $type = strtolower(trim($attribs['']['type']));
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 4 hrs to fix
Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php on lines 1893..1922

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

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

            var _SessionManager = (function () {
                function _SessionManager(config, sessionHandler) {
                    if (!config) {
                        config = {};
                    }
Severity: Major
Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 4 hrs to fix

    Function Initialization has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            var Initialization = (function () {
                function Initialization(snippet) {
                    snippet.queue = snippet.queue || [];
                    var config = snippet.config || {};
                    if (config && !config.instrumentationKey) {
    Severity: Major
    Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 4 hrs to fix

      Method Data has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function Data($msg_data) {
          $this->error = null; # so no confusion is caused
      
          if(!$this->connected()) {
            $this->error = array(
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/class-smtp.php - About 4 hrs to fix

        File ParticipantCommandHandlers.cs has 338 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using Edument.CQRS;
        using Events.Participant;
        using MBACNationals.Participant.Commands;
        using MBACNationals.ReadModels;
        using System;
        Severity: Minor
        Found in Aggregates/Participant/ParticipantCommandHandlers.cs - About 4 hrs to fix

          File TournamentQueries.cs has 338 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using Edument.CQRS;
          using Events.Tournament;
          using System;
          using System.Collections.Generic;
          using System.Linq;
          Severity: Minor
          Found in ReadModels/TournamentQueries.cs - About 4 hrs to fix

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

            export class MostWinsComponent implements OnInit {
              year: number;
            
              constructor(
                private route: ActivatedRoute,
            Website/src/app/website/centres-page/centres-page.component.ts on lines 9..23
            Website/src/app/website/location-page/location-page.component.ts on lines 9..23
            Website/src/app/website/news-page/news-page.component.ts on lines 9..23
            Website/src/app/website/statistics-page/high-average/high-average.component.ts on lines 9..22

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

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

            export class HighAverageComponent implements OnInit {
              year: number;
            
              constructor(
                private route: ActivatedRoute,
            Website/src/app/website/centres-page/centres-page.component.ts on lines 9..23
            Website/src/app/website/location-page/location-page.component.ts on lines 9..23
            Website/src/app/website/news-page/news-page.component.ts on lines 9..23
            Website/src/app/website/statistics-page/most-wins/most-wins.component.ts on lines 9..22

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

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

            export class LocationPageComponent implements OnInit {
              year: number;
            
              constructor(
                private route: ActivatedRoute
            Website/src/app/website/centres-page/centres-page.component.ts on lines 9..23
            Website/src/app/website/news-page/news-page.component.ts on lines 9..23
            Website/src/app/website/statistics-page/high-average/high-average.component.ts on lines 9..22
            Website/src/app/website/statistics-page/most-wins/most-wins.component.ts on lines 9..22

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

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

            export class NewsPageComponent implements OnInit {
              year: number;
            
              constructor(
                private route: ActivatedRoute
            Severity: Major
            Found in Website/src/app/website/news-page/news-page.component.ts and 4 other locations - About 4 hrs to fix
            Website/src/app/website/centres-page/centres-page.component.ts on lines 9..23
            Website/src/app/website/location-page/location-page.component.ts on lines 9..23
            Website/src/app/website/statistics-page/high-average/high-average.component.ts on lines 9..22
            Website/src/app/website/statistics-page/most-wins/most-wins.component.ts on lines 9..22

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

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

            export class CentresPageComponent implements OnInit {
              year: number;
            
              constructor(
                private route: ActivatedRoute
            Website/src/app/website/location-page/location-page.component.ts on lines 9..23
            Website/src/app/website/news-page/news-page.component.ts on lines 9..23
            Website/src/app/website/statistics-page/high-average/high-average.component.ts on lines 9..22
            Website/src/app/website/statistics-page/most-wins/most-wins.component.ts on lines 9..22

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

            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 plugin.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* global tinymce */
            /**
             * WordPress View plugin.
             */
            tinymce.PluginManager.add( 'wpview', function( editor ) {

              Function nth has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  nth: function(nodes, formula, root, reverse, ofType) {
                    if (nodes.length == 0) return [];
                    if (formula == 'even') formula = '2n+0';
                    if (formula == 'odd')  formula = '2n+1';
                    var h = Selector.handlers, results = [], indexed = [], m;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.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 updateStyle has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  updateStyle : function() {
                      var dom = tinyMCEPopup.dom, st, v, cls, oldcls, rep, f = document.forms[0];
              
                      if (tinyMCEPopup.editor.settings.inline_styles) {
                          st = tinyMCEPopup.dom.parseStyle(this.styleVal);

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

                setOptions: function(options) {
                  this.options = Object.extend({
                    choices: 10,
                    partialSearch: true,
                    partialChars: 2,
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/controls.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 nth has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  nth: function(nodes, formula, root, reverse, ofType) {
                    if (nodes.length == 0) return [];
                    if (formula == 'even') formula = '2n+0';
                    if (formula == 'odd')  formula = '2n+1';
                    var h = Selector.handlers, results = [], indexed = [], m;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.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 mdel has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  function mdel($remote, $continious=false) {
                      $list=$this->rawlist($remote, "-la");
                      if($list===false) {
                          $this->PushError("mdel","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
                          return false;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.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 _get_row_actions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  function _get_row_actions( $post, $att_title ) {
                      $actions = array();
              
                      if ( $this->detached ) {
                          if ( current_user_can( 'edit_post', $post->ID ) )

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

              function _wp_ajax_add_hierarchical_term() {
                  $action = $_POST['action'];
                  $taxonomy = get_taxonomy(substr($action, 4));
                  check_ajax_referer( $action, '_ajax_nonce-add-' . $taxonomy->name );
                  if ( !current_user_can( $taxonomy->cap->edit_terms ) )
              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 dispatch has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  function dispatch() {
                      global $wpdb, $user_ID;
              $step = $_POST['step'];
              if (!$step) $step = 0;
              ?>
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/import/opml.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