Showing 21 of 21 total issues
Request
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class Request
{
/**
* The request method (e.g. POST, POST, PUT...)
*
Enlighten
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Enlighten
{
/**
* The incoming HTTP request being handled by the application.
* Can be set manually via setRequest(), or will be built automatically when Enlighten::start() is called.
File Request.php
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Enlighten\Http;
/**
Function deflateFilesArray
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function deflateFilesArray(array $files)
{
/**
* This is where all the magic happens. This function converts a given $_FILES array to an array format that
* the Enlighten request handling code can understand. The goal is simple: convert the array to a workable
- 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 start
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function start()
{
$this->beforeStart();
// Begin output buffering and begin building the HTTP response
- 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 Enlighten.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Enlighten;
use Enlighten\Http\Request;
Function applyUrlVariables
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function applyUrlVariables($urlPattern, array $variables)
{
$regexPattern = '/([\\' . self::T_URL_VARIABLE . ']{1}[\\w]*)/';
$inputParts = explode('/', $urlPattern);
- 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 start
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function start()
{
$this->beforeStart();
// Begin output buffering and begin building the HTTP response
Function action
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function action(Context $context = null)
{
$targetFunc = null;
$classObject = 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 action
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function action(Context $context = null)
{
$targetFunc = null;
$classObject = null;
Function determineParamValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function determineParamValue(\ReflectionParameter $parameter)
{
$class = $parameter->getClass();
if (!empty($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 getReflectionParameters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getReflectionParameters(callable $callable)
{
$reflectionParams = [];
if (is_array($callable)) {
- 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 setCookie
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setCookie($name, $value, $expire = 0, $path = null, $domain = null, $secure = false, $httpOnly = false)
Function dispatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function dispatch(Route $route, Request $request = null)
{
$context = $this->context;
if (empty($this->context) && !empty($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 createRegexMask
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function createRegexMask($urlPattern)
{
$parts = explode('/', $urlPattern);
$formattedRegex = '';
- 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 trigger
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function trigger($eventType, Context $context = null)
{
$continue = true;
if (!isset($this->handlers[$eventType])) {
- 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 'Could not create temporary file.';
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return 'The upload was blocked.';
Avoid too many return
statements within this method. Open
return 'An unknown error occured.';