Showing 24 of 26 total issues
Function processRequest
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
private function processRequest($request)
{
$this->request = self::parseRequest($request);
if (empty($this->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
Method filterByString
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filterByString($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
Method filterByNumber
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filterByNumber($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
Method processRequest
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processRequest($request)
{
$this->request = self::parseRequest($request);
if (empty($this->request)) {
Method modelJoin
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function modelJoin($relationships, $operator = '=', $type = 'left', $where = false)
{
$relationships = Arr::wrap($relationships);
// Check relationships array and remove any that we don't have conenction for.
Method filterByListLookup
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filterByListLookup($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$source = Arr::get($filter, 'settings.source');
Method validateFilterItem
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function validateFilterItem($filter, $settings)
{
// Convert string to filter array.
if (! is_array($filter)) {
$filter = ['', $filter];
Method getRelation
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getRelation($relation)
{
$method = basename(str_replace('\\', '/', get_class($relation)));
switch ($method) {
Method buildCastedAttributes
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function buildCastedAttributes($model, &$result, $method = null)
{
$model_name = 'self';
$name_append = '';
Method filterByUuid
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filterByUuid($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
Function filterByString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function filterByString($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
- 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 filterByListLookup
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function filterByListLookup($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$source = Arr::get($filter, 'settings.source');
- 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 filterByScope
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filterByScope($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$source = Arr::get($filter, 'settings.source');
Method buildSearchAttributes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function buildSearchAttributes($model, &$result, $method = null)
{
$model_name = 'self';
$name_append = '';
Method applySearchFilter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function applySearchFilter(&$query, $filter)
{
$filter_type = Arr::get($filter, 'settings.filter');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
Method filterByBoolean
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filterByBoolean($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
Method filterByList
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filterByList($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
Function filterByNumber
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function filterByNumber($filter)
{
$operator = Arr::get($filter, 'operator');
$method = Arr::get($filter, 'method');
$arguments = Arr::get($filter, 'arguments');
- 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 modelJoin
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function modelJoin($relationships, $operator = '=', $type = 'left', $where = false)
{
$relationships = Arr::wrap($relationships);
// Check relationships array and remove any that we don't have conenction for.
- 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 validateFilterItem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function validateFilterItem($filter, $settings)
{
// Convert string to filter array.
if (! is_array($filter)) {
$filter = ['', $filter];
- 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"