CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function users2wp has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    function users2wp($users='')
    {
        // General Housekeeping
        global $wpdb;
        $count = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/textpattern.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_newComment has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    function wp_newComment($args) {
        global $wpdb;

        $this->escape($args);

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

function get_bloginfo($show = '', $filter = 'raw') {

    switch($show) {
        case 'url' :
        case 'home' : // DEPRECATED
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/general-template.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_newComment has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    function wp_newComment($args) {
        global $wpdb;

        $this->escape($args);

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

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

        ///AH
        $info['ac3']['raw']['bsi'] = array();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ac3.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_authors has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_authors()
    {
        $authors = array();
        foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.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_list_post_revisions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function wp_list_post_revisions( $post_id = 0, $args = null ) {
    if ( !$post = get_post( $post_id ) )
        return;

    $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post-template.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_authors has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    function get_authors()
    {
        $authors = array();
        foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
        {
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 send_headers has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    function send_headers() {
        $headers = array('X-Pingback' => get_bloginfo('pingback_url'));
        $status = null;
        $exit_required = false;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/classes.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 arrivalsController has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var arrivalsController = function ($scope, $http, $q, $location, modalFactory, dataService) {
        var url = $location.absUrl();
        var lastSlash = url.lastIndexOf('/');
        var province = url.slice(lastSlash + 1);
        var year = url.slice(lastSlash - 4, lastSlash);
Severity: Major
Found in Web.Admin/AdminApp/Controllers/controller.arrivals.js - About 4 hrs to fix

    Method pingback_ping has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function pingback_ping($args) {
            global $wpdb;
    
            do_action('xmlrpc_call', 'pingback.ping');
    
    
    Severity: Major
    Found in Web.Admin/2014/wordpress/xmlrpc.php - About 4 hrs to fix

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

              if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())
              {
                  if ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local))
                  {
                      return $working;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Locator.php and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 14103..14124

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

      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 ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())
              {
                  if ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local))
                  {
                      return $working;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/SimplePie/Locator.php on lines 120..141

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

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

          public function HandleAllTags() {
      
              // key name => array (tag name, character encoding)
              static $tags;
              if (empty($tags)) {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.php - About 4 hrs to fix

        Method get_blog_details has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function get_blog_details( $fields = null, $get_all = true ) {
            global $wpdb;
        
            if ( is_array($fields ) ) {
                if ( isset($fields['blog_id']) ) {
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/ms-blogs.php - About 4 hrs to fix

          File ng-file-upload-shim.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**!
           * AngularJS file upload/drop directive and service with progress and abort
           * FileAPI Flash shim for old browsers not supporting FormData 
           * @author  Danial  <danial.farid@gmail.com>
           * @version 4.2.1
          Severity: Minor
          Found in Web.Admin/z-scripts/ng-file-upload-shim.js - About 4 hrs to fix

            Method import_posts has 100 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function import_posts() {
                    global $wpdb, $current_user;
            
                    set_magic_quotes_runtime(0);
                    $importdata = file($this->file); // Read the file into an array
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-admin/import/blogware.php - About 4 hrs to fix

              SimplePie_Item has 32 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class SimplePie_Item
              {
                  /**
                   * Parent feed
                   *
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 4 hrs to fix

                wpdb has 32 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class wpdb {
                
                    /**
                     * Whether to show SQL/DB errors
                     *
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/wp-db.php - About 4 hrs to fix

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

                  Element._getContentFromAnonymousElement = function(tagName, html) {
                    var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
                    div.innerHTML = t[0] + html + t[1];
                    t[2].times(function() { div = div.firstChild });
                    return $A(div.childNodes);
                  Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 2477..2482

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

                  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