File Terminal.php
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kahlan\Reporter;
use Kahlan\Log;
use Kahlan\Util\Text;
Terminal
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Terminal extends Reporter
{
/**
* Indicates if the console cursor in on a new line.
*
Method _reportFailure
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _reportFailure($log)
{
$this->_indent++;
$type = $log->type();
switch ($type) {
Function _reportFailure
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function _reportFailure($log)
{
$this->_indent++;
$type = $log->type();
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 _reportSummary
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _reportSummary($summary)
{
$passed = $summary->passed();
$skipped = $summary->skipped();
$pending = $summary->pending();
Method _reportSpecMessage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _reportSpecMessage($log)
{
$messages = $log->messages();
$message = end($messages);
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 _reportSummary
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function _reportSummary($summary)
{
$passed = $summary->passed();
$skipped = $summary->skipped();
$pending = $summary->pending();
- 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 _reportSkipped
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _reportSkipped($summary)
{
foreach ([
'pending' => 'cyan',
'excluded' => 'yellow',
- 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 _reportDiff
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function _reportDiff($log)
{
$data = $log->data();
$this->write("It expect actual ");
- 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 _reportSpecMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function _reportSpecMessage($log)
{
$messages = $log->messages();
$message = end($messages);
- 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"