Showing 10 of 10 total issues
Function key_to_hash
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
private function key_to_hash($key)
{
if (null === $key) {
$hash = '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
Map
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class Map implements \Countable, Arrayable, Jsonable, \ArrayAccess, \IteratorAggregate
{
/**
* Should the comparison be made loosely?
* @see Map::diff
File Map.php
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Haldayne\Boost;
use Haldayne\Boost\Contract\Arrayable;
use Haldayne\Boost\Contract\Jsonable;
Function is_collection_like
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function is_collection_like($value)
{
if ($value instanceof self) {
return true;
- 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 collection_to_array
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function collection_to_array($collection)
{
if ($collection instanceof self) {
return $collection->toArray();
- 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 ini_size_to_bytes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ini_size_to_bytes($string)
{
// eliminate complexity: go all lower
$string = strtolower($string);
- 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 false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return (array)$collection;
Function grep
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function grep($expression, $limit = null)
{
// initialize our return map and book-keeping values
$map = new static;
$bnd = empty($limit) ? null : abs($limit);
- 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"