Showing 5,566 of 7,504 total issues
Function maybe_add_column
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb, $debug;
foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {
if ($debug) echo("checking $column == $column_name<br />");
if ($column == $column_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_views
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function get_views() {
global $wp_roles, $role;
if ( $this->is_site_users ) {
$url = 'site-users.php?id=' . $this->site_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
Method _page_rows
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
Method _wp_get_comment_list
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
Function wp_create_categories
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function wp_create_categories($categories, $post_id = '') {
$cat_ids = array ();
foreach ($categories as $category) {
if ($id = category_exists($category))
$cat_ids[] = $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
Function pagination
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function pagination( $which ) {
if ( empty( $this->_pagination_args ) )
return;
extract( $this->_pagination_args, EXTR_SKIP );
- 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 prepare_query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function prepare_query() {
global $wpdb;
$this->first_user = ($this->page - 1) * $this->users_per_page;
$this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
$this->query_sort = ' ORDER BY user_login';
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function run($options) {
$defaults = array( 'package' => '', //Please always pass this.
'destination' => '', //And this
'clear_destination' => false,
- 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_bulk_actions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function get_bulk_actions() {
global $comment_status;
$actions = array();
if ( in_array( $comment_status, array( 'all', 'approved' ) ) )
- 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 column_author
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function column_author( $comment ) {
global $comment_status;
$author_url = get_comment_author_url();
if ( 'http://' == $author_url )
- 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 ( isset( $ordered_menu_item_object->menu_order ) ) {
$dbids_to_orders[$ordered_menu_item_object->ID] = $ordered_menu_item_object->menu_order;
$orders_to_dbids[$ordered_menu_item_object->menu_order] = $ordered_menu_item_object->ID;
}
Function gethchmod
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function gethchmod($file){
$perms = $this->getchmod($file);
if (($perms & 0xC000) == 0xC000) // Socket
$info = 's';
elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
- 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 win_is_writable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function win_is_writable($path) {
/* will work in despite of Windows ACLs bug
* NOTE: use a trailing slash for folders!!!
* see http://bugs.php.net/bug.php?id=27609
* see http://bugs.php.net/bug.php?id=30931
- 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_views
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function get_views() {
global $post_id, $comment_status, $comment_type;
$status_links = array();
$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
- 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 ( isset( $ordered_menu_item_object->menu_order ) ) {
$dbids_to_orders[$ordered_menu_item_object->ID] = $ordered_menu_item_object->menu_order;
$orders_to_dbids[$ordered_menu_item_object->menu_order] = $ordered_menu_item_object->ID;
}
Avoid deeply nested control flow statements. Open
if (
! empty( $menu_item_data['menu_item_parent'] ) &&
in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) &&
isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) &&
( $menu_item_data['menu_item_parent'] == $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] )
Avoid deeply nested control flow statements. Open
if ( substr($subfile, 0, 1) == '.' )
continue;
Avoid deeply nested control flow statements. Open
if ( is_null( $parent ) )
break;
Avoid deeply nested control flow statements. Open
while (($subfile = readdir( $plugins_subdir ) ) !== false ) {
if ( substr($subfile, 0, 1) == '.' )
continue;
$plugin_files[] = plugin_basename("$dir/$file/$subfile");
}
Avoid deeply nested control flow statements. Open
if ( !isset( $parent_name ) ) {
/** This filter is documented in wp-includes/post-template.php */
$parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
}