Showing 34 of 37 total issues
ResponseStatus
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ResponseStatus
{
/**
* Name and revision of the information protocol
*
Function render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
if (Sapi::isCli() && Config::get('environment') == 'production') {
$suffix = 'CliAction';
$action = $this->request->fromCli()->get('action', 'index');
- 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 initCliAction
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initCliAction()
{
clearstatcache();
$app = 'app/' . Config::get('app.name') . '/';
Method format
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function format(\Exception $exception, $isCli = false)
{
if ($isCli === true) {
return
"+++ Untreated Exception +++" . PHP_EOL . "Message: " . $exception->getMessage() . PHP_EOL . "Location: " . $exception->getFile()
Function fire
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function fire($events, $parameters = array(), $halt = false)
{
$responses = array();
$parameters = (array)$parameters;
- 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 render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
if (Sapi::isCli() && Config::get('environment') == 'production') {
$suffix = 'CliAction';
$action = $this->request->fromCli()->get('action', 'index');
Function init
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
//convert URL params into regex patterns, construct a regex for this route, load params
$regex = preg_replace_callback(
'#:([\w]+)\+?#', array($this, 'computeUrlRegex'), str_replace(')', ')?', (string)$this->rule)
- 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 setupUtils
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function setupUtils(array $server, $tmpPath, $logging = 'file')
{
self::$env = new Environment($server);
$envData = self::$env->data();
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(\Pimf\Request $request, $repositoryPath = '/Controller', $prefix = 'Pimf\\', $router)
{
$controllerName = $request->fromGet()->get('controller');
$this->router = $router;
Method run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function run(array $get, array $post, array $cookie, array $files)
{
$cli = array();
if (Sapi::isCli()) {
$cli = Cli::parse((array)self::$env->argv);
Method native
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function native($code, $error, $file, $line, Logger $logger, $reporting, $exit = true)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($path, $name, $mime = null, $size = null, $error = null, $test = false)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
array $getData,
array $postData = array(),
array $cookieData = array(),
array $cliData = array(),
array $filesData = array(),
Method put
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function put($name, $value, $expiration = 0, $path = '/', $domain = null, $secure = false)
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(\Pimf\Request $request, $repositoryPath = '/Controller', $prefix = 'Pimf\\', $router)
{
$controllerName = $request->fromGet()->get('controller');
$this->router = $router;
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function run(array $get, array $post, array $cookie, array $files)
{
$cli = array();
if (Sapi::isCli()) {
$cli = Cli::parse((array)self::$env->argv);
- 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
Request $request,
Response $response = null,
Logger $logger,
$em,
Router $router,
Function view
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected static function view($code, $status, $exit = true)
{
if (Sapi::isCli()) {
echo $status . PHP_EOL;
if ($exit) {
- 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 forever
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function forever($name, $value, $path = '/', $domain = null, $secure = false)
Function handleError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function handleError($status)
{
$msg = '';
switch ($status) {
- 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"