CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function pingback_extensions_getPingbacks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function pingback_extensions_getPingbacks($args) {

        global $wpdb;

        /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 25 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_ob_filter_callback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function preview_theme_ob_filter_callback( $matches ) {
    if ( strpos($matches[4], 'onclick') !== false )
        $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\)\\1#i', '', $matches[4]); //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if its escaped by \  to prevent breaking mid-attribute.
    if (
        ( false !== strpos($matches[3], '/wp-admin/') )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 25 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 allowed_tags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function allowed_tags() {
    global $allowedtags;
    $allowed = '';
    foreach ( (array) $allowedtags as $tag => $attributes ) {
        $allowed .= '<'.$tag;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 25 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_getTerm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

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

    function wp_getUser( $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 25 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_object_taxonomies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function get_object_taxonomies($object) {
    global $wp_taxonomies;

    if ( is_object($object) ) {
        if ( $object->post_type == 'attachment' )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 25 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_objects_in_term has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function get_objects_in_term( $terms, $taxonomies, $args = array() ) {
    global $wpdb;

    if ( !is_array( $terms) )
        $terms = array($terms);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 25 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 setOption has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setOption($optArray) {
        if (!is_array($optArray) || empty($optArray)) {
            return false;
        }
        foreach ($optArray as $opt => $val) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.php - About 25 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 GetFileFormat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetFileFormat(&$filedata, $filename='') {
        // this function will determine the format of a file based on usually
        // the first 2-4 bytes of the file (8 bytes for PNG, 16 bytes for JPG,
        // and in the case of ISO CD image, 6 bytes offset 32kb from the start
        // of the file).
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.php - About 25 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 BigEndian2String has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function BigEndian2String($number, $minbytes=1, $synchsafe=false, $signed=false) {
        if ($number < 0) {
            throw new Exception('ERROR: self::BigEndian2String() does not support negative numbers');
        }
        $maskbyte = (($synchsafe || $signed) ? 0x7F : 0xFF);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 25 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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function __construct($server, $path = false, $port = false, $timeout = 15) {
        if ( ! $path ) {
            // Assume we have been given a URL instead
            $bits = parse_url($server);
            $this->scheme = $bits['scheme'];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-http-ixr-client.php - About 25 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 EnsureBufferHasEnoughData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function EnsureBufferHasEnoughData($min_data=1024) {
        if (($this->current_offset - $this->EBMLbuffer_offset) >= ($this->EBMLbuffer_length - $min_data)) {
            $read_bytes = max($min_data, $this->getid3->fread_buffer_size());

            try {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.php - About 25 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_max has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function array_max($arraydata, $returnkey=false) {
        $maxvalue = false;
        $maxkey = false;
        foreach ($arraydata as $key => $value) {
            if (!is_array($value)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 25 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 Float2String has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function Float2String($floatvalue, $bits) {
        // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html
        switch ($bits) {
            case 32:
                $exponentbits = 8;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 25 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 fileextension has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fileextension($filename, $numextensions=1) {
        if (strstr($filename, '.')) {
            $reversedfilename = strrev($filename);
            $offset = 0;
            for ($i = 0; $i < $numextensions; $i++) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 25 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_min has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function array_min($arraydata, $returnkey=false) {
        $minvalue = false;
        $minkey = false;
        foreach ($arraydata as $key => $value) {
            if (!is_array($value)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 25 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_set_post_categories has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function wp_set_post_categories($post_ID = 0, $post_categories = array()) {
    $post_ID = (int) $post_ID;
    // If $post_categories isn't already an array, make it one:
    if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories))
        $post_categories = array(get_option('default_category'));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 25 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_lastpostdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function get_lastpostdate($timezone = 'server') {
    global $cache_lastpostdate, $wpdb, $blog_id;
    $add_seconds_server = date('Z');
    if ( !isset($cache_lastpostdate[$blog_id][$timezone]) ) {
        switch(strtolower($timezone)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 25 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 http_version has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function http_version()
    {
        if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/')
        {
            $len = strspn($this->data, '0123456789.', 5);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/HTTP/Parser.php - About 25 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_restore_post_revision has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function wp_restore_post_revision( $revision_id, $fields = null ) {
    if ( !$revision = wp_get_post_revision( $revision_id, ARRAY_A ) )
        return $revision;

    if ( !is_array( $fields ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 25 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