CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

File kses.php has 696 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * HTML/XHTML filter that only allows some elements and attributes
 *
 * Added wp_ prefix to avoid conflicts with existing kses users
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/kses.php - About 1 day to fix

    Function mw_editPost has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
    Open

        function mw_editPost($args) {
    
            $this->escape($args);
    
            $post_ID     = (int) $args[0];
    Severity: Minor
    Found in Web.Admin/2014/wordpress/xmlrpc.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 generate_rewrite_rules has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
    Open

        function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) {
            //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/?
            $feedregex2 = '';
            foreach ( (array) $this->feeds as $feed_name) {
                $feedregex2 .= $feed_name . '|';
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/rewrite.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

    File media-models.js has 688 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* global _wpMediaModelsL10n:false */
    window.wp = window.wp || {};
    
    (function($){
        var Attachment, Attachments, Query, PostImage, compare, l10n, media;
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/media-models.js - About 1 day to fix

      Function map_meta_cap has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
      Open

      function map_meta_cap( $cap, $user_id ) {
          $args = array_slice( func_get_args(), 2 );
          $caps = array();
      
          switch ( $cap ) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/capabilities.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 getOnlyMPEGaudioInfoBruteForce has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getOnlyMPEGaudioInfoBruteForce() {
              $MPEGaudioHeaderDecodeCache   = array();
              $MPEGaudioHeaderValidCache    = array();
              $MPEGaudioHeaderLengthCache   = array();
              $MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();
      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_pages has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
      Open

      function &get_pages($args = '') {
          global $wpdb;
      
          $defaults = array(
              'child_of' => 0, 'sort_order' => 'ASC',
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/post.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 embed has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
      Open

          function embed($options = '', $native = false)
          {
              // Set up defaults
              $audio = '';
              $video = '';
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.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

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

      function _wp_post_revision_fields( $post = null, $autosave = false ) {
          static $fields = false;
      
          if ( !$fields ) {
              // Allow these to be versioned
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/post.php and 1 other location - About 1 day to fix
      Web.Admin/2014/wordpress/wp-includes/revision.php on lines 23..70

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

      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_post_revision_fields( $post = null, $autosave = false ) {
          static $fields = false;
      
          if ( !$fields ) {
              // Allow these to be versioned
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/revision.php and 1 other location - About 1 day to fix
      Web.Admin/2014/wordpress/wp-includes/post.php on lines 3658..3692

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

      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 Class = {
        create: function() {
          var parent = null, properties = $A(arguments);
          if (Object.isFunction(properties[0]))
            parent = properties.shift();
      Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 43..74

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

      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 Class = {
        create: function() {
          var parent = null, properties = $A(arguments);
          if (Object.isFunction(properties[0]))
            parent = properties.shift();
      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 43..74

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

      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 fix_protocol($url, $http = 1)
          {
              $url = SimplePie_Misc::normalize_url($url);
              $parsed = SimplePie_Misc::parse_url($url);
              if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 1 day to fix
      Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php on lines 195..225

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

      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

          public static function fix_protocol($url, $http = 1)
          {
              $url = SimplePie_Misc::normalize_url($url);
              $parsed = SimplePie_Misc::parse_url($url);
              if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php and 1 other location - About 1 day to fix
      Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 9285..9315

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

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

          public static function CopyTagsToComments(&$ThisFileInfo) {
      
              // Copy all entries from ['tags'] into common ['comments']
              if (!empty($ThisFileInfo['tags'])) {
                  foreach ($ThisFileInfo['tags'] as $tagtype => $tagarray) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

      File dashboard.php has 672 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * WordPress Dashboard Widget Administration Panel API
       *
       * @package WordPress
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/dashboard.php - About 1 day to fix

        Function search_theme_directories has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
        Open

        function search_theme_directories() {
            global $wp_theme_directories, $wp_broken_themes;
            if ( empty( $wp_theme_directories ) )
                return false;
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/theme.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

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

                    elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))
                    {
                        foreach ($captions as $caption)
                        {
                            $caption_type = null;
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php and 1 other location - About 1 day to fix
        Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 1111..1174

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

        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

                    if ($captions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))
                    {
                        foreach ($captions as $caption)
                        {
                            $caption_type = null;
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php and 1 other location - About 1 day to fix
        Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php on lines 1143..1174

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        File plugin.php has 664 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * WordPress Plugin Administration API
         *
         * @package WordPress
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 1 day to fix
          Severity
          Category
          Status
          Source
          Language