File Kahlan.php
has 616 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kahlan\Cli {
use Kahlan\Jit\Patcher\FinalClass;
use RecursiveDirectoryIterator;
Method initKahlanGlobalFunctions
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initKahlanGlobalFunctions()
{
if (getenv('KAHLAN_DISABLE_FUNCTIONS') || (defined('KAHLAN_DISABLE_FUNCTIONS') && KAHLAN_DISABLE_FUNCTIONS)) {
return;
}
Function initKahlanGlobalFunctions
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function initKahlanGlobalFunctions()
{
if (getenv('KAHLAN_DISABLE_FUNCTIONS') || (defined('KAHLAN_DISABLE_FUNCTIONS') && KAHLAN_DISABLE_FUNCTIONS)) {
return;
}
- 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
Kahlan
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Kahlan
{
public const VERSION = '5.2.6';
/**
Function _console
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function _console()
{
return Filters::run($this, 'console', [], function ($chain) {
$collection = $this->reporters();
- 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 _help
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _help()
{
$terminal = $this->terminal();
if (!$this->commandLine()->get('no-header')) {
$terminal->write($terminal->kahlan() ."\n\n");
Method _console
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _console()
{
return Filters::run($this, 'console', [], function ($chain) {
$collection = $this->reporters();
Method __construct
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($options = [])
{
$defaults = ['autoloader' => null, 'suite' => null];
$options += $defaults;
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;
Function _coverage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function _coverage()
{
return Filters::run($this, 'coverage', [], function ($chain) {
if (!$this->commandLine()->exists('coverage')) {
return;
- 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"