Method get_item_schema_base
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_item_schema_base() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => $this->resource_name,
File class-llms-rest-users-controller.php
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Base users controller class
*
* @package LifterLMS_REST/Abstracts
Function check_roles_permissions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function check_roles_permissions( $request ) {
global $wp_roles;
$schema = $this->get_item_schema();
- 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 get_objects_query
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_objects_query( $prepared, $request ) {
if ( 'id' === $prepared['orderby'] ) {
$prepared['orderby'] = 'ID';
} elseif ( 'registered_date' === $prepared['orderby'] ) {
Method check_roles_permissions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function check_roles_permissions( $request ) {
global $wp_roles;
$schema = $this->get_item_schema();
Method update_additional_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function update_additional_data( $object_id, $prepared, $request ) {
$object = $this->get_object( $object_id );
if ( is_wp_error( $object ) ) {
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_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"