CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function addMethods has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

Element.addMethods = function(methods) {
  var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;

  if (!methods) {
    Object.extend(Form, Form.Methods);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - 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 media_upload_library_form has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

function media_upload_library_form($errors) {
    global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;

    media_upload_header();

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/media.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_insert_link has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

function wp_insert_link( $linkdata, $wp_error = false ) {
    global $wpdb, $current_user;

    $defaults = array( 'link_id' => 0, 'link_name' => '', 'link_url' => '', 'link_rating' => 0 );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/bookmark.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 prepare_items has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    function prepare_items() {
        global $s, $mode, $wpdb;

        $current_site = get_current_site();

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

function screen_meta($screen) {
    global $wp_meta_boxes, $_wp_contextual_help;

    $screen = str_replace('.php', '', $screen);
    $screen = str_replace('-new', '', $screen);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/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 install_package has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    function install_package($args = array()) {
        global $wp_filesystem;
        $defaults = array( 'source' => '', 'destination' => '', //Please always pass these
                        'clear_destination' => false, 'clear_working' => false,
                        'hook_extra' => array());
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 import_posts has a Cognitive Complexity of 33 (exceeds 5 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: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/blogware.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 pingback_ping has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    function pingback_ping($args) {
        global $wpdb;

        /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
        do_action( 'xmlrpc_call', 'pingback.ping' );
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 getHashdata has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHashdata($algorithm) {
        switch ($algorithm) {
            case 'md5':
            case 'sha1':
                break;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.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 readData has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function readData() {
        $this->skipBits(8);
        $this->skipBits(8);
        $profile = $this->getBits(8);    //    read profile
        $this->skipBits(16);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.flv.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 _getTransport has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    function &_getTransport( $args = array() ) {
        static $working_transport, $blocking_transport, $nonblocking_transport;

        if ( is_null($working_transport) ) {
            if ( true === WP_Http_ExtHttp::test($args) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/http.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_save_post_revision has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

function wp_save_post_revision( $post_id ) {
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
        return;

    if ( ! $post = get_post( $post_id ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/revision.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

File customize-base.js has 371 lines of code (exceeds 250 allowed). Consider refactoring.
Open

window.wp = window.wp || {};

(function( exports, $ ){
    var api, extend, ctor, inherits,
        slice = Array.prototype.slice;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/js/customize-base.js - About 4 hrs to fix

    File user.php has 371 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * WordPress user administration API.
     *
     * @package WordPress
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/user.php - About 4 hrs to fix

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

      if (Prototype.BrowserFeatures.XPath) {
        document._getElementsByXPath = function(expression, parentElement) {
          var results = [];
          var query = document.evaluate(expression, $(parentElement) || document,
            null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 1521..1530

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

      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 (Prototype.BrowserFeatures.XPath) {
        document._getElementsByXPath = function(expression, parentElement) {
          var results = [];
          var query = document.evaluate(expression, $(parentElement) || document,
            null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
      Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 1521..1530

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

      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 ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
                  || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml'))
      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/Parser.php on lines 324..325

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

      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 ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
                  || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parser.php and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 14568..14569

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

      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

          if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
              wp_cache_switch_to_blog( $blog );
          } else {
              global $wp_object_cache;
      
      
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ms-blogs.php and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/ms-blogs.php on lines 606..625

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

      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

          if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
              wp_cache_switch_to_blog( $new_blog );
          } else {
              global $wp_object_cache;
      
      
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ms-blogs.php and 1 other location - About 4 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/ms-blogs.php on lines 669..688

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

      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