CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function wp_new_comment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function wp_new_comment( $commentdata ) {
    $commentdata = apply_filters('preprocess_comment', $commentdata);

    $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
    if ( isset($commentdata['user_ID']) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.php - About 55 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 validate_settings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function validate_settings( $input ) {
        $output = array();

        if ( empty( $input['tag-name'] ) ) {
            $output['tag-id'] = 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 submit_spam_comment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function submit_spam_comment( $comment_id ) {
        global $wpdb, $current_user, $current_site;

        $comment_id = (int) $comment_id;

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

function wp_insert_comment($commentdata) {
    global $wpdb;
    extract(stripslashes_deep($commentdata), EXTR_SKIP);

    if ( ! isset($comment_author_IP) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.php - About 55 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 _prepare_comment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _prepare_comment( $comment ) {
        // Format page date.
        $comment_date = $this->_convert_date( $comment->comment_date );
        $comment_date_gmt = $this->_convert_date_gmt( $comment->comment_date_gmt, $comment->comment_date );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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_current_theme has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function get_current_theme() {
    if ( $theme = get_option('current_theme') )
        return $theme;

    $themes = get_themes();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 55 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_theme_data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function get_theme_data( $theme_file ) {
    $default_headers = array( 
        'Name' => 'Theme Name', 
        'URI' => 'Theme URI', 
        'Description' => 'Description', 
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 55 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 _multisite_getUsersBlogs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function _multisite_getUsersBlogs($args) {
        $current_blog = get_blog_details();

        $domain = $current_blog->domain;
        $path = $current_blog->path . 'xmlrpc.php';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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_getPostFormats has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

        $blog_id = (int) $args[0];
        $username = $args[1];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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_getPages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

        $blog_id    = (int) $args[0];
        $username    = $args[1];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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_setOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

        $blog_id    = (int) $args[0];
        $username    = $args[1];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 mw_newMediaObject has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function mw_newMediaObject($args) {
        global $wpdb;

        $blog_ID     = (int) $args[0];
        $username  = $this->escape($args[1]);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 mt_getRecentPostTitles has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function mt_getRecentPostTitles($args) {

        $this->escape($args);

        $blog_ID     = (int) $args[0];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 _getOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function _getOptions($options) {
        $data = array();
        $can_manage = current_user_can( 'manage_options' );
        foreach ( $options as $option ) {
            if ( array_key_exists( $option, $this->blog_options ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 55 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 CalculateCompressionRatioAudio has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function CalculateCompressionRatioAudio() {
        if (empty($this->info['audio']['bitrate']) || empty($this->info['audio']['channels']) || empty($this->info['audio']['sample_rate']) || !is_numeric($this->info['audio']['sample_rate'])) {
            return false;
        }
        $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (!empty($this->info['audio']['bits_per_sample']) ? $this->info['audio']['bits_per_sample'] : 16));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.php - About 55 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 prepare_controls has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function prepare_controls() {

        $this->controls = array_reverse( $this->controls );
        $controls = array();

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-manager.php - About 55 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 readEBMLint has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function readEBMLint() {
        $actual_offset = $this->current_offset - $this->EBMLbuffer_offset;

        // get length of integer
        $first_byte_int = ord($this->EBMLbuffer[$actual_offset]);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.php - About 55 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 PrintHexBytes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') {
        $returnstring = '';
        for ($i = 0; $i < strlen($string); $i++) {
            if ($hex) {
                $returnstring .= str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 55 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 numChannelsLookup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function numChannelsLookup($index) {
        switch ($index) {
            case 0:
                return 1;
                break;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.dts.php - About 55 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_kses_split2 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
    $string = wp_kses_stripslashes($string);

    if (substr($string, 0, 1) != '<')
        return '&gt;';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/kses.php - About 55 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