Showing 191 of 191 total issues
Avoid too many return
statements within this method. Open
Open
return $fields_update;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $response;
Avoid too many return
statements within this method. Open
Open
return $meta_update;
Avoid too many return
statements within this method. Open
Open
return $terms_update;
Avoid too many return
statements within this method. Open
Open
return $fields_update;
Avoid too many return
statements within this method. Open
Open
return $fields_update;
Avoid too many return
statements within this method. Open
Open
return $response;
Avoid too many return
statements within this method. Open
Open
return $meta_update;
Avoid too many return
statements within this method. Open
Open
return $this->prepare_item_for_response( $object, $request );
Avoid too many return
statements within this method. Open
Open
return $prepared;
Avoid too many return
statements within this method. Open
Open
return $response;
Avoid too many return
statements within this method. Open
Open
return $response;
Avoid too many return
statements within this method. Open
Open
return $updated_date_created;
Avoid too many return
statements within this method. Open
Open
return llms_rest_server_error( __( 'The enrollment creation date could not be updated', 'lifterlms' ) );
Avoid too many return
statements within this method. Open
Open
return 0;
Avoid too many return
statements within this method. Open
Open
return $user_id;
Avoid too many return
statements within this method. Open
Open
return true;
Function prepare_collection_query_args
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function prepare_collection_query_args( $request ) {
$query_args = parent::prepare_collection_query_args( $request );
if ( is_wp_error( $query_args ) ) {
return $query_args;
- 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_terms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function handle_terms( $object_id, $request ) {
$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_llms_rest' => true ) );
foreach ( $taxonomies as $taxonomy ) {
- 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"