CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function wp_update_nav_menu_object has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {
    $menu_id = (int) $menu_id;

    $_menu = wp_get_nav_menu_object( $menu_id );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/nav-menu.php - About 1 hr 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_style_loader_src has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function wp_style_loader_src( $src, $handle ) {
    if ( defined('WP_INSTALLING') )
        return preg_replace( '#^wp-admin/#', './', $src );

    if ( 'colors' == $handle || 'colors-rtl' == $handle ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/script-loader.php - About 1 hr 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_end_element has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function feed_end_element ($p, $el) {
        $el = strtolower($el);

        if ( $el == 'item' or $el == 'entry' )
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/rss.php - About 1 hr 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_title has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function get_title()
    {
        if (!isset($this->data['title']))
        {
            if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 hr 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_description has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function get_description()
    {
        if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
        {
            return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 hr 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_description has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function get_description($description_only = false)
    {
        if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary'))
        {
            return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 hr 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_description has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function get_description()
    {
        if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
        {
            return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 hr 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 add_node has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function add_node( $args ) {
        // Shim for old method signature: add_node( $parent_id, $menu_obj, $args )
        if ( func_num_args() >= 3 && is_string( func_get_arg(0) ) )
            $args = array_merge( array( 'parent' => func_get_arg(0) ), func_get_arg(2) );

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

function wp_load_alloptions() {
    global $wpdb;

    if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
        $alloptions = wp_cache_get( 'alloptions', 'options' );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/option.php - About 1 hr 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_authenticate_cookie has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function wp_authenticate_cookie($user, $username, $password) {
    if ( is_a($user, 'WP_User') ) { return $user; }

    if ( empty($username) && empty($password) ) {
        $user_id = wp_validate_auth_cookie();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/user.php - About 1 hr 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_user_settings has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function wp_user_settings() {

    if ( ! is_admin() )
        return;

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

function wp_authenticate_username_password($user, $username, $password) {
    if ( is_a($user, 'WP_User') ) { return $user; }

    if ( empty($username) || empty($password) ) {
        $error = new WP_Error();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/user.php - About 1 hr 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 getXml has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function getXml() {
        /* Return XML for this value */
        switch ($this->type) {
            case 'boolean':
                return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-IXR.php - About 1 hr 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_screenshot has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_screenshot( $uri = 'uri' ) {
        $screenshot = $this->cache_get( 'screenshot' );
        if ( $screenshot ) {
            if ( 'relative' == $uri )
                return $screenshot;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-theme.php - About 1 hr 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 sanitize_email has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function sanitize_email( $email ) {
    // Test for the minimum length the email can be
    if ( strlen( $email ) < 3 ) {
        return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
    }
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/formatting.php - About 1 hr 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 is_blog_installed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function is_blog_installed() {
    global $wpdb;

    // Check cache first. If options table goes away and we have true cached, oh well.
    if ( wp_cache_get( 'is_blog_installed' ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 1 hr 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 smilies_init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function smilies_init() {
    global $wpsmiliestrans, $wp_smiliessearch;

    // don't bother setting up smilies if they are disabled
    if ( !get_option( 'use_smilies' ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 1 hr 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_fullscreen_html has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function wp_fullscreen_html() {
        global $content_width;
        $post = get_post();

        $width = isset( $content_width ) && 800 > $content_width ? $content_width : 800;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 1 hr 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 _parse_init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private static function _parse_init($init) {
        $options = '';

        foreach ( $init as $k => $v ) {
            if ( is_bool($v) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-editor.php - About 1 hr 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 accept_encoding has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function accept_encoding( $url, $args ) {
        $type = array();
        $compression_enabled = WP_Http_Encoding::is_available();

        if ( ! $args['decompress'] ) // decompression specifically disabled
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-http.php - About 1 hr 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

Severity
Category
Status
Source
Language