# bkdotcom/PHPDebugConsole

### Showing 161 of 181 total issues

#### Function clearErrorsHelper has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open

    private function clearErrorsHelper(&$log,$clear = true)
{
$errorsNotCleared = array(); foreach ($log as $k =>$logEntry) {
if (\in_array($logEntry['method'], array('error','warn'), true) === false) { Found in src/Debug/Method/Clear.php - About 1 hr to fix # 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 findGroupEnd has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open  private function findGroupEnd($id, $logEntries) {$depth = 0;
$inGroup = false; foreach ($logEntries as $key =>$logEntry) {
Found in src/Debug/Data.php - About 1 hr to fix

# 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"

#### Function getLastFrame has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open

    private function getLastFrame()
{
$backtrace = \xdebug_get_function_stack();$backtrace = \array_reverse($backtrace);$frame = false;
Found in src/Debug/Utility/FindExit.php - About 1 hr to fix

# 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"

#### Function autoArgsTest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open

    private function autoArgsTest($file,$functionStartLine, $callerLine) { if ($file === null) {
return false;
}
Found in src/Debug/Method/Group.php - About 1 hr to fix

# 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"

#### Function pathSet has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open

    public static function pathSet(&$array,$path, $val) {$path = \array_reverse(self::pathToArray($path)); while ($path) {
$key = \array_pop($path);
Found in src/Debug/Utility/ArrayUtil.php - About 1 hr to fix

# 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"

#### Function importLegacy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open

    private static function importLegacy($vals) { foreach ($vals as $k =>$v) {
if (\is_array($v) === false) { continue; Found in src/Debug/Utility/SerializeLog.php - About 1 hr to fix # 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 unsubscribe has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open  public function unsubscribe($eventName, $callable) { if (!isset($this->subscribers[$eventName])) { return; } Found in src/PubSub/Manager.php - About 1 hr to fix # 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 buildOutput has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open  private function buildOutput() {$lftDefault = \strtr(\ini_get('xdebug.file_link_format'), array(
'%f' => '%file',
'%l' => '%line',
Found in src/Debug/Route/Html.php - About 1 hr to fix

#### Function applyFilterToNode has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open

function applyFilterToNode ($node, channelNameRoot) { var hiddenWas =$node.is('.filter-hidden')
var i
var isFilterVis = true
var $parentGroup Found in src/Debug/js_src/filter.js - About 1 hr to fix #### Method timeLogEntry has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open  public function timeLogEntry(Debug$debug, $method,$args)
{
$logEntry = new LogEntry($debug,
$method, Found in src/Debug/Method/Time.php - About 1 hr to fix #### Method exitCheck has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open Found in src/Debug/InternalEvents.php - About 1 hr to fix #### Function rowComparator has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open function rowComparator (col, dir, collator) { var floatRe = /^([+-]?(?:0|[1-9]\d*)(?:\.\d*)?)(?:[eE]([+-]?\d+))?$/
return function sortFunction (trA, trB) {
var a = trA.cells[col].textContent.trim()
var b = trB.cells[col].textContent.trim()
Found in src/Debug/js_src/tableSort.js - About 1 hr to fix

#### Method logSessionSettings has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open

    private function logSessionSettings($namePassed) {$settings = array(
array(
Found in src/Debug/Plugin/LogEnv.php - About 1 hr to fix

#### Method publishMetaGet has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open

    private function publishMetaGet()
{
$metaVals = array( 'processId' => \getmypid(), 'HTTP_HOST' => null, Found in src/Debug/Route/Wamp.php - About 1 hr to fix #### Method methodTabular has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open  private function methodTabular(LogEntry$logEntry)
{
$logEntry->setMeta('undefinedAs', 'null'); if ($logEntry['method'] === 'trace') {
$logEntry['firephpMeta']['Label'] = 'trace'; Found in src/Debug/Route/Firephp.php - About 1 hr to fix #### Method getParamsReflection has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open  private function getParamsReflection(ReflectionMethod$refMethod, $phpDoc) {$params = array();
$collectAttribute =$this->abs['cfgFlags'] & AbstractObject::PARAM_ATTRIBUTE_COLLECT;
\set_error_handler(function () {
Found in src/Debug/Abstraction/AbstractObjectMethodParams.php - About 1 hr to fix

#### Method processLogEntries has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open

    public function processLogEntries(Event $event) {$this->dumper->crateRaw = false;
$this->outputEvent =$event;
$this->data =$this->debug->data->get();
Found in src/Debug/Route/Firephp.php - About 1 hr to fix

#### Function xdebugGetFunctionStack has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open

    private static function xdebugGetFunctionStack()
{
if (static::isXdebugFuncStackAvail() === false) {
return false;
}
Found in src/Backtrace/Backtrace.php - About 55 mins to fix

# 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"

#### Function searchRecursive has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open

    public static function searchRecursive($value,$array, $inclKeys = false) {$key = \array_search($value,$array, true);
if ($key !== false) { return array($key);
Found in src/Debug/Utility/ArrayUtil.php - About 55 mins to fix

# 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"

#### Function onErrorLow has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open

Found in src/Debug/Framework/Yii2/Module.php - About 55 mins to fix

# 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"