Showing 9 of 69 total issues
CachingIterator
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class CachingIterator extends \ArrayIterator
{
const CLONE_KEY = 1;
const CLONE_CURRENT = 2;
Method __construct
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(string $globPattern, int $flags = self::GLOB_NOSORT | \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO)
{
$this->flags = $flags;
list($path, $maxDepth) = self::extractPathAndMaxDepth($globPattern);
$regexPattern = self::globToRegex($globPattern);
Function map
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function map()
{
if ($this->valid()) {
$result = ($this->callback)($this->getInnerIterator());
if (is_array($result)) {
- 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 count
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function count()
{
if (!($this->flags & self::CACHE_COUNT) || !isset($this->count)) {
if ($this->getInnerIterator() instanceof \Countable) {
$this->count = intval($this->getInnerIterator()->count());
- 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 __destruct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __destruct()
{
$this->fflush();
if ($this->persist == self::PERSIST || $this->persist == self::PERSIST_UNCHANGED) {
if ($this->persist == self::PERSIST_UNCHANGED || !$this->doCompare()) {
- 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 accept
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function accept()
{
$found = 0;
foreach ($this->iterators as $iterator) {
foreach ($iterator as $key => $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 accept
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function accept()
{
foreach ($this->iterators as $iterator) {
foreach ($iterator as $key => $value) {
if (($this->callback)($this->getInnerIterator(), $key, $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 compare
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function compare(AtomicTempFileObject $tempFile): bool
{
$filename = $tempFile->getDestinationRealPath();
if (!file_exists($filename)) {
return false;
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(string $globPattern, int $flags = self::GLOB_NOSORT | \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO)
{
$this->flags = $flags;
list($path, $maxDepth) = self::extractPathAndMaxDepth($globPattern);
$regexPattern = self::globToRegex($globPattern);
- 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"