Showing 120 of 487 total issues
Method importByExtension
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function importByExtension($extension, $filePath, $key = '')
{
$extension = strtolower(str_replace('*', '', $extension));
if ( ! in_array($extension, ['.json', '.php', '.yaml', '.yml'], TRUE)) {
Method getMethodArguments
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMethodArguments(Request $request, $controller, array $parameters) : array
{
// use this request
$this->current_request = $request;
Method encode_readable_json
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function encode_readable_json($data, $indent = 0)
{
$_escape = function ($str) {
return preg_replace("!([\b\t\n\r\f\"\\'])!", "\\\\\\1", $str);
};
Method build
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function build($concrete, array $parameters = [])
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
Method getReflection
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getReflection($class, $method = NULL)
{
$reflection = NULL;
switch ($class) {
Function getReflection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getReflection($class, $method = NULL)
{
$reflection = NULL;
switch ($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
Method data_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function data_get($target, $key, $default = NULL)
{
if (NULL === $key) {
return $target;
}
Function register
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function register(Container $app)
{
$app['db.default_options'] = [
'driver' => 'pdo_mysql',
'dbname' => env('DB_DATABASE', NULL),
- 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 importDeclaration
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function importDeclaration($configurationType, $definition)
{
switch ($configurationType) {
case 'add':
$this->registerAdds($definition);
- 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_loader
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function set_loader($configuration)
{
switch (TRUE) {
case ($this->template_type === static::TWIG_LOADER_ARRAY):
- 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 encode_readable_json
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function encode_readable_json($data, $indent = 0)
{
$_escape = function ($str) {
return preg_replace("!([\b\t\n\r\f\"\\'])!", "\\\\\\1", $str);
};
- 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 subRequest
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
string $uri,
string $method = 'GET',
array $parameters = [],
array $cookies = [],
array $files = [],
Function var_to_string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function var_to_string($var)
{
if (is_object($var)) {
return sprintf('Object(%s)', get_class($var));
}
- 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 merge_recursive_replace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function merge_recursive_replace($key, $value)
{
// Holds all the arrays passed
$params = func_get_args();
- 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 registerInstances
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function registerInstances($config, $app, $events, $container, $global_scope)
Function value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function value($array, $key, $default = NULL)
{
if ($key instanceof \Closure or is_callable($key)) {
return $key($array, $default);
}
- 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 array_forget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function array_forget(&$array, $keys)
{
$original = &$array;
foreach ((array) $keys as $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 onKernelRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
$this->setCurrentRequest($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
Function boot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function boot()
{
if ($this->booted) {
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
Avoid too many return
statements within this method. Open
return NULL;