borisrepl/boris

View on GitHub

Showing 14 of 14 total issues

Function start has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function start($prompt, $historyFile)
    {
        readline_read_history($historyFile);
        
        declare (ticks = 1);
Severity: Minor
Found in lib/Boris/ReadlineClient.php - About 4 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

Function start has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function start()
    {
        $__scope = $this->_runHooks($this->_startHooks);
        extract($__scope);
        
Severity: Minor
Found in lib/Boris/EvalWorker.php - About 3 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

Function statements has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function statements($buffer)
    {
        $result = $this->_createResult($buffer);
        
        while (strlen($result->buffer) > 0) {
Severity: Minor
Found in lib/Boris/ShallowParser.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

Method start has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function start()
    {
        $__scope = $this->_runHooks($this->_startHooks);
        extract($__scope);
        
Severity: Major
Found in lib/Boris/EvalWorker.php - About 2 hrs to fix

    Method start has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function start($prompt, $historyFile)
        {
            readline_read_history($historyFile);
            
            declare (ticks = 1);
    Severity: Minor
    Found in lib/Boris/ReadlineClient.php - About 1 hr to fix

      Method version has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function version($newVersion)
      {
          $token      = get_token();
          $user       = get_user();
          $repo       = get_repo();
      Severity: Minor
      Found in release.php - About 1 hr to fix

        Method statements has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function statements($buffer)
            {
                $result = $this->_createResult($buffer);
                
                while (strlen($result->buffer) > 0) {
        Severity: Minor
        Found in lib/Boris/ShallowParser.php - About 1 hr to fix

          Method _buildAst has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _buildAst($type, $value, $seen = array())
              {
                  // FIXME: Improve this AST so it doesn't require access to dump() or colorize()
                  if ($this->_isSeen($value, $seen)) {
                      return $this->_colorize('default', '*** RECURSION ***');
          Severity: Minor
          Found in lib/Boris/ColoredInspector.php - About 1 hr to fix

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

                public function start()
                {
                    declare (ticks = 1);
                    pcntl_signal(SIGINT, SIG_IGN, true);
                    
            Severity: Minor
            Found in lib/Boris/Boris.php - About 1 hr to fix

              Function start has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function start()
                  {
                      declare (ticks = 1);
                      pcntl_signal(SIGINT, SIG_IGN, true);
                      
              Severity: Minor
              Found in lib/Boris/Boris.php - About 45 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 apply has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function apply(Boris $boris)
                  {
                      $applied = false;
              
                      foreach ($this->_searchPaths as $path) {
              Severity: Minor
              Found in lib/Boris/Config.php - About 35 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 _read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _read($socket)
                  {
                      $read   = array(
                          $socket
                      );
              Severity: Minor
              Found in lib/Boris/EvalWorker.php - About 35 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 _scanChar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _scanChar($result)
                  {
                      $chr = substr($result->buffer, 0, 1);
                      $result->stmt .= $chr;
                      $result->buffer = substr($result->buffer, 1);
              Severity: Minor
              Found in lib/Boris/ShallowParser.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 _scanWsp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _scanWsp($result)
                  {
                      if (preg_match('/^\s+/', $result->buffer, $match)) {
                          if (!empty($result->statements) && $result->stmt === '') {
                              $result->statements[] = array_pop($result->statements) . $match[0];
              Severity: Minor
              Found in lib/Boris/ShallowParser.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