CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function get_images_from_uri has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        function get_images_from_uri($uri) {
            $uri = preg_replace('/\/#.+?$/','', $uri);
            if( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
                return "'" . esc_attr( html_entity_decode($uri) ) . "'";
            $content = wp_remote_fopen($uri);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/press-this.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_comment has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function &get_comment(&$comment, $output = OBJECT) {
    global $wpdb;
    $null = null;

    if ( empty($comment) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.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 display_configuration_page has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function display_configuration_page() {
        $api_key      = Akismet::get_api_key();
        $akismet_user = self::get_akismet_user( $api_key );
        $stat_totals  = self::get_stats( $api_key );
        

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

    function set_custom_fields($post_id, $fields) {
        $post_id = (int) $post_id;

        foreach ( (array) $fields as $meta ) {
            if ( isset($meta['id']) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 MPEGaudioHeaderValid has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) {
        if (($rawarray['synch'] & 0x0FFE) != 0x0FFE) {
            return false;
        }

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.mp3.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 _pad_term_counts has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function _pad_term_counts(&$terms, $taxonomy) {
    global $wpdb;

    // This function only works for hierarchical taxonomies like post categories.
    if ( !is_taxonomy_hierarchical( $taxonomy ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.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_delete_term has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function wp_delete_term( $term, $taxonomy, $args = array() ) {
    global $wpdb;

    $term = (int) $term;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.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 openfile has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function openfile($filename) {
        try {
            if (!empty($this->startup_error)) {
                throw new getid3_exception($this->startup_error);
            }
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.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 CopyToAppropriateCommentsSection has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {
        static $handyatomtranslatorarray = array();
        if (empty($handyatomtranslatorarray)) {
            $handyatomtranslatorarray['©cpy'] = 'copyright';
            $handyatomtranslatorarray['©day'] = 'creation_date';    // iTunes 4.0

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

function wp_match_mime_types($wildcard_mime_types, $real_mime_types) {
    $matches = array();
    if ( is_string($wildcard_mime_types) )
        $wildcard_mime_types = array_map('trim', explode(',', $wildcard_mime_types));
    if ( is_string($real_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 replace_urls has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function replace_urls($document, $tag, $attributes)
    {
        if (!is_array($attributes))
        {
            $attributes = array($attributes);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Sanitize.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 safecss_filter_attr has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function safecss_filter_attr( $css, $deprecated = '' ) {
    $css = wp_kses_no_null($css);
    $css = str_replace(array("\n","\r","\t"), '', $css);

    if ( preg_match( '%[\\(&]|/\*%', $css ) ) // remove any inline css containing \ ( & or comments
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/kses.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 find has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working)
    {
        if ($this->is_feed($this->file))
        {
            return $this->file;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Locator.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 processHeaders has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    function processHeaders($headers) {
        // split headers, one per array element
        if ( is_string($headers) ) {
            // tolerate line terminator: CRLF = LF (RFC 2616 19.3)
            $headers = str_replace("\r\n", "\n", $headers);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/http.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 replace_urls has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    function replace_urls($data, $tag, $attributes)
    {
        if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags))
        {
            $elements = SimplePie_Misc::get_element($tag, $data);
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 sanitize_option has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function sanitize_option($option, $value) {

    switch ($option) {
        case 'admin_email':
            $value = sanitize_email($value);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 is_email_address_unsafe has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function is_email_address_unsafe( $user_email ) {
    $banned_names = get_site_option( 'banned_email_domains' );
    if ( $banned_names && ! is_array( $banned_names ) )
        $banned_names = explode( "\n", $banned_names );

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

Method list_cats has 18 arguments (exceeds 4 allowed). Consider refactoring.
Open

function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
                   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
                   $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 2 hrs to fix

    Function sanitize_user_object has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    function sanitize_user_object($user, $context = 'display') {
        if ( is_object($user) ) {
            if ( !isset($user->ID) )
                $user->ID = 0;
            if ( isset($user->data) )
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/user.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 upload has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.upload = function (config) {
            config.headers = config.headers || {};
            config.headers['Content-Type'] = undefined;
            config.transformRequest = config.transformRequest ?
                (angular.isArray(config.transformRequest) ?
    Severity: Major
    Found in Web.Admin/z-scripts/ng-file-upload-all.js - About 2 hrs to fix
      Severity
      Category
      Status
      Source
      Language