Showing 120 of 487 total issues
File Container.php
has 547 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace Nine\Containers;
/**
* **A Dependency Injection and Service Locator container.**
*
Container
has 62 functions (exceeds 20 allowed). Consider refactoring. Open
class Container implements ArrayAccess, ContainerContract
{
/**
* The contextual binding map.
*
Method register
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $app)
{
$app['profiler.mount_prefix'] = '/_profiler';
$app->extend('dispatcher', function ($dispatcher, $app) {
return new TraceableEventDispatcher($dispatcher, $app['stopwatch'], $app['logger']);
File Arrays.php
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace Nine\Library;
/**
* @package Nine Library
* @version 0.3.1
Function register
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function register(Container $app)
{
// only register if twig templates are enabled by the framework
if ($this->config['view.twig.enabled']) {
- 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 data_set
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public static function data_set(&$target, $key, $value, $overwrite = TRUE)
{
$segments = is_array($key) ? $key : explode('.', $key);
if (($segment = array_shift($segments)) === '*') {
- 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 register
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $app)
{
// only register if twig templates are enabled by the framework
if ($this->config['view.twig.enabled']) {
Method register
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $app)
{
$app['db.default_options'] = [
'driver' => 'pdo_mysql',
'dbname' => env('DB_DATABASE', NULL),
Function register
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function register(Container $app)
{
$app['profiler.mount_prefix'] = '/_profiler';
$app->extend('dispatcher', function ($dispatcher, $app) {
return new TraceableEventDispatcher($dispatcher, $app['stopwatch'], $app['logger']);
- 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
File F9WebProfilerServiceProvider.php
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of the Silex framework.
*
Function getMethodArguments
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getMethodArguments(Request $request, $controller, array $parameters) : array
{
// use this request
$this->current_request = $request;
- 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 parseItem
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseItem(Container $container, $name)
{
try {
$element = $container[$name];
} catch (\Exception $e) {
Function parseItem
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function parseItem(Container $container, $name)
{
try {
$element = $container[$name];
} catch (\Exception $e) {
- 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 data_get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function data_get($target, $key, $default = NULL)
{
if (NULL === $key) {
return $target;
}
- 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 extract_dependencies
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function extract_dependencies($class, $method = NULL)
{
// collect the request attributes
$attributes = $this->current_request->attributes->all();
Function extract_dependencies
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function extract_dependencies($class, $method = NULL)
{
// collect the request attributes
$attributes = $this->current_request->attributes->all();
- 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 data_set
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function data_set(&$target, $key, $value, $overwrite = TRUE)
{
$segments = is_array($key) ? $key : explode('.', $key);
if (($segment = array_shift($segments)) === '*') {
Method set_loader
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function set_loader($configuration)
{
switch (TRUE) {
case ($this->template_type === static::TWIG_LOADER_ARRAY):
Method register
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $app)
{
$config = $this->config;
// optionally include the Blade templating engine.
Function importByExtension
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function importByExtension($extension, $filePath, $key = '')
{
$extension = strtolower(str_replace('*', '', $extension));
if ( ! in_array($extension, ['.json', '.php', '.yaml', '.yml'], TRUE)) {
- 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"