CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

function get_post_status($ID = '') {
    $post = get_post($ID);

    if ( is_object($post) ) {
        if ( ('attachment' == $post->post_type) && $post->post_parent && ($post->ID != $post->post_parent) )
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 is_feed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function is_feed($file)
    {
        if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
        {
            $sniffer = $this->registry->create('Content_Type_Sniffer', array($file));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Locator.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_untrash_post_comments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function wp_untrash_post_comments($post = null) {
    global $wpdb;

    $post = get_post($post);
    if ( empty($post) )
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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function &create($type, $parameters = array())
    {
        $class = $this->get_class($type);

        if (in_array($class, $this->legacy))
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Registry.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_check_for_changed_slugs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function wp_check_for_changed_slugs($post_id) {
    if ( !isset($_POST['wp-old-slug']) || !strlen($_POST['wp-old-slug']) )
        return $post_id;

    $post = &get_post($post_id);
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 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

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

function wp_count_posts( $type = 'post', $perm = '' ) {
    global $wpdb;

    $user = wp_get_current_user();

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

    protected function update_size( $width = null, $height = null ) {
        $size = null;
        if ( !$width || !$height ) {
            try {
                $size = $this->image->getImageGeometry();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor-imagick.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 encode64 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function encode64($input, $count)
    {
        $output = '';
        $i = 0;
        do {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpass.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 export_to_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function export_to_file($filename) {
        $fh = fopen($filename, 'wb');
        if ( !$fh ) return false;
        $entries = array_filter($this->entries, create_function('$e', 'return !empty($e->translations);'));
        ksort($entries);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/pomo/mo.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 parenthesize_plural_exression has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function parenthesize_plural_exression($expression) {
        $expression .= ';';
        $res = '';
        $depth = 0;
        for ($i = 0; $i < strlen($expression); ++$i) {
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

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

    public function get_copyright()
    {
        if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
        {
            return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Source.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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function save($data)
    {
        if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location))
        {
            if ($data instanceof SimplePie)
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Cache/File.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 atom_03_construct_type has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function atom_03_construct_type($attribs)
    {
        if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
        {
            $mode = SIMPLEPIE_CONSTRUCT_BASE64;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse($date)
    {
        foreach ($this->user as $method)
        {
            if (($returned = call_user_func($method, $date)) !== false)
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parse/Date.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_post_revision_title has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function wp_post_revision_title( $revision, $link = true ) {
    if ( !$revision = get_post( $revision ) )
        return $revision;

    if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post-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 set_post_format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function set_post_format( $post, $format ) {
    $post = get_post( $post );

    if ( empty( $post ) )
        return new WP_Error( 'invalid_post', __( 'Invalid post' ) );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post-formats.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