Showing 187 of 191 total issues
Function _dump
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected static function _dump($string)
{
$es = ['0', 'x07', 'x08', 't', 'n', 'v', 'f', 'r'];
$unescaped = '';
$chars = str_split($string);
- 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 instance
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function instance($options = [])
{
$class = static::classname($options);
if (isset($options['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
Function parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function parse($argv, $override = true)
{
$exists = [];
$override ? $this->_values = $this->_defaults : $exists = array_fill_keys(array_keys($this->_values), true);
- 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 _useNode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function _useNode()
{
$current = $this->_states['current'];
$token = $this->_stream->current(true);
$last = $alias = $use = '';
- 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 backtrace
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function backtrace($options = [])
{
$defaults = [
'trace' => [],
'start' => 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
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($config = [])
{
$defaults = [
'suite' => null,
'parent' => null,
Method _process
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _process($options = [])
{
$suite = $this->suite();
if ($suite->root()->focused() && !$this->focused()) {
return;
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($actual, $expected)
{
$this->_backtrace = Debugger::backtrace();
if (is_string($actual)) {
Method _renderCoverage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _renderCoverage($metrics)
{
$stats = $metrics->data();
foreach ($stats['files'] as $file) {
$this->write("File: {$file}" . "\n\n");
Method _getMetricsReport
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _getMetricsReport($children, $verbosity, $depth = 0, $tab = 3, &$maxWidth = null)
{
$list = [];
foreach ($children as $child) {
$type = $child->type();
Method _processTree
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _processTree($parent)
{
foreach ($parent->tree as $node) {
if ($node->processable && $node->type === 'class' && $node->extends) {
$namespace = $node->namespace->name . '\\';
Method partition
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function partition($index, $total)
{
$index = (integer) $index;
$total = (integer) $total;
if (!$index || !$total || $index > $total) {
Method _renderMetrics
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _renderMetrics($metrics, $verbosity)
{
$maxLabelWidth = null;
if ($verbosity === 1) {
return;
Method stop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function stop($summary)
{
if (!$this->_verbosity) {
return;
}
Function cast
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function cast($value, $type, $array = false)
{
if (is_array($value)) {
$result = [];
foreach ($value as $key => $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
Function addPsr4
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
- 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 matchArgs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function matchArgs($args)
{
if ($this->_args === null || $args === null) {
return true;
}
- 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 _get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _get($name)
{
$config = $this->option($name);
[$key, $extra] = $this->_splitOptionName($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 findPath
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function findPath($namespace, $forceDir = false)
{
$paths = static::prefixes();
$logicalPath = trim(strtr($namespace, '\\', DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR);
- 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 __call
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __call($matcherName, $args)
{
$result = true;
$spec = $this->_actual;
$this->_passed = true;
- 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"