CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function check_comment_flood_db has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function check_comment_flood_db( $ip, $email, $date ) {
    global $wpdb;
    if ( current_user_can( 'manage_options' ) )
        return; // don't throttle admins
    $hour_ago = gmdate( 'Y-m-d H:i:s', time() - 3600 );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.php - About 35 mins 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 widget_akismet_control has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function widget_akismet_control() {
        $options = $newoptions = get_option('widget_akismet');
        if ( $_POST["akismet-submit"] ) {
            $newoptions['title'] = strip_tags(stripslashes($_POST["akismet-title"]));
            if ( empty($newoptions['title']) ) $newoptions['title'] = 'Spam Blocked';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.php - About 35 mins 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_old_comments_meta has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function delete_old_comments_meta() {
        global $wpdb;

        $interval = apply_filters( 'akismet_delete_commentmeta_interval', 15 );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/class.akismet.php - About 35 mins 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 current_theme_supports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function current_theme_supports( $feature ) {
    global $_wp_theme_features;

    if ( !isset( $_wp_theme_features[$feature] ) )
        return false;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 35 mins 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 user_can_richedit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function user_can_richedit() {
    global $wp_rich_edit, $pagenow;

    if ( !isset( $wp_rich_edit) ) {
        if ( get_user_option( 'rich_editing' ) == 'true' &&
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 35 mins 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_restoreRevision has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

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

function preview_theme() {
    if ( ! (isset($_GET['template']) && isset($_GET['preview'])) )
        return;

    if ( !current_user_can( 'switch_themes' ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 35 mins 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 blogger_editPost has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function blogger_editPost($args) {

        $this->escape($args);

        $post_ID     = (int) $args[1];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 35 mins 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_date has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function the_date($d='', $before='', $after='', $echo = true) {
    global $post, $day, $previousday;
    $the_date = '';
    if ( $day != $previousday ) {
        $the_date .= $before;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 35 mins 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 language_attributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function language_attributes($doctype = 'html') {
    $attributes = array();
    $output = '';

    if ( $dir = get_bloginfo('text_direction') )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 35 mins 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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function WP_User( $id, $name = '' ) {

        if ( empty( $id ) && empty( $name ) )
            return;

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

function single_post_title($prefix = '', $display = true) {
    global $wpdb;
    $p = get_query_var('p');
    $name = get_query_var('name');

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

function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
    global $wp_styles;
    if ( !is_a($wp_styles, 'WP_Styles') )
        $wp_styles = new WP_Styles();

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

    function attach_uploads( $post_ID, $post_content ) {
        global $wpdb;

        // find any unattached files
        $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 35 mins 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 NormalizeBinaryPoint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) {
        // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html
        if (strpos($binarypointnumber, '.') === false) {
            $binarypointnumber = '0.'.$binarypointnumber;
        } elseif ($binarypointnumber{0} == '.') {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 35 mins 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 IncludeDependency has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function IncludeDependency($filename, $sourcefile, $DieOnFailure=false) {
        global $GETID3_ERRORARRAY;

        if (file_exists($filename)) {
            if (include_once($filename)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 35 mins 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 array_merge_noclobber has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function array_merge_noclobber($array1, $array2) {
        if (!is_array($array1) || !is_array($array2)) {
            return false;
        }
        $newarray = $array1;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 35 mins 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 array_merge_clobber has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function array_merge_clobber($array1, $array2) {
        // written by kcØhireability*com
        // taken from http://www.php.net/manual/en/function.array-merge-recursive.php
        if (!is_array($array1) || !is_array($array2)) {
            return false;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 35 mins 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 intValueSupported has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function intValueSupported($num) {
        // check if integers are 64-bit
        static $hasINT64 = null;
        if ($hasINT64 === null) { // 10x faster than is_null()
            $hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 35 mins 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 OggPageSegmentLength has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function OggPageSegmentLength($OggInfoArray, $SegmentNumber=1) {
        for ($i = 0; $i < $SegmentNumber; $i++) {
            $segmentlength = 0;
            foreach ($OggInfoArray['segment_table'] as $key => $value) {
                $segmentlength += $value;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 35 mins 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