bkdotcom/PHPDebugConsole

View on GitHub

Showing 147 of 170 total issues

Function methodGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function methodGroup(LogEntry $logEntry)
    {
        $method = $logEntry['method'];
        if ($method === 'groupEnd') {
            if ($logEntry->getMeta('closesSummary')) {
Severity: Minor
Found in src/Debug/Dump/Text.php - About 25 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"

Further reading

Function pathRemoveDots has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function pathRemoveDots($path)
    {
        if ($path === '') {
            return '';
        }
Severity: Minor
Found in src/HttpMessage/Utility/Uri.php - About 25 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"

Further reading

Function removePlugin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function removePlugin($plugin)
    {
        if (\is_string($plugin)) {
            $plugin = $this->findPluginByName($plugin);
        } elseif (\is_object($plugin) === false) {
Severity: Minor
Found in src/Debug/Plugin/Manager.php - About 25 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"

Further reading

Function updateTableInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateTableInfo($rowKey, array $rowValues, array $rowInfo)
    {
        $this->meta['tableInfo']['haveObjRow'] = $this->meta['tableInfo']['haveObjRow'] || $rowInfo['class'];
        foreach ($this->meta['totalCols'] as $key) {
            /**
Severity: Minor
Found in src/Debug/Utility/Table.php - About 25 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"

Further reading

Function create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function create ($entry, $strings, remove) {
  var $objects = $entry.find('.t_object > .object-inner > .property.debug-value > .t_identifier').filter(function () {
    return this.innerText.match(/^file$/)
  })
  var detectFiles = $entry.data('detectFiles') === true || $objects.length > 0
Severity: Minor
Found in src/Debug/js_src/FileLinks.js - About 25 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"

Further reading

Function getAbstraction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAbstraction($string, $typeMore = null, $crateVals = array())
    {
        $absValues = $this->absValuesInit($string, $typeMore);
        switch ($typeMore) {
            case Type::TYPE_STRING_BASE64:
Severity: Minor
Found in src/Debug/Abstraction/AbstractString.php - About 25 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"

Further reading

Function dump has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function dump(Abstraction $abs)
    {
        $str = '<dt>phpDoc</dt>' . "\n";
        foreach ($abs['phpDoc'] as $tagName => $values) {
            if (\is_array($values) === false) {
Severity: Minor
Found in src/Debug/Dump/Html/ObjectPhpDoc.php - About 25 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"

Further reading

Function processLogEntry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function processLogEntry(LogEntry $logEntry)
    {
        $method = $logEntry['method'];
        $args = $logEntry['args'];
        $this->setFirephpMeta($logEntry);
Severity: Minor
Found in src/Debug/Route/Firephp.php - About 25 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"

Further reading

Function buildConsoleCall has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildConsoleCall(LogEntry $logEntry)
    {
        $method = $logEntry['method'];
        $args = $logEntry['args'];
        $meta = $logEntry['meta'];
Severity: Minor
Found in src/Debug/Route/Script.php - About 25 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"

Further reading

Function applyOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function applyOptions(RequestInterface $request, array $options)
    {
        $this->assertOptions($options);

        foreach ($options['headers'] as $name => $val) {
Severity: Minor
Found in src/CurlHttpMessage/AbstractClient.php - About 25 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"

Further reading

Function createFileLinkMatches has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function createFileLinkMatches ($string, foundFiles) {
  var matches = []
  var text = $.trim($string.text())
  if ($string.data('file')) {
    // filepath specified in data-file attr
Severity: Minor
Found in src/Debug/js_src/FileLinks.js - About 25 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"

Further reading

Function getOption has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOption($path)
    {
        $path = \is_array($path)
            ? $path
            : \array_filter(\preg_split('#[\./]#', (string) $path), 'strlen');
Severity: Minor
Found in src/CurlHttpMessage/CurlReqRes.php - About 25 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"

Further reading

Function getFirstIndexRewind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getFirstIndexRewind(array $backtrace, $index)
    {
        $count = \count($backtrace);
        if ($index && $index === $count && self::getClass($backtrace[$index - 1]) === null) {
            // every frame was skipped and first frame is include, or similar
Severity: Minor
Found in src/Backtrace/SkipInternal.php - About 25 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"

Further reading

Function enhanceEntryDefault has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function enhanceEntryDefault ($entry) {
  // regular log-type entry
  var title
  if ($entry.data('file')) {
    if (!$entry.attr('title')) {
Severity: Minor
Found in src/Debug/js_src/enhanceEntries.js - About 25 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"

Further reading

Function initLogEntry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function initLogEntry(LogEntry $logEntry)
    {
        $this->logEntry = $logEntry;
        $args = $this->logEntry['args'];
        $argCount = \count($args);
Severity: Minor
Found in src/Debug/Plugin/Method/Table.php - About 25 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"

Further reading

Function addSpecial has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addSpecial($special)
    {
        $special = (array) $special;
        foreach ($special as $char) {
            if (\strpos($char, 'regex:') !== 0) {
Severity: Minor
Found in src/Debug/Utility/Utf8Buffer.php - About 25 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"

Further reading

Function test4byteSeq has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function test4byteSeq()
    {
        $bytes = $this->getBytes(4);
        if (\count($bytes) !== 4) {
            return false;
Severity: Minor
Found in src/Debug/Utility/Utf8Buffer.php - About 25 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"

Further reading

Function enhanceValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function enhanceValue (node, $entry) {
  var $node = $(node)
  if ($node.is('.t_array')) {
    enhanceArray.enhance($node)
  } else if ($node.is('.t_object')) {
Severity: Minor
Found in src/Debug/js_src/enhanceEntries.js - About 25 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"

Further reading

Function xdebugFix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function xdebugFix(array $stack)
    {
        $count = \count($stack);
        for ($i = 0; $i < $count; $i++) {
            $frame = \array_merge(array(
Severity: Minor
Found in src/Backtrace/Xdebug.php - About 25 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"

Further reading

Function attachmentFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function attachmentFields(array $fields)
    {
        $fieldsNew = array();
        /** @psalm-var mixed $field */
        foreach ($fields as $field) {
Severity: Minor
Found in src/Slack/BlockFactory.php - About 25 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"

Further reading

Severity
Category
Status
Source
Language