Showing 191 of 191 total issues
Method nextMatchingBracket
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function nextMatchingBracket()
{
if (!$this->valid()) {
return;
}
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($config = [])
{
$defaults = [
'driver' => null,
'path' => [],
Method _blockEnd
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _blockEnd($runAfterEach = true)
{
$type = $this->log()->type();
foreach ($this->_expectations as $expectation) {
if (!($logs = $expectation->logs()) && $type !== 'errored') {
Method _reportDiff
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _reportDiff($log)
{
$data = $log->data();
$this->write("It expect actual ");
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 _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 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 _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 __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($config = [])
{
$defaults = [
'suite' => null,
'parent' => null,
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 _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 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 _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 stop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function stop($summary)
{
if (!$this->_verbosity) {
return;
}
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 . '\\';
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 _processTree
has a Cognitive Complexity of 9 (exceeds 5 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 . '\\';
- 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"