CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

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

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

        $blog_id    = (int) $args[0];
        $page_id    = (int) $args[1];
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_getUsersBlogs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function wp_getUsersBlogs( $args ) {
        // If this isn't on WPMU then just use blogger_getUsersBlogs
        if ( !is_multisite() ) {
            array_unshift( $args, 1 );
            return $this->blogger_getUsersBlogs( $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 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 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 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 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 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 __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 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 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 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 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 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 valid_unicode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function valid_unicode($i) {
    return ( $i == 0x9 || $i == 0xa || $i == 0xd ||
            ($i >= 0x20 && $i <= 0xd7ff) ||
            ($i >= 0xe000 && $i <= 0xfffd) ||
            ($i >= 0x10000 && $i <= 0x10ffff) );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/kses.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 make_headers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function make_headers($translation) {
        $headers = array();
        // sometimes \ns are used instead of real new lines
        $translation = str_replace('\n', "\n", $translation);
        $lines = explode("\n", $translation);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/pomo/translations.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