CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function _display_rows_hierarchical has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
        global $wpdb;

        $level = 0;

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 37 (exceeds 5 allowed). Consider refactoring.
Open

    function dispatch()
    {

        if (empty ($_GET['step']))
            $step = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/textpattern.php - About 5 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 cron_recheck has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public static function cron_recheck() {
        global $wpdb;

        $api_key = self::get_api_key();

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/class.akismet.php - About 5 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 QuicktimeParseNikonNCTG has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function QuicktimeParseNikonNCTG($atom_data) {
        // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG
        // Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100
        // Data is stored as records of:
        // * 4 bytes record type

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

    function get_real_type($find_handler = false)
    {
        // If it's Odeo, let's get it out of the way.
        if (substr(strtolower($this->get_link()), 0, 15) === 'http://odeo.com')
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 5 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_active_blog_for_user has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

function get_active_blog_for_user( $user_id ) {
    global $wpdb;
    $blogs = get_blogs_of_user( $user_id );
    if ( empty( $blogs ) )
        return null;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ms-functions.php - About 5 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 _bind has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    final protected function _bind() {
        if ( $this->bound )
            return;

        // Add the root node.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-admin-bar.php - About 5 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

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

        } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GRID')) { // 4.26  GRID Group identification registration (ID3v2.3+ only)

            //   There may be several 'GRID' frames in a tag,
            //   but only one containing the same symbol
            //   and only one containing the same owner identifier
Web.Admin/2014/wordpress/wp-includes/ID3/module.tag.id3v2.php on lines 1784..1806

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

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

        } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ENCR')) { // 4.25  ENCR Encryption method registration (ID3v2.3+ only)
            //   There may be several 'ENCR' frames in a tag,
            //   but only one containing the same symbol
            //   and only one containing the same owner identifier
            // <Header for 'Encryption method registration', ID: 'ENCR'>
Web.Admin/2014/wordpress/wp-includes/ID3/module.tag.id3v2.php on lines 1806..1829

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

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

function wp_save_image($post_id) {
    $return = '';
    $success = $delete = $scaled = $nocrop = false;
    $post = get_post($post_id);
    @ini_set('memory_limit', '256M');
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/image-edit.php - About 5 hrs to fix

    Method initialise_blog_option_info has 139 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function initialise_blog_option_info() {
            global $wp_version;
    
            $this->blog_options = array(
                // Read only options
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 5 hrs to fix

      Method parse has 139 lines of code (exceeds 25 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: Major
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parser.php - About 5 hrs to fix

        Method parse has 139 lines of code (exceeds 25 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: Major
        Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 5 hrs to fix

          Method RegisterRoutes has 139 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public static void RegisterRoutes(RouteCollection routes)
                  {
                      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
                      routes.IgnoreRoute("AdminAppV2");
          
          Severity: Major
          Found in Web.Admin/App_Start/RouteConfig.cs - About 5 hrs to fix

            File responsive-nav.js has 398 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*! responsive-nav.js 1.0.32
             * https://github.com/viljamis/responsive-nav.js
             * http://responsive-nav.com
             *
             * Copyright (c) 2014 @viljamis
            Severity: Minor
            Found in Web.Admin/2015/js/responsive-nav.js - About 5 hrs to fix

              File responsive-nav.js has 398 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*! responsive-nav.js 1.0.32
               * https://github.com/viljamis/responsive-nav.js
               * http://responsive-nav.com
               *
               * Copyright (c) 2014 @viljamis
              Severity: Minor
              Found in Web.Admin/2014/js/responsive-nav.js - About 5 hrs to fix

                File functions.php has 398 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * @package WordPress
                 * @subpackage Default_Theme
                 */
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-content/themes/default/functions.php - About 5 hrs to fix

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

                  {var s=options.handleSize,o=hhs,h=s,w=s,t=o,l=o;switch(ord)
                  {case'n':case's':w=pct(100);break;case'e':case'w':h=pct(100);break;}
                  return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});};function createHandles(li)
                  Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js on lines 475..489

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

                  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

                          {
                              var s = options.handleSize,
                                  o = hhs,
                                  h = s, w = s,
                                  t = o, l = o;
                  Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js on lines 66..68

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

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

                      var reportController = function ($scope, $http, $q, $location, modalFactory, dataService) {
                          var url = $location.absUrl();
                          var lastSlash = url.lastIndexOf('/');
                          var year = url.slice(lastSlash + 1);
                  
                  
                  Severity: Major
                  Found in Web.Admin/AdminApp/Controllers/controller.reports.js - About 5 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language