Talesoft/tale-stream

View on GitHub

Showing 3 of 5 total issues

Stream has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Stream implements StreamInterface
{
    /**
     * Tells ->seek() to move from the start of the stream.
     */
Severity: Minor
Found in src/Stream.php - About 3 hrs to fix

    File Stream.php has 291 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    
    namespace Tale;
    
    use InvalidArgumentException;
    Severity: Minor
    Found in src/Stream.php - About 3 hrs to fix

      Function getIterator has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getIterator(): Generator
          {
              $line = '';
              foreach ($this->readIterator as $content) {
                  $parts = explode($this->delimiter, $content);
      Severity: Minor
      Found in src/Stream/Iterator/SplitIterator.php - About 2 hrs 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