Showing 619 of 619 total issues
Function callback_delete_site_transient_update_themes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function callback_delete_site_transient_update_themes() {
/**
* This is used as a hack to determine a theme was deleted.
*/
$backtrace = debug_backtrace(); // @codingStandardsIgnoreLine
- 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 handle_widget_reordering
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function handle_widget_reordering( $old, $new ) {
$all_sidebar_ids = array_intersect( array_keys( $old ), array_keys( $new ) );
foreach ( $all_sidebar_ids as $sidebar_id ) {
if ( $old[ $sidebar_id ] === $new[ $sidebar_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 log_changes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function log_changes( $location ) {
if ( ! empty( $this->edited_file ) ) {
// TODO: phpcs fix.
if ( md5_file( $this->edited_file['file_path'] ) !== $this->edited_file['file_md5'] ) {
$context = $this->get_context( $location );
- 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 callback_wp_stream_after_connectors_registration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function callback_wp_stream_after_connectors_registration( array $labels, Connectors $connectors ) {
$action = wp_stream_filter_input( INPUT_GET, 'action' );
if ( ! $action ) {
$action = wp_stream_filter_input( INPUT_POST, 'action' );
- 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 load_alerts_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function load_alerts_settings() {
if ( ! current_user_can( self::CAPABILITY ) ) {
wp_send_json_error(
array(
'message' => 'You do not have permission to do this.',
- 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 callback_post_updated
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function callback_post_updated( $post_id, $posts_after, $posts_before ) {
if ( 'acf-field-group' !== $posts_after->post_type ) {
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 field_group_action
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function field_group_action( $group, $action, $meta = array(), $message = null ) {
$replacements = array(
$group->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_comment_author
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_comment_author( $comment, $field = 'id' ) {
$comment = is_object( $comment ) ? $comment : get_comment( absint( $comment ) );
$req_name_email = get_option( 'require_name_email' );
$req_user_login = get_option( 'comment_registration' );
- 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_context_by_key
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_context_by_key( $option_name, $key ) {
$contexts = array(
'theme_mods' => array(
'custom_background' => array(
'background_image',
- 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 field_action
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function field_action( $field, $action, $meta = array(), $message = null ) {
$replacements = array(
$field->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 hasRelativeKeywords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function hasRelativeKeywords($time)
{
// skip common format with a '-' in it
if (preg_match('/[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}/', $time) !== 1) {
foreach (static::$relativeKeywords as $keyword) {
- 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 display_submit_box
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function display_submit_box( $post ) {
if ( empty( $post ) ) {
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 check_records
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function check_records( $record_id, $recordarr ) {
$args = array(
'post_type' => self::POST_TYPE,
'post_status' => 'wp_stream_enabled',
);
- 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_object_title
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_object_title() {
if ( ! isset( $this->object_id ) || empty( $this->object_id ) ) {
return 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 install
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function install( $current_version ) {
global $wpdb;
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
- 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 live_update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function live_update( $response, $data ) {
unset( $response );
if ( ! isset( $data['wp-stream-heartbeat-last-time'] ) ) {
return array();
- 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_column_excluded_setting_key
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_column_excluded_setting_key( $column ) {
switch ( $column ) {
case 'connector':
$output = 'connectors';
break;
- 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 filter_select
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function filter_select( $name, $title, $items, $ajax = false ) {
$options = array( '<option value=""></option>' );
$selected = wp_stream_filter_input( INPUT_GET, $name );
foreach ( $items as $key => $item ) {
- 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_ips
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_ips() {
if ( ! defined( 'DOING_AJAX' ) || ! current_user_can( $this->plugin->admin->settings_cap ) ) {
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"