Showing 187 of 191 total issues
Method _addClosingParenthesis
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _addClosingParenthesis($pos, $index, $parent)
{
$count = 0;
$nodes = $parent->tree;
$total = count($nodes);
Method debug
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function debug($content)
{
$root = is_object($content) ? $content : static::parse($content, ['lines' => true]);
$result = '';
Method _reportSpecMessage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _reportSpecMessage($log)
{
$messages = $log->messages();
$message = end($messages);
Method export
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function export($options)
{
$defaults = [
'collector' => null,
'head' => null,
Method errorType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function errorType($value)
{
switch ($value) {
case E_ERROR:
return 'E_ERROR';
Method specEnd
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function specEnd($log = null)
{
$isOk = $log->passed() ? "ok" : "not ok";
switch ($log->type()) {
Function box
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function box($name = '', $box = null)
{
static $boxes = [];
if (func_num_args() === 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 _renderCoverage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function _renderCoverage($metrics)
{
$stats = $metrics->data();
foreach ($stats['files'] as $file) {
$this->write("File: {$file}" . "\n\n");
- 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 _generateMethodStubs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected static function _generateMethodStubs($methods, $defaults = true)
{
$result = [];
$methods = $methods !== null ? (array) $methods : [];
- 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 addPsr4
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
Method _coverage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _coverage($file, $coverage)
{
$result = [];
$root = $this->parse($file);
foreach ($root->lines['content'] as $num => $content) {
Method add
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->_fallbackDirsPsr0 = array_merge(
Method match
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function match($actual, $expected)
{
$args = func_get_args();
$expected = count($args) > 2 ? array_slice($args, 1) : $expected;
$expected = (array) $expected;
Method _buildDescription
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _buildDescription($startIndex = 0)
{
$times = $this->times();
$report = $this->_report;
Method _coverage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _coverage()
{
return Filters::run($this, 'coverage', [], function ($chain) {
if (!$this->commandLine()->exists('coverage')) {
return;
Method patched
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function patched($namespace, $className, $methodName, &$substitute = null)
{
$name = $className ?: $methodName;
if ($namespace && ($className || function_exists("{$namespace}\\{$name}"))) {
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 __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($config = [])
{
$defaults = [
'driver' => null,
'path' => [],
Method nextMatchingBracket
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function nextMatchingBracket()
{
if (!$this->valid()) {
return;
}
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 ");