Showing 458 of 821 total issues
File fields.js
has 1303 lines of code (exceeds 250 allowed). Consider refactoring. Open
( function( exports, $, _, Backbone, wp, fieldsAPIData ) {
'use strict';
_.mixin({
alias: function( alias, func ) {
File fields.js
has 1303 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* plugin-lib (https://github.com/felixarntz/plugin-lib)
* By Felix Arntz (https://leaves-and-love.net)
* Licensed under GPL-2.0-or-later
*/
Function maybe_route_request
has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring. Open
protected function maybe_route_request( $parse_request, $wp, $extra_query_vars ) {
if ( is_admin() || ! $parse_request ) {
return $parse_request;
}
- 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
File rest-models-controller.php
has 760 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* REST models controller class
*
* @package Leaves_And_Love\Plugin_Lib
File model-edit-page.php
has 667 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Edit page class
*
* @package Leaves_And_Love\Plugin_Lib
File field.php
has 613 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Field base class
*
* @package Leaves_And_Love\Plugin_Lib
File field-manager.php
has 533 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Field_Manager class
*
* @package Leaves_And_Love\Plugin_Lib
Function validate
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
public function validate( $value = null ) {
$this->maybe_resolve_dependencies();
if ( false === $this->display ) {
return $value;
- 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_items
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function get_items( $request ) {
$registered_args = $this->get_collection_params();
$args = array();
- 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
File models-list-table.php
has 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* List table class
*
* @package Leaves_And_Love\Plugin_Lib
File query.php
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Query class
*
* @package Leaves_And_Love\Plugin_Lib
Function prepare_item_for_database
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
protected function prepare_item_for_database( $request ) {
$primary_property = $this->manager->get_primary_property();
if ( isset( $request[ $primary_property ] ) ) {
$model = $this->manager->get( $request[ $primary_property ] );
- 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 build_views
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
protected function build_views( &$current, $list_url = '' ) {
$capabilities = $this->manager->capabilities();
$current = 'all';
$total = 0;
- 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 map_capabilities
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function map_capabilities( $mode ) {
$this->capability_mappings = array();
if ( $mode ) {
$this->capability_mappings[ $this->meta_capabilities['read_item'] ] = array( $this, 'map_read_item' );
- 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 build_query_params
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
protected function build_query_params( $number, $offset ) {
$query_params = array(
'number' => $number,
'offset' => $offset,
);
- 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_model_permalink
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function get_model_permalink( $model ) {
if ( method_exists( $this->manager, 'get_status_property' ) ) {
$status_property = $this->manager->get_status_property();
if ( ! in_array( $model->$status_property, $this->manager->statuses()->get_public(), true ) ) {
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
File view-routing.php
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* View_Routing manager class
*
* @package Leaves_And_Love\Plugin_Lib
Field
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Field {
/**
* Field manager instance.
*
* @since 1.0.0
Function action_edit
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
protected function action_edit( $id ) {
if ( ! $id ) {
$id = null;
}
- 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 init
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function init() {
$this->translations = array(
/* --- Model --- */
'db_insert_error' => $this->__translate( 'Could not insert model into the database.', 'textdomain' ),