CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

                        if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
                        {
                            foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
                            {
                                $credit_role = null;
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 2 other locations - About 1 day to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 4731..4760
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 5250..5283

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

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

function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false) {
    $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error, $context);
    if ( '' !== $req_cred )
        return $req_cred;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/file.php - About 1 day 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 user_can_access_admin_page has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

function user_can_access_admin_page() {
    global $pagenow;
    global $menu;
    global $submenu;
    global $_wp_menu_nopriv;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 1 day 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 import_blog has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    function import_blog($blogID) {
        global $importing_blog;
        $importing_blog = $blogID;

        if ( isset($_GET['authors']) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.php - About 1 day 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 GuessEncoderOptions has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    public function GuessEncoderOptions() {
        // shortcuts
        $info = &$this->getid3->info;
        if (!empty($info['mpeg']['audio'])) {
            $thisfile_mpeg_audio = &$info['mpeg']['audio'];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.mp3.php - About 1 day 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_bookmarks has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

function get_bookmarks($args = '') {
    global $wpdb;

    $defaults = array(
        'orderby' => 'name', 'order' => 'ASC',
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/bookmark.php - About 1 day 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_salt has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

function wp_salt($scheme = 'auth') {
    global $wp_default_secret_key;
    $secret_key = '';
    if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ( $wp_default_secret_key != SECRET_KEY) )
        $secret_key = SECRET_KEY;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/pluggable.php - About 1 day 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 TelemetryContext has 209 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        var TelemetryContext = (function () {
            function TelemetryContext(config) {
                var _this = this;
                this._config = config;
                this._sender = new ApplicationInsights.Sender(config);
Severity: Major
Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 1 day to fix

    File file.php has 515 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * File contains all the administration image manipulation functions.
     *
     * @package WordPress
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/includes/file.php - About 1 day to fix

      Method Analyze has 209 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function Analyze()
          {
              $info = &$this->getid3->info;
      
              // parse container

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

        Ajax.Responders = {
          responders: [],
        
          _each: function(iterator) {
            this.responders._each(iterator);
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 1 day to fix
        Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 1142..1167

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

        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

        Ajax.Responders = {
          responders: [],
        
          _each: function(iterator) {
            this.responders._each(iterator);
        Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 1142..1167

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

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

            function embed($options = '', $native = false)
            {
                // Set up defaults
                $audio = '';
                $video = '';
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 day to fix

          Method Analyze has 207 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function Analyze() {
                  $info = &$this->getid3->info;
          
                  $info['fileformat'] = 'ogg';
          
          
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 1 day to fix

            Function get_calendar has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
            Open

            function get_calendar($initial = true) {
                global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
            
                $cache = array();
                $key = md5( $m . $monthnum . $year );
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 1 day 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 Analyze has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
            Open

                public function Analyze() {
                    $info = &$this->getid3->info;
            
                    $info['fileformat'] = 'ogg';
            
            
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 1 day to fix

            Cognitive Complexity

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

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

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

            Further reading

            Method SimplePie_File has 205 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function SimplePie_File($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false)
                {
                    if (class_exists('idna_convert'))
                    {
                        $idn =& new idna_convert;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 day to fix

              File jquery.imgareaselect.dev.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * imgAreaSelect jQuery plugin
               * version 0.9.1
               *
               * Copyright (c) 2008-2009 Michal Wojciechowski (odyniec.net)

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

                                            if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
                                            {
                                                foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
                                                {
                                                    $term = null;
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php and 2 other locations - About 1 day to fix
                Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 1908..1933
                Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 2496..2521

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

                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

                                        if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
                                        {
                                            foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
                                            {
                                                $term = null;
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php and 2 other locations - About 1 day to fix
                Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 1908..1933
                Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 1934..1959

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

                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