sixty-nine/ClassGrapher

View on GitHub

Showing 44 of 46 total issues

Method build has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function build($dir, $sortClasses = false, $sortNs = false, $sortMethods = false, $noParents = false, $noMethods = false, $noNs = false)
Severity: Major
Found in src/SixtyNine/ClassGrapher/Dump/DumpBuilder.php - About 50 mins to fix

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

        protected function parseInterface()
        {
            $extends = array();
            $token = $this->tokenizer->expectToken(T_INTERFACE, false, true);
            $name = $this->classResolver->resolve($this->parseIdentifier());
    Severity: Minor
    Found in src/SixtyNine/ClassGrapher/Parser/Parser.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 getAugmentedGrammar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getAugmentedGrammar()
        {
            if (!$this->isAugmentedGrammar()) {
                if ($this->axiom) {
                    $axiom = new Rule(new NonTerminalSymbol('axiom'), array($this->axiom->getLeftHand()), true);
    Severity: Minor
    Found in src/SixtyNine/PhpParse/Grammar/Grammar.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 scan has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function scan(ReaderInterface $reader)
        {
            $this->debugSection("SCANNER CYCLE");
    
            $this->resetQueue();
    Severity: Minor
    Found in src/SixtyNine/PhpParse/Scanner/GenericScanner.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 scan has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function scan(ReaderInterface $reader)
        {
            $tokens = array();
            $curLine = 0;
    
    
    Severity: Minor
    Found in src/SixtyNine/PhpParse/Scanner/PhpScanner.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 resolve has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function resolve($name)
        {
            $search = $name;
            if (($pos = strpos($name, '\\')) !== false) {
                $search = substr($name, 0, $pos);
    Severity: Minor
    Found in src/SixtyNine/ClassGrapher/Parser/ClassResolver.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 expectToken has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function expectToken($data, $optional = false, $compareType = false)
        {
            if (!$optional) {
                $token = $this->getToken();
    
    
    Severity: Minor
    Found in src/SixtyNine/ClassGrapher/Parser/Tokenizer.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 dump has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function dump($compact = false, $level = 0)
        {
            $dump = '';
            $indent = str_repeat('  ', $level);
            $dump .= sprintf("%sNODE[%s]%s\n", $indent, $this->type, !empty($this->properties) || !empty($this->children) ? ':' : '');
    Severity: Minor
    Found in src/SixtyNine/PhpParse/Parser/SyntaxTreeNode.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 find has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function find($dirName, $pattern = '*.php', $excludeDirs = array())
        {
            if (!is_dir($dirName)) {
                throw new \InvalidArgumentException("Invalid directory '$dirName'");
            }
    Severity: Minor
    Found in src/SixtyNine/ClassGrapher/Helper/FileFinder.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

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function __construct($file = '', $line = 0, $name = '', $extends = array(), $methods = array())
    Severity: Minor
    Found in src/SixtyNine/ClassGrapher/Model/InterfaceItem.php - About 35 mins to fix

      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct($file = '', $line = 0, $name = '', $extends = '', $implements = array())
      Severity: Minor
      Found in src/SixtyNine/ClassGrapher/Model/ClassItem.php - About 35 mins to fix

        Method addClass has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function addClass($file, $line, $name, $extends = array(), $implements = array())
        Severity: Minor
        Found in src/SixtyNine/ClassGrapher/Model/ObjectTableBuilder.php - About 35 mins to fix

          Function peekToken has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function peekToken()
              {
                  if ($this->isEof()) {
                      return false;
                  }
          Severity: Minor
          Found in src/SixtyNine/ClassGrapher/Parser/Tokenizer.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 testGetNextChar has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function testGetNextChar()
              {
                  $curLine = 1;
                  $curCol = 1;
          
          
          Severity: Minor
          Found in src/SixtyNine/PhpParse/Tests/Reader/FileReaderTest.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 parseUse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function parseUse()
              {
                  $this->tokenizer->expectToken(T_USE, false, true);
          
                  while (true) {
          Severity: Minor
          Found in src/SixtyNine/ClassGrapher/Parser/Parser.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

          Avoid too many return statements within this method.
          Open

                      case self::TK_SYMBOL: return 'Symbol';
          Severity: Major
          Found in src/SixtyNine/PhpParse/Scanner/GenericToken.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        case self::TK_IDENTIFIER: return 'Identifier';
            Severity: Major
            Found in src/SixtyNine/PhpParse/Scanner/GenericToken.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $name;
              Severity: Major
              Found in src/SixtyNine/ClassGrapher/Parser/ClassResolver.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $this->curNamespace . '\\' . $name;
                Severity: Major
                Found in src/SixtyNine/ClassGrapher/Parser/ClassResolver.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return 'Unknown';
                  Severity: Major
                  Found in src/SixtyNine/PhpParse/Scanner/GenericToken.php - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language