Showing 22 of 26 total issues
File index.php
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Show errors at least initially
*
Function getArguments
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getArguments()
{
$args = $this->getArgs();
$this->arguments = array();
if (empty($this->arguments) && !empty($args) && count($args) > 0) {
- 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 getSource
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getSource()
{
if (empty($this->source)) {
$lines = $this->_getFileSource();
$lineno = $this->getLineNo();
- 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 _populate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function _populate()
{
$callback = $this->getCallback();
if ($this->isClosure()) {
$this->function_name = $callback;
- 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 getCallbackType
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getCallbackType(callable $callback)
{
if (is_object($callback) && ($callback instanceof \Closure)) {
return self::CALLBACK_CLOSURE;
} else {
- 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 getArguments
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getArguments()
{
$args = $this->getArgs();
$this->arguments = array();
if (empty($this->arguments) && !empty($args) && count($args) > 0) {
Method renderHighlight
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderHighlight($return = false, $info = false)
{
$directives = $this->getContext('highlighting');
$old_values = array();
foreach ($directives as $name=>$default) {
Function __toString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __toString()
{
try {
$str = 'at ' . $this->getCalled();
- 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 getSource
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSource()
{
if (empty($this->source)) {
$lines = $this->_getFileSource();
$lineno = $this->getLineNo();
Function getReflector
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getReflector($value, $flag = self::MODE_STRICT, array $order = null)
{
$type = self::getType($value, $flag, $order);
$reflector = new Value\ReflectionUnknown($value);
switch ($type) {
- 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 __toString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __toString()
{
try {
$str = 'at ' . $this->getCalled();
Function __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($value)
{
parent::__construct($value);
if (!empty($this::$proxy_class)) {
if (class_exists($this::$proxy_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 renderHighlight
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function renderHighlight($return = false, $info = false)
{
$directives = $this->getContext('highlighting');
$old_values = array();
foreach ($directives as $name=>$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 getTraces
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getTraces()
{
if (empty($this->traces)) {
$this->traces = array();
$counter = 1;
- 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 _renderSource
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _renderSource()
{
$str = '';
$lines = $this->getSource();
foreach ($lines as $i=>$line) {
- 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 getType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getType($value, $flag = self::MODE_STRICT, array $order = null)
{
if (is_null($order)) {
$order = self::$ordered_types;
}
- 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 loadClass
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function loadClass($className)
{
if ($filePath = $this->resolveFileName($className)) {
if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
if ($this->classFileExists($filePath)) {
- 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 getReflector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getReflector()
{
if (empty($this->reflector)) {
if ($this->isFunction() || $this->isClosure()) {
$this->reflector = new \ReflectionFunction($this->getFunctionName());
- 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;
Function export
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function export($argument, $return = false)
{
$_class = get_called_class();
$reflection = new \ReflectionClass($_class);
if (!in_array('Reflector', $reflection->getInterfaceNames())) {
- 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"