includes/server/class-llms-rest-api-keys-controller.php
LLMS_REST_API_Keys_Controller
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class LLMS_REST_API_Keys_Controller extends LLMS_REST_Controller {
/**
* Route base.
*
Method get_item_schema_base
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function get_item_schema_base() {
return array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'api_key',
Function prepare_collection_query_args
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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 prepare_item_for_database
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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"