Showing 4 of 4 total issues
Function drupal_phpunit_get_extension_namespaces
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function drupal_phpunit_get_extension_namespaces(array $dirs)
{
$suiteNames = ['Unit', 'Kernel', 'Functional', 'FunctionalJavascript'];
$namespaces = [];
foreach ($dirs as $extension => $dir) {
- 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 mergeTaskConfig
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function mergeTaskConfig(
TaskInterface $task,
bool $isExtension
): void {
$taskInfo = $this->getTaskConfigFileInfo($task);
- 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 rollback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function rollback(): void {
// Remove the created directories.
foreach ($this->createdDirectories as $index => $dir) {
if ($this->filesystem->exists($dir)) {
$this->filesystem->remove($dir);
- 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 addTestsBySuiteNamespace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addTestsBySuiteNamespace($root, $suiteNamespace)
{
$vendor = "$root/vendor";
foreach (drupal_phpunit_find_extension_directories($root) as $extension_name => $dir) {
- 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"