Showing 7,504 of 7,504 total issues
Function wp_check_invalid_utf8
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function wp_check_invalid_utf8( $string, $strip = false ) {
$string = (string) $string;
if ( 0 === strlen( $string ) ) {
return '';
- Read upRead up
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 add_option
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) {
global $wpdb;
wp_protect_special_option( $name );
$safe_name = esc_sql( $name );
- Read upRead up
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_file_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function get_file_data( $file, $default_headers, $context = '' ) {
// We don't need to write to the file, so just open for reading.
$fp = fopen( $file, 'r' );
// Pull only the first 8kiB of the file in.
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if ( 'en' != $mce_locale && empty( $strings ) ) {
if ( @is_file( $path . 'en.js' ) ) {
$str1 = @file_get_contents( $path . 'en.js' );
$strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n";
}
Method previous_post
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
Function convert_smilies
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function convert_smilies($text) {
global $wp_smiliessearch;
$output = '';
if ( get_option('use_smilies') && !empty($wp_smiliessearch) ) {
// HTML loop taken from texturize function, could possible be consolidated
- Read upRead up
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 wpmu_signup_blog
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) {
Avoid deeply nested control flow statements. Open
if ( @is_file( $path ) && @is_readable( $path ) ) {
include_once( $path );
$ext_plugins .= $strings . "\n";
$loaded_langs[] = $name;
}
Method display_element
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
Avoid deeply nested control flow statements. Open
if ($handlesize > 0)
$size += $handlesize;
Function _render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
final protected function _render( $root ) {
global $is_IE;
// Add browser classes.
// We have to do this here since admin bar shows on the front end.
- Read upRead up
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_debug_mode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function wp_debug_mode() {
if ( WP_DEBUG ) {
error_reporting( E_ALL );
if ( WP_DEBUG_DISPLAY )
- Read upRead up
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 do_action_ref_array
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function do_action_ref_array($tag, $args) {
global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
if ( !is_array($wp_actions) )
$wp_actions = array($tag);
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if ( @is_file( $path . $mce_locale . '.js' ) )
$strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
Avoid deeply nested control flow statements. Open
if ( $file && file_exists( "$template_dir/$file" ) )
$mce_css[] = "$template_uri/$file";
Method get_archives
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {
Function get_blogaddress_by_domain
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function get_blogaddress_by_domain( $domain, $path ) {
_deprecated_function( __FUNCTION__, '3.7' );
if ( is_subdomain_install() ) {
$url = "http://" . $domain.$path;
- Read upRead up
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_tag_feed_link
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function get_tag_feed_link($tag_id, $feed = '') {
$tag_id = (int) $tag_id;
$tag = get_tag($tag_id);
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if (reset($stk) == SERVICES_JSON_IN_ARR) {
// we are in an array, so just push an element onto the stack
array_push($arr, $this->decode($slice));
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
Function buildCookieHeader
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function buildCookieHeader( &$r ) {
if ( ! empty($r['cookies']) ) {
// Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances
foreach ( $r['cookies'] as $name => $value ) {
if ( ! is_object( $value ) )
- Read upRead up
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"