Showing 17 of 17 total issues
Function loadFile
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function loadFile($path, $env, $file)
{
$retval = [];
foreach (self::$loaders as $fileType => $loader) {
$file = "{$file}.{$fileType}";
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($config)
{
$this->paths = new PathCollection();
if (is_array($config)) {
if (isset($config['path'])) {
- 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 getValue
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getValue(array $haystack = null, $key = null, $sub = null, $default = null)
{
if (empty($key) && !isset($haystack)) {
return $default;
} elseif (empty($key)) {
- 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 __invoke
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke(ContainerInterface $container)
{
$options = $this->options($container->get('config'));
$driverClass = $options['driverClass'];
$metadataDriverClass = $options['metadataDriverClass'];
Method getValue
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getValue(array $haystack = null, $key = null, $sub = null, $default = null)
{
if (empty($key) && !isset($haystack)) {
return $default;
} elseif (empty($key)) {
Function __invoke
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke(ContainerInterface $container)
{
$options = $this->options($container->get('config'));
$driverClass = $options['driverClass'];
$metadataDriverClass = $options['metadataDriverClass'];
- 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 getContainerValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getContainerValue($id)
{
if (isset($this->container[$id])) {
return $this->container[$id];
}
- 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 $haystack[$key];
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $default;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $value;
Avoid too many return
statements within this method. Open
return $default;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Function mergeArrays
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function mergeArrays(array $array1, array $array2, array $array3 = null)
{
$retval = $array1;
foreach ($array2 as $key => $value) {
if (is_array($value) && isset($retval[$key])) {
- 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"