CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function media_upload_image has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function media_upload_image() {
    $errors = array();
    $id = 0;

    if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/media.php - About 2 hrs 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 meta_box_prefs has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function meta_box_prefs($page) {
    global $wp_meta_boxes;

    if ( empty($wp_meta_boxes[$page]) )
        return;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs 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 _cat_row has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function _cat_row( $category, $level, $name_override = false ) {
    static $row_class = '';

    $category = get_category( $category, OBJECT, 'display' );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs 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_ajax_wp_compression_test has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_wp_compression_test() {
    if ( !current_user_can( 'manage_options' ) )
        wp_die( -1 );

    if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php - About 2 hrs 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 search_for_folder has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function search_for_folder($folder, $base = '.', $loop = false ) {
        if ( empty( $base ) || '.' == $base )
            $base = trailingslashit($this->cwd());

        $folder = untrailingslashit($folder);

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

function iis7_add_rewrite_rule($filename, $rewrite_rule) {
    if ( ! class_exists('DOMDocument') )
        return false;

    // If configuration file does not exist then we create one.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/misc.php - About 2 hrs 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_get_revision_ui_diff has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
    if ( ! $post = get_post( $post ) )
        return false;

    if ( $compare_from ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/revision.php - About 2 hrs 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_post has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function save_post(&$post, &$comments, &$pings) {
        // Reset the counter
        set_time_limit(30);
        $post = get_object_vars($post);
        $post = add_magic_quotes($post);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/mt.php - About 2 hrs 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_mime_type_where has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function wp_post_mime_type_where($post_mime_types) {
    $where = '';
    $wildcards = array('', '%', '%/%');
    if ( is_string($post_mime_types) )
        $post_mime_types = array_map('trim', explode(',', $post_mime_types));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 2 hrs 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 multi_resize has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function multi_resize( $sizes ) {
        $metadata = array();
        $orig_size = $this->size;
        $orig_image = $this->image->getImage();

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

    function export_entry(&$entry) {
        if (is_null($entry->singular)) return false;
        $po = array();
        if (!empty($entry->translator_comments)) $po[] = PO::comment_block($entry->translator_comments);
        if (!empty($entry->extracted_comments)) $po[] = PO::comment_block($entry->extracted_comments, '.');
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/pomo/po.php - About 2 hrs 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 sanitize_bookmark_field has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
    $int_fields = array('link_id', 'link_rating');
    if ( in_array($field, $int_fields) )
        $value = (int) $value;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/bookmark.php - About 2 hrs 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 pop_list has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function pop_list ($msgNum = "") {
        //  If called with an argument, returns that msgs' size in octets
        //  No argument returns an associative array of undeleted
        //  msg numbers and their sizes in octets

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 2 hrs 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 _response_to_rss has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function _response_to_rss ($resp) {
    $rss = new MagpieRSS( $resp->results );

    // if RSS parsed successfully
    if ( $rss && (!isset($rss->ERROR) || !$rss->ERROR) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/rss.php - About 2 hrs 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_page_menu has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function wp_page_menu( $args = array() ) {
    $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
    $args = wp_parse_args( $args, $defaults );
    $args = apply_filters( 'wp_page_menu_args', $args );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post-template.php - About 2 hrs 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 prepreview_added_widget_instance has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function prepreview_added_widget_instance( $value = false ) {
        if ( ! preg_match( '/^(?:default_)?option_(widget_(.+))/', current_filter(), $matches ) ) {
            return $value;
        }
        $id_base = $matches[2];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-widgets.php - About 2 hrs 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_build_query has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function _http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=true) {
    $ret = array();

    foreach ( (array) $data as $k => $v ) {
        if ( $urlencode)
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/compat.php - About 2 hrs 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 normalize has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function normalize () {
        // if atom populate rss fields
        if ( $this->is_atom() ) {
            $this->channel['descripton'] = $this->channel['tagline'];
            for ( $i = 0; $i < count($this->items); $i++) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/rss.php - About 2 hrs 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_links has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function get_links()
    {
        $links = SimplePie_Misc::get_element('a', $this->file->body);
        foreach ($links as $link)
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 2 hrs 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_image_tags has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function get_image_tags($namespace, $tag)
    {
        $type = $this->get_type();
        if ($type & SIMPLEPIE_TYPE_RSS_10)
        {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 2 hrs 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