CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

    public static function ParseDIVXTAG($DIVXTAG, $raw=false) {
        // structure from "IDivX" source, Form1.frm, by "Greg Frazier of Daemonic Software Group", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/
        // source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip
        // 'Byte Layout:                   '1111111111111111
        // '32 for Movie - 1               '1111111111111111
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.riff.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 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

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

    private static function getDefaultStreamInfo($streams)
    {
        foreach (array_reverse($streams) as $stream) {
            if ($stream['default']) {
                break;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.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 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 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 get_page_children has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function &get_page_children($page_id, $pages) {
    $page_list = array();
    foreach ( (array) $pages as $page ) {
        if ( $page->post_parent == $page_id ) {
            $page_list[] = $page;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.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_bar_appearance_menu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
    $wp_admin_bar->add_group( array( 'parent' => 'site-name', 'id' => 'appearance' ) );

    if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) )
        $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/admin-bar.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 register_widget_control has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function register_widget_control($name, $control_callback, $width = '', $height = '') {
    // Compat
    if ( is_array($name) ) {
        if ( count($name) == 3 )
            $name = sprintf($name[0], $name[2]);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/widgets.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 get_page_by_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function get_page_by_path($page_path, $output = OBJECT) {
    global $wpdb;
    $page_path = rawurlencode(urldecode($page_path));
    $page_path = str_replace('%2F', '/', $page_path);
    $page_path = str_replace('%20', ' ', $page_path);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.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 register_sidebar_widget has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function register_sidebar_widget($name, $output_callback, $classname = '') {
    // Compat
    if ( is_array($name) ) {
        if ( count($name) == 3 )
            $name = sprintf($name[0], $name[2]);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/widgets.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 get_private_posts_cap_sql has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function get_private_posts_cap_sql($post_type) {
    global $user_ID;
    $cap = '';

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

    function str_split($string, $chunk_size) {
        if (!function_exists('str_split')) {
            $length = $this->strlen($string);
            $out = array();
            for ($i = 0; $i < $length; $i += $chunk_size)
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/pomo/streams.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 _get_post_ancestors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _get_post_ancestors(&$_post) {
    global $wpdb;

    if ( isset($_post->ancestors) )
        return;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.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 set_iri has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function set_iri($iri)
    {
        static $cache;
        if (!$cache)
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/IRI.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