Showing 33 of 37 total issues
Function distribute
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function distribute($uri, array $arguments = array(), $method = 'get')
{
// strip double slashes
$uri = str_replace('//', '/', $uri);
- 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 FrontController.php
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the MVC-Fundamental package.
*
* Copyright (c) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
Function callRoute
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function callRoute($route, array $arguments = array(), $method = 'get')
{
$this->boot();
@list($callback, $params) = $this->get('router')->distribute(
- 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 callControllerAction
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function callControllerAction($controller = null, $action = null, array $arguments = array())
{
$this->boot();
$controller_name = $controller;
- 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 __callStatic
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function __callStatic($name, array $arguments)
{
// getNew('name')
if ($name=='getNew') {
$service_name = isset($arguments[0]) ? $arguments[0] : 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
Method callRoute
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callRoute($route, array $arguments = array(), $method = 'get')
{
$this->boot();
@list($callback, $params) = $this->get('router')->distribute(
Method boot
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function boot(FrontControllerInterface $app)
{
// stores the FrontController
self::setFrontController($app);
Method callControllerAction
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callControllerAction($controller = null, $action = null, array $arguments = array())
{
$this->boot();
$controller_name = $controller;
Function boot
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function boot(FrontControllerInterface $app)
{
// stores the FrontController
self::setFrontController($app);
- 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 __callStatic
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function __callStatic($name, array $arguments)
{
// getNew('name')
if ($name=='getNew') {
$service_name = isset($arguments[0]) ? $arguments[0] : null;
Method _getExceptionMessage
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _getExceptionMessage(\Exception $e, $primary = 0)
{
$errno = $e->getCode();
$errstr = $e->getMessage();
$errfile = $e->getFile();
Method distribute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function distribute($uri, array $arguments = array(), $method = 'get')
{
// strip double slashes
$uri = str_replace('//', '/', $uri);
Method defaultLayoutAction
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function defaultLayoutAction(TemplateEngineInterface $template_engine, FrontControllerInterface $app)
{
$layout = $template_engine->getDefaultLayout();
$req = $app->get('request')->getBaseUrl();
$content = $template_engine->renderTemplate(self::$views_dir.'lorem_ipsum_content.php');
Function locateController
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function locateController($name)
{
// case $name is a real class name
if (is_object($name) || class_exists($name)) {
return $name;
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function boot()
{
if (!self::$_is_booted) {
if (empty($this->_options['temp_dir'])) {
$this->_options['temp_dir'] =
- 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 locateController
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function locateController($name)
{
// case $name is a real class name
if (is_object($name) || class_exists($name)) {
return $name;
Function _prepare
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _prepare()
{
$this->_match = $this->_route;
if (false!==preg_match_all('~{([^}]+)}~', $this->_route, $matches) && count($matches)>1 && !empty($matches[1])) {
foreach ($matches[1] as $i=>$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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($message = '', $code = 0, $severity = 1, $filename = __FILE__, $lineno = __LINE__, \Exception $previous = null)
Method error
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function error($message, $status = 500, $code = 0, $filename = __FILE__, $lineno = __LINE__);
Method error
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function error($message, $status = 500, $code = 0, $filename = __FILE__, $lineno = __LINE__)