Showing 32 of 34 total issues
Function resolve
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function resolve(array $definition, Container $container, array $args = [])
{
$final_args = $definition;
if (!empty($args)) { // add create argument at the end
foreach ($args as $arg) {
- 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 resolve
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function resolve($class, Container $container, array $args = [], $explicit = null)
{
$method = '__construct';
if (is_array($class)) {
- 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 set
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function set(string $path, $value): void
{
if (!empty($path)) {
$at = & $this->items;
$keys = $this->explode($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 inspectRecursive
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function inspectRecursive(array $handlers): array
{
$routes = [];
foreach ($handlers as $handler) {
$subRoutes = [];
- 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 resolve
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function resolve(Container $container, array $args = [], $explicit = null)
{
$definition = $this->definition;
if (null !== $this->storedInstance) {
- 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 resolve
has 39 lines of code (exceeds 30 allowed). Consider refactoring. Open
public function resolve($class, Container $container, array $args = [], $explicit = null)
{
$method = '__construct';
if (is_array($class)) {
Method resolve
has 37 lines of code (exceeds 30 allowed). Consider refactoring. Open
public function resolve(array $definition, Container $container, array $args = [])
{
$final_args = $definition;
if (!empty($args)) { // add create argument at the end
foreach ($args as $arg) {
Function delete
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function delete($id)
{
if ($this->has($id)) {
//remove instance
unset($this->instances[$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
Function skipKey
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function skipKey(string $key): bool
{
if (!empty($this->search)) {
foreach ($this->search as $search) {
if ($this->hasWildCard($search)) {
- 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 interpolate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function interpolate(string $message, array $context = array(), Closure $fn = null): string
{
// build a replacement array with braces around the context keys
$replace = array();
foreach ($context as $key => $val) {
- 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 resolve
has 34 lines of code (exceeds 30 allowed). Consider refactoring. Open
public function resolve(Container $container, array $args = [], $explicit = null)
{
$definition = $this->definition;
if (null !== $this->storedInstance) {
Function inspect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function inspect($class, $method = '__construct')
{
if (is_string($class) && !class_exists($class)) {
throw new ClassNotFoundException($class);
}
- 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 flatCollection
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function flatCollection(array $data, string $prefix = null, array $flat_data = []): array
{
foreach ($data as $key => $val) {
if ($prefix !== null) {
$key = $prefix.$this->separator.$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
Function resolve
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function resolve($resource): Stream
{
// detect best way to load and process configuration content
if (is_array($resource)) {
return new DataStream($resource, new ArrayProcessor());
- 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 arrayMergeRecursiveDistinct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function arrayMergeRecursiveDistinct(array $a, array $b, bool $mergeNumericKeys = false): array
{
$merged = $a;
foreach($b 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 process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->nextHandler = (isset($this->nextHandler)) ? next($this->handlers) : current($this->handlers);
// nextHandler is a stack
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $definitions, bool $strict = false)
{
if (empty($definitions)) {
return;
}
- 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 resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function resolve(string $interface, Container $container, $explicit = [])
{
// try to find a match in the container for a class or an interface
if ($container->hasInterface($interface)) {
$instance = $container->getInterface($interface);
- 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 resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function resolve($item): Bootable
{
if(is_string($item) && class_exists($item)) {
if (null !== $this->container) {
$item = $this->container->get($item);
- 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 boot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function boot()
{
if ((php_sapi_name() === 'cli' || defined('STDIN'))) {
return;
}
- 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"