File CheckConfiguration.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
Function getSuitableDirectories
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getSuitableDirectories(Finder $directories, string $publicDirectory): void
{
foreach ($directories as $directory) {
$directoryPath = sprintf('%s/%s', $publicDirectory, $directory->getRelativePathname());
if ($this->isDirectoryMatching($directoryPath)) {
- 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 checkDirectories
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function checkDirectories(): void
{
$lastSecuredDirectory = null;
foreach ($this->directories as $directory) {
- 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 checkFilesAccessibility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function checkFilesAccessibility(string $realDirectoryPath, string $directoryPath): void
{
$fileFinder = (new Finder())->name($this->fileTypePattern)->in($realDirectoryPath)->depth(0);
foreach ($fileFinder->files() as $file) {
$publicUrl = sprintf('%s/%s/%s', $this->domain, $directoryPath, $file->getRelativePathname());
- 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 renderCheckAccess
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function renderCheckAccess(): string
{
if ($this->extensionConfiguration->isSkipCheckConfiguration()) {
return 'Check skipped as the option "backend.skipCheckConfiguration" is active';
}
- 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"