Showing 156 of 191 total issues
Function check_read_permission
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function check_read_permission( $object ) {
if ( is_wp_error( $object ) ) {
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 handle_webhook_upsert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function handle_webhook_upsert() {
$data = array(
'name' => llms_filter_input_sanitize_string( INPUT_POST, 'llms_rest_webhook_name' ),
'status' => llms_filter_input_sanitize_string( INPUT_POST, 'llms_rest_webhook_status' ),
- 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_collection_query_args
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function prepare_collection_query_args( $request ) {
$args = array();
$params = $this->get_collection_params();
- 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_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function get_data( $key, $api_key ) {
switch ( $key ) {
case 'description':
- 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 update_additional_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function update_additional_data( $object_id, $prepared, $request ) {
$object = $this->get_object( $object_id );
if ( is_wp_error( $object ) ) {
- 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_item_permissions_check
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function get_item_permissions_check( $request ) {
$object = $this->get_object( (int) $request['id'] );
if ( is_wp_error( $object ) ) {
return $object;
- 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_events
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle_events() {
if ( llms_verify_nonce( 'key-revoke-nonce', 'revoke', 'GET' ) ) {
$delete = LLMS_REST_API()->keys()->delete( llms_filter_input( INPUT_GET, 'revoke-key', FILTER_VALIDATE_INT ) );
if ( $delete ) {
- 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_status_param
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function handle_status_param( $status ) {
$post_type_object = get_post_type_object( $this->post_type );
$post_type_name = $post_type_object->labels->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 sql_where
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function sql_where() {
global $wpdb;
$sql = 'WHERE 1';
- 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 sql_where
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function sql_where() {
global $wpdb;
$sql = 'WHERE 1';
- 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 update_additional_object_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function update_additional_object_fields( $access_plan, $request, $schema, $prepared_item, $creating = true ) {
Method update_additional_object_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function update_additional_object_fields( $course, $request, $schema, $prepared_item, $creating = true ) {
Method update_additional_object_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function update_additional_object_fields( $lesson, $request, $schema, $prepared_item, $creating = true ) {
Method update_additional_object_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function update_additional_object_fields( $membership, $request, $schema, $prepared_item, $creating = true ) {
Function prepare_item_for_database
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function prepare_item_for_database( $request ) {
$prepared = array();
if ( isset( $request['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 get_objects_query
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function get_objects_query( $prepared, $request ) {
if ( 'id' === $prepared['orderby'] ) {
$prepared['orderby'] = 'ID';
} elseif ( 'registered_date' === $prepared['orderby'] ) {
- 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_header_pagination
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function add_header_pagination( $response, $pagination, $request ) {
$response->header( 'X-WP-Total', $pagination['total_results'] );
$response->header( 'X-WP-TotalPages', $pagination['total_pages'] );
- 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 method. Open
return $terms_update;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return llms_rest_server_error( __( 'The enrollment status could not be updated', 'lifterlms' ) );