Function loadDataModels
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function loadDataModels(): void
{
$schemas = [];
$totalNbTables = 0;
$dataModelFiles = $this->getSchemas();
- 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 getDatabases
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getDatabases(): array
{
if ($this->databases === null) {
$databases = [];
foreach ($this->getDataModels() as $dataModel) {
- 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 loadDataModels
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadDataModels(): void
{
$schemas = [];
$totalNbTables = 0;
$dataModelFiles = $this->getSchemas();
AbstractManager
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractManager
{
/**
* Data models that we collect. One from each XML schema file.
*
Function includeExternalSchemas
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function includeExternalSchemas(DOMDocument $dom, string $srcDir): int
{
$databaseNode = $dom->getElementsByTagName('database')->item(0);
$externalSchemaNodes = $dom->getElementsByTagName('external-schema');
- 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 includeExternalSchemas
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function includeExternalSchemas(DOMDocument $dom, string $srcDir): int
{
$databaseNode = $dom->getElementsByTagName('database')->item(0);
$externalSchemaNodes = $dom->getElementsByTagName('external-schema');
Function getProperties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getProperties(string $file): array
{
$properties = [];
$lines = @file($file);
- 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"