CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

            foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)
            {
                $term = null;
                $scheme = null;
                $label = null;
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php and 1 other location - About 7 hrs to fix
Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 1181..1203

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

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

export class SponsorsService {
  constructor(private http: HttpClient) { }

  getSponsors(year): Observable<Sponsor[]> {
    return this.http
Severity: Major
Found in Website/src/app/services/sponsors.service.ts and 1 other location - About 6 hrs to fix
Website/src/app/services/centres.service.ts on lines 11..27

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

export class CentresService {

  constructor(private http: HttpClient) { }

  getCentres(year): Observable<Centre[]> {
Severity: Major
Found in Website/src/app/services/centres.service.ts and 1 other location - About 6 hrs to fix
Website/src/app/services/sponsors.service.ts on lines 11..26

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

Method _post_row has 173 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function _post_row($a_post, $pending_comments, $mode) {
    global $post, $current_user;
    static $rowclass;

    $global_post = $post;
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 6 hrs to fix

    Method ArrayOfGenres has 173 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function ArrayOfGenres($allowSCMPXextended=false) {
            static $GenreLookup = array(
                0    => 'Blues',
                1    => 'Classic Rock',
                2    => 'Country',
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.tag.id3v1.php - About 6 hrs to fix

      Method _wp_menu_item_classes_by_context has 173 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function _wp_menu_item_classes_by_context( &$menu_items ) {
          global $wp_query, $wp_rewrite;
      
          $queried_object = $wp_query->get_queried_object();
          $queried_object_id = (int) $wp_query->queried_object_id;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/nav-menu-template.php - About 6 hrs to fix

        Function wpmu_delete_blog has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

        function wpmu_delete_blog( $blog_id, $drop = false ) {
            global $wpdb;
        
            $switch = false;
            if ( get_current_blog_id() != $blog_id ) {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/ms.php - About 6 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function wp_kses_hair has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_kses_hair($attr, $allowed_protocols) {
            $attrarr = array ();
            $mode = 0;
            $attrname = '';
            $uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/kses.php - About 6 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 parse has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

            public function parse(&$data, $encoding)
            {
                // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character
                if (strtoupper($encoding) === 'US-ASCII')
                {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parser.php - About 6 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 parse has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

            public function parse()
            {
                if ($this->compressed_size >= $this->min_compressed_size)
                {
                    // Check ID1, ID2, and CM
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/gzdecode.php - About 6 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 parse has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

            function parse(&$data, $encoding)
            {
                // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character
                if (strtoupper($encoding) === 'US-ASCII')
                {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 6 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 parse has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

            function parse()
            {
                if ($this->compressed_size >= $this->min_compressed_size)
                {
                    // Check ID1, ID2, and CM
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 6 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_queried_object has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_queried_object() {
                if (isset($this->queried_object)) {
                    return $this->queried_object;
                }
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/query.php - About 6 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

        File image-edit.dev.js has 454 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var imageEdit;
        
        (function($) {
        imageEdit = {
            iasapi : {},
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/js/image-edit.dev.js - About 6 hrs to fix

          Function scoreEntryController has 172 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var scoreEntryController = function ($scope, $http, $q, $location, modalFactory, dataService) {
                  var url = $location.absUrl();
                  var lastSlash = url.lastIndexOf('/');
                  var year = url.slice(lastSlash + 1) || new Date().getFullYear();
          
          
          Severity: Major
          Found in Web.Admin/AdminApp/Controllers/controller.scoreentry.js - About 6 hrs to fix

            Method decode has 171 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function decode($str)
                {
                    $str = $this->reduce_string($str);
            
                    switch (strtolower($str)) {
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/class-json.php - About 6 hrs to fix

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

                  $offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
                      0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14);
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/functions.php and 1 other location - About 6 hrs to fix
              Web.Admin/2014/wordpress/wp-admin/options-general.php on lines 109..110

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

              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 wp_suggestCategories($args) {
                      $this->escape($args);
              
                      $blog_id                = (int) $args[0];
                      $username                = $args[1];
              Web.Admin/2014/wordpress/xmlrpc.php on lines 1007..1035

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

              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

              $offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
                  0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14);
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/options-general.php and 1 other location - About 6 hrs to fix
              Web.Admin/2014/wordpress/wp-includes/functions.php on lines 3491..3492

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

              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 wp_suggestCategories($args) {
                      $this->escape($args);
              
                      $blog_id                = (int) $args[0];
                      $username                = $args[1];
              Severity: Major
              Found in Web.Admin/2014/wordpress/xmlrpc.php and 1 other location - About 6 hrs to fix
              Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 2891..2919

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

              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