CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function end_element has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function end_element($parser, $name) {

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

        if(!empty($this->in_content)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.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 download_post_bodies has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function download_post_bodies() {
        $imported_count  = (int) get_option( 'ljapi_imported_count' );
        $sync_item_times = get_option( 'ljapi_sync_item_times' );
        $lastsync        = get_option( 'ljapi_lastsync_posts' );
        if ( !$lastsync )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/livejournal.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_getComment has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function wp_getComment($args) {
        $this->escape($args);

        $blog_id    = (int) $args[0];
        $username    = $args[1];
Severity: Minor
Found in Web.Admin/2014/wordpress/xmlrpc.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 save_key has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function save_key( $api_key ) {
        $key_status = Akismet::verify_key( $api_key );

        if ( $key_status == 'valid' ) {
            $akismet_user = self::get_akismet_user( $api_key );

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

function wp_count_comments( $post_id = 0 ) {
    global $wpdb;

    $post_id = (int) $post_id;

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

function get_page_of_comment( $comment_ID, $args = array() ) {
    global $wpdb;

    if ( !$comment = get_comment( $comment_ID ) )
        return;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.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_editProfile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function wp_editProfile( $args ) {
        if ( ! $this->minimum_args( $args, 4 ) )
            return $this->error;

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

function locate_template($template_names, $load = false) {
    if (!is_array($template_names))
        return '';

    $located = '';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/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 the_editor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) {
    $rows = get_option('default_post_edit_rows');
    if (($rows < 3) || ($rows > 100))
        $rows = 12;

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

    protected function fseek($bytes, $whence=SEEK_SET) {
        if ($this->data_string_flag) {
            switch ($whence) {
                case SEEK_SET:
                    $this->data_string_position = $bytes;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.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 setup_theme has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function setup_theme() {
        send_origin_headers();

        if ( is_admin() && ! $this->doing_ajax() )
            auth_redirect();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-manager.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_term_link has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function get_term_link( $term, $taxonomy ) {
    global $wp_rewrite;

    if ( !is_object($term) ) {
        if ( is_int($term) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.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 ClosestStandardMP3Bitrate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function ClosestStandardMP3Bitrate($bit_rate) {
        static $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000);
        static $bit_rate_table = array (0=>'-');
        $round_bit_rate = intval(round($bit_rate, -3));
        if (!isset($bit_rate_table[$round_bit_rate])) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.mp3.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_unique_post_slug has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function wp_unique_post_slug($slug, $post_ID, $post_status, $post_type, $post_parent) {
    if ( in_array( $post_status, array( 'draft', 'pending' ) ) )
        return $slug;

    global $wpdb, $wp_rewrite;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.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_save_post_revision has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function wp_save_post_revision( $post_id ) {
    // We do autosaves manually with wp_create_post_autosave()
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
        return;

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

    function Translation_Entry($args=array()) {
        // if no singular -- empty object
        if (!isset($args['singular'])) {
            return;
        }
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/pomo/entry.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 remove_dot_segments has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function remove_dot_segments($input)
    {
        $output = '';
        while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/IRI.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 import_from_file has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function import_from_file($filename) {
        $f = fopen($filename, 'r');
        if (!$f) return false;
        $lineno = 0;
        while (true) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/pomo/po.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 debug has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function debug(&$sp)
    {
        $info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n";
        $info .= 'PHP ' . PHP_VERSION . "\n";
        if ($sp->error() !== null)
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.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 __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function __construct( $date_query, $default_column = 'post_date' ) {
        if ( empty( $date_query ) || ! is_array( $date_query ) )
            return;

        if ( isset( $date_query['relation'] ) && strtoupper( $date_query['relation'] ) == 'OR' )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/date.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