Showing 117 of 254 total issues
Function raw_meta
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function raw_meta( $object_id, $field, $args = [] ) {
if ( empty( $field['id'] ) ) {
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
Consider simplifying this complex logical expression. Open
if ( ! $is_plugin || $network_wide || $is_cli || $is_bulk_activate || $this->is_bundled() || $is_doing_ajax ) {
return;
}
Method clone_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function clone_value( $new, $old, $object_id, $field, $data_source = null ) {
Method start_el
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function start_el( &$output, $object, $depth = 0, $args = [], $current_object_id = 0 ) {
Method start_el
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function start_el( &$output, $object, $depth = 0, $args = [], $current_object_id = 0 ) {
Function modify_field
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function modify_field( $field ) {
global $wpml_post_translations;
if ( empty( $field['id'] ) ) {
return $field;
- 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_by
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function get_by( array $args ) : array {
$meta_boxes = $this->data;
foreach ( $meta_boxes as $index => $meta_box ) {
foreach ( $args as $key => $value ) {
$meta_box_key = 'object_type' === $key ? $meta_box->get_object_type() : $meta_box->$key;
- 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 too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return val;
Avoid too many return
statements within this function. Open
return val.replace( /\r/g, "" );
Avoid too many return
statements within this function. Open
return value.length === 16;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return value.length === 15;
Avoid too many return
statements within this method. Open
return current_user_can( $read_post, $object_id );
Avoid too many return
statements within this function. Open
return value.length === 15;
Avoid too many return
statements within this method. Open
return $value[ $attribute ];
Avoid too many return
statements within this function. Open
return data;
Avoid too many return
statements within this function. Open
return val.substr( idx + 1 );
Avoid too many return
statements within this function. Open
return value.length === 14;