CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function mw_getPost has a Cognitive Complexity of 30 (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/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 sanitize_post_field has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

function sanitize_post_field($field, $value, $post_id, $context) {
    $int_fields = array('ID', 'post_parent', 'menu_order');
    if ( in_array($field, $int_fields) )
        $value = (int) $value;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.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_setup_nav_menu_item has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

function wp_setup_nav_menu_item( $menu_item ) {
    if ( isset( $menu_item->post_type ) ) {
        if ( 'nav_menu_item' == $menu_item->post_type ) {
            $menu_item->db_id = (int) $menu_item->ID;
            $menu_item->menu_item_parent = empty( $menu_item->menu_item_parent ) ? get_post_meta( $menu_item->ID, '_menu_item_menu_item_parent', true ) : $menu_item->menu_item_parent;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/nav-menu.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 SimplePie_Cache_MySQL has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    function SimplePie_Cache_MySQL($mysql_location, $name, $extension)
    {
        $host = $mysql_location->get_host();
        if (SimplePie_Misc::stripos($host, 'unix(') === 0 && substr($host, -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 Uncompress has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    function Uncompress($ip)
    {
        $uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip);
        $c1 = -1;
        $c2 = -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 get_type has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    function get_type()
    {
        if (!isset($this->data['type']))
        {
            $this->data['type'] = SIMPLEPIE_TYPE_ALL;
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 end_element has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    function end_element($parser, $name) {

        $tag = array_pop(split(":", $name));

        $ccount = count($this->in_content);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/atomlib.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 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    load: function(src, size, callback) {

        if ( typeof size == 'function' ) {
            callback = size;
            size = null;
Severity: Major
Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 4 hrs to fix

    Function load has 110 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        load: function(src, size, callback) {
    
            if ( typeof size == 'function' ) {
                callback = size;
                size = null;
    Severity: Major
    Found in Web.Admin/Content/galleria/galleria-1.4.2.js - About 4 hrs to fix

      Method parse_request has 110 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function parse_request($extra_query_vars = '') {
              global $wp_rewrite;
      
              $this->query_vars = array();
              $taxonomy_query_vars = array();
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/classes.php - About 4 hrs to fix

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

                function DeleteGuestPackage(id) {
                    dataService.DeleteGuestPackage(vm.Year, id)
                        .then(function (response) {
                            var guestPackages = vm.GuestPackages.filter(function (x) { return x.Id == id; })[0];
                            var idx = vm.GuestPackages.indexOf(guestPackages);
        Severity: Major
        Found in Web.Admin/AdminApp/Controllers/controller.guestpackages.js and 4 other locations - About 4 hrs to fix
        Web.Admin/AdminApp/Controllers/controller.centres.js on lines 42..52
        Web.Admin/AdminApp/Controllers/controller.hotel.js on lines 61..71
        Web.Admin/AdminApp/Controllers/controller.news.js on lines 34..44
        Web.Admin/AdminApp/Controllers/controller.sponsors.js on lines 42..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 123.

        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

                    TelemetryContext.prototype._applyInternalContext = function (envelope, internalContext) {
                        if (internalContext) {
                            var tagKeys = new AI.ContextTagKeys();
                            if (typeof internalContext.agentVersion === "string") {
                                envelope.tags[tagKeys.internalAgentVersion] = internalContext.agentVersion;
        Severity: Major
        Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 2 other locations - About 4 hrs to fix
        Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1836..1846
        Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1932..1942

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

        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

                    TelemetryContext.prototype._applySessionContext = function (envelope, sessionContext) {
                        if (sessionContext) {
                            var tagKeys = new AI.ContextTagKeys();
                            if (typeof sessionContext.id === "string") {
                                envelope.tags[tagKeys.sessionId] = sessionContext.id;
        Severity: Major
        Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 2 other locations - About 4 hrs to fix
        Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1836..1846
        Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1885..1895

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

        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

                function DeleteSponsor(id) {
                    dataService.DeleteSponsor(vm.Year, id)
                        .then(function (response) {
                            var sponsor = vm.Sponsors.filter(function (x) { return x.Id == id; })[0];
                            var idx = vm.Sponsors.indexOf(sponsor);
        Severity: Major
        Found in Web.Admin/AdminApp/Controllers/controller.sponsors.js and 4 other locations - About 4 hrs to fix
        Web.Admin/AdminApp/Controllers/controller.centres.js on lines 42..52
        Web.Admin/AdminApp/Controllers/controller.guestpackages.js on lines 28..38
        Web.Admin/AdminApp/Controllers/controller.hotel.js on lines 61..71
        Web.Admin/AdminApp/Controllers/controller.news.js on lines 34..44

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

        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

                function DeleteNews(id) {
                    dataService.DeleteNews(vm.Year, id)
                        .then(function (response) {
                            var news = vm.News.filter(function (x) { return x.Id == id; })[0];
                            var idx = vm.News.indexOf(news);
        Severity: Major
        Found in Web.Admin/AdminApp/Controllers/controller.news.js and 4 other locations - About 4 hrs to fix
        Web.Admin/AdminApp/Controllers/controller.centres.js on lines 42..52
        Web.Admin/AdminApp/Controllers/controller.guestpackages.js on lines 28..38
        Web.Admin/AdminApp/Controllers/controller.hotel.js on lines 61..71
        Web.Admin/AdminApp/Controllers/controller.sponsors.js on lines 42..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 123.

        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

                function DeleteHotel(id) {
                    dataService.DeleteHotel(vm.Year, id)
                        .then(function (response) {
                            var hotel = vm.Hotels.filter(function (x) { return x.Id == id; })[0];
                            var idx = vm.Hotels.indexOf(hotel);
        Severity: Major
        Found in Web.Admin/AdminApp/Controllers/controller.hotel.js and 4 other locations - About 4 hrs to fix
        Web.Admin/AdminApp/Controllers/controller.centres.js on lines 42..52
        Web.Admin/AdminApp/Controllers/controller.guestpackages.js on lines 28..38
        Web.Admin/AdminApp/Controllers/controller.news.js on lines 34..44
        Web.Admin/AdminApp/Controllers/controller.sponsors.js on lines 42..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 123.

        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

                function DeleteCentre(id) {
                    dataService.DeleteCentre(vm.Year, id)
                        .then(function (response) {
                            var centre = vm.Centres.filter(function (x) { return x.Id == id; })[0];
                            var idx = vm.Centres.indexOf(centre);
        Severity: Major
        Found in Web.Admin/AdminApp/Controllers/controller.centres.js and 4 other locations - About 4 hrs to fix
        Web.Admin/AdminApp/Controllers/controller.guestpackages.js on lines 28..38
        Web.Admin/AdminApp/Controllers/controller.hotel.js on lines 61..71
        Web.Admin/AdminApp/Controllers/controller.news.js on lines 34..44
        Web.Admin/AdminApp/Controllers/controller.sponsors.js on lines 42..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 123.

        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

                    TelemetryContext.prototype._applyApplicationContext = function (envelope, appContext) {
                        if (appContext) {
                            var tagKeys = new AI.ContextTagKeys();
                            if (typeof appContext.ver === "string") {
                                envelope.tags[tagKeys.applicationVersion] = appContext.ver;
        Severity: Major
        Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 2 other locations - About 4 hrs to fix
        Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1885..1895
        Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1932..1942

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

        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

            2019: {
              Theme: 'theme-2019',
              Contingents: [ ...this.provinces ],
              Welcome: `Welcome to the online home of the 2019 Master Bowlers Association of Canada Nationals,
                taking place June 28 - July 4, 2019 in Gatineau, Quebec.`,
        Severity: Major
        Found in Website/src/app/services/tournaments.service.ts and 1 other location - About 4 hrs to fix
        Website/src/app/services/tournaments.service.ts on lines 84..109

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

        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

            2017: {
              Theme: 'theme-2017',
              Contingents: [ ...this.provinces ],
              Welcome: `Welcome to the online home of the 2017 Master Bowlers Association of Canada Nationals,
                taking place June 29 - July 3, 2017 in Regina, SK.`,
        Severity: Major
        Found in Website/src/app/services/tournaments.service.ts and 1 other location - About 4 hrs to fix
        Website/src/app/services/tournaments.service.ts on lines 29..54

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

        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