CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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 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 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 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 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 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 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 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 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_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 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 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

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

function ms_upload_constants() {
    global $wpdb;

    // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.
    add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ms-default-constants.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 user has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function user ($user = "") {
        // Sends the USER command, returns true or false

        if( empty($user) ) {
            $this->ERROR = "POP3 user: " . _("no login ID submitted");
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 decompress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function decompress( $compressed, $length = null ) {

        if ( false !== ( $decompressed = @gzinflate( $compressed ) ) )
            return $decompressed;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/http.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