CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function _page_rows has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {

    if ( ! isset( $children_pages[$parent] ) )
        return;

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

function delete_plugins($plugins, $redirect = '' ) {
    global $wp_filesystem;

    if( empty($plugins) )
        return false;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 3 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 dirlist has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function dirlist($path, $include_hidden = true, $recursive = false) {
        if ( $this->is_file($path) ) {
            $limit_file = basename($path);
            $path = dirname($path);
        } else {

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

    function start_element($parser, $name, $attrs) {

        $tag = array_pop(split(":", $name));

        array_unshift($this->ns_contexts, $this->ns_decls);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.php - About 3 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 handle_request has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function handle_request() {
        global $always_authenticate;

        if( !empty( $_SERVER['ORIG_PATH_INFO'] ) )
            $path = $_SERVER['ORIG_PATH_INFO'];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-app.php - About 3 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 comment_row_action has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public static function comment_row_action( $a, $comment ) {

        // failsafe for old WP versions
        if ( !function_exists('add_comment_meta') )
            return $a;

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

function is_object_in_term( $object_id, $taxonomy, $terms = null ) {
    if ( !$object_id = (int) $object_id )
        return new WP_Error( 'invalid_object', __( 'Invalid object ID' ) );

    $object_terms = get_object_term_cache( $object_id, $taxonomy );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 3 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 uncompress has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public static function uncompress($ip)
    {
        $c1 = -1;
        $c2 = -1;
        if (substr_count($ip, '::') === 1)
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Net/IPv6.php - About 3 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 dynamic_sidebar has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function dynamic_sidebar($index = 1) {
    global $wp_registered_sidebars, $wp_registered_widgets;

    if ( is_int($index) ) {
        $index = "sidebar-$index";
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/widgets.php - About 3 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 feed_start_element has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function feed_start_element($p, $element, &$attrs) {
        $el = $element = strtolower($element);
        $attrs = array_change_key_case($attrs, CASE_LOWER);

        // check for a namespace, and split if found
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/rss.php - About 3 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 replace_invalid_with_pct_encoding has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function replace_invalid_with_pct_encoding($string, $valid_chars, $case = SIMPLEPIE_SAME_CASE)
    {
        // Normalise case
        if ($case & SIMPLEPIE_LOWERCASE)
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 3 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 checkIPv6 has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function checkIPv6($ip)
    {
        $ipPart = SimplePie_Net_IPv6::SplitV64($ip);
        $count = 0;
        if (!empty($ipPart[0]))
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 3 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_filter_build_unique_id has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function _wp_filter_build_unique_id($tag, $function, $priority) {
    global $wp_filter;
    static $filter_id_count = 0;

    if ( is_string($function) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/plugin.php - About 3 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_initial_constants has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function wp_initial_constants() {
    global $blog_id;

    // set memory limits
    if ( !defined('WP_MEMORY_LIMIT') ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/default-constants.php - About 3 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 _render_item has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    final protected function _render_item( $node ) {
        if ( $node->type != 'item' )
            return;

        $is_parent = ! empty( $node->children );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-admin-bar.php - About 3 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_timezone_choice_usort_callback has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function _wp_timezone_choice_usort_callback( $a, $b ) {
    // Don't use translated versions of Etc
    if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) {
        // Make the order of these more like the old dropdown
        if ( 'GMT+' === substr( $a['city'], 0, 4 ) && 'GMT+' === substr( $b['city'], 0, 4 ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 3 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 editor_js has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public static function editor_js() {
        global $tinymce_version, $concatenate_scripts, $compress_scripts;

        /**
         * Filter "tiny_mce_version" is deprecated
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 3 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 update_blog_details has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function update_blog_details( $blog_id, $details = array() ) {
    global $wpdb;

    if ( empty($details) )
        return false;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ms-blogs.php - About 3 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 ns_to_prefix has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function ns_to_prefix($qname, $attr=false) {
        # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div')
        $components = split(":", $qname);

        # grab the last one (e.g 'div')
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 3 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 renderImageToCanvas has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    loadImage.renderImageToCanvas = function (
        canvas,
        img,
        sourceX,
        sourceY,
Severity: Major
Found in Web.Admin/z-scripts/FileAPI.js - About 3 hrs to fix
    Severity
    Category
    Status
    Source
    Language