kahlan/kahlan

View on GitHub

Showing 191 of 191 total issues

Method nextMatchingBracket has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function nextMatchingBracket()
    {
        if (!$this->valid()) {
            return;
        }
Severity: Minor
Found in src/Jit/TokenStream.php - About 1 hr to fix

    Method __construct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($config = [])
        {
            $defaults = [
                'driver'         => null,
                'path'           => [],
    Severity: Minor
    Found in src/Reporter/Coverage/Collector.php - About 1 hr to fix

      Method _blockEnd has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _blockEnd($runAfterEach = true)
          {
              $type = $this->log()->type();
              foreach ($this->_expectations as $expectation) {
                  if (!($logs = $expectation->logs()) && $type !== 'errored') {
      Severity: Minor
      Found in src/Block/Specification.php - About 1 hr to fix

        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 ");
        Severity: Minor
        Found in src/Reporter/Terminal.php - About 1 hr to fix

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

              protected function _useNode()
              {
                  $current = $this->_states['current'];
                  $token = $this->_stream->current(true);
                  $last = $alias = $use = '';
          Severity: Minor
          Found in src/Jit/Parser.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 _dump has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              protected static function _dump($string)
              {
                  $es = ['0', 'x07', 'x08', 't', 'n', 'v', 'f', 'r'];
                  $unescaped = '';
                  $chars = str_split($string);
          Severity: Minor
          Found in src/Util/Text.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 instance has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function instance($options = [])
              {
                  $class = static::classname($options);
          
                  if (isset($options['args'])) {
          Severity: Minor
          Found in src/Plugin/Double.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 parse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function parse($argv, $override = true)
              {
                  $exists = [];
                  $override ? $this->_values = $this->_defaults : $exists = array_fill_keys(array_keys($this->_values), true);
          
          
          Severity: Minor
          Found in src/Cli/CommandLine.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 backtrace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function backtrace($options = [])
              {
                  $defaults = [
                      'trace'  => [],
                      'start'  => 0,
          Severity: Minor
          Found in src/Analysis/Debugger.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 _renderCoverage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _renderCoverage($metrics)
              {
                  $stats = $metrics->data();
                  foreach ($stats['files'] as $file) {
                      $this->write("File: {$file}" . "\n\n");
          Severity: Minor
          Found in src/Reporter/Coverage.php - About 1 hr to fix

            Method __construct has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function __construct($config = [])
                {
                    $defaults = [
                        'suite'   => null,
                        'parent'  => null,
            Severity: Minor
            Found in src/Block.php - About 1 hr to fix

              Method __construct has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function __construct($actual, $expected)
                  {
                      $this->_backtrace = Debugger::backtrace();
              
                      if (is_string($actual)) {
              Severity: Minor
              Found in src/Matcher/ToReceive.php - About 1 hr to fix

                Method _process has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function _process($options = [])
                    {
                        $suite = $this->suite();
                        if ($suite->root()->focused() && !$this->focused()) {
                            return;
                Severity: Minor
                Found in src/Block.php - About 1 hr to fix

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

                      public function partition($index, $total)
                      {
                          $index = (integer) $index;
                          $total = (integer) $total;
                          if (!$index || !$total || $index > $total) {
                  Severity: Minor
                  Found in src/Block/Group.php - About 1 hr to fix

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

                        protected function _renderMetrics($metrics, $verbosity)
                        {
                            $maxLabelWidth = null;
                            if ($verbosity === 1) {
                                return;
                    Severity: Minor
                    Found in src/Reporter/Coverage.php - About 1 hr to fix

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

                          protected function _getMetricsReport($children, $verbosity, $depth = 0, $tab = 3, &$maxWidth = null)
                          {
                              $list = [];
                              foreach ($children as $child) {
                                  $type = $child->type();
                      Severity: Minor
                      Found in src/Reporter/Coverage.php - About 1 hr to fix

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

                            public function stop($summary)
                            {
                                if (!$this->_verbosity) {
                                    return;
                                }
                        Severity: Minor
                        Found in src/Reporter/Coverage.php - About 1 hr to fix

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

                              protected function _processTree($parent)
                              {
                                  foreach ($parent->tree as $node) {
                                      if ($node->processable && $node->type === 'class' && $node->extends) {
                                          $namespace = $node->namespace->name . '\\';
                          Severity: Minor
                          Found in src/Jit/Patcher/Layer.php - About 1 hr to fix

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

                                public function matchArgs($args)
                                {
                                    if ($this->_args === null || $args === null) {
                                        return true;
                                    }
                            Severity: Minor
                            Found in src/Plugin/Call/Message.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"

                            Further reading

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

                                protected function _processTree($parent)
                                {
                                    foreach ($parent->tree as $node) {
                                        if ($node->processable && $node->type === 'class' && $node->extends) {
                                            $namespace = $node->namespace->name . '\\';
                            Severity: Minor
                            Found in src/Jit/Patcher/Layer.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"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language