sixty-nine/ClassGrapher

View on GitHub

Showing 46 of 46 total issues

Function consumeBlockComments has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    protected function consumeBlockComments(ReaderInterface $reader)
    {
//        $this->debug('consumeBlockComments');

        $nextChar = $reader->currentChar();
Severity: Minor
Found in src/SixtyNine/PhpParse/Scanner/GenericScanner.php - About 5 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 test__construct has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function test__construct()
    {
        $buffer = "Some random\nstring";
        $reader = new BufferReader($buffer);

Severity: Major
Found in src/SixtyNine/PhpParse/Tests/Reader/BufferReaderTest.php - About 2 hrs to fix

    Function pruneAndMerge has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public function pruneAndMerge()
        {
            $this->prune();
    
            do {
    Severity: Minor
    Found in src/SixtyNine/ClassGrapher/Helper/NamespaceTree.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 consumeLineComments has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function consumeLineComments(ReaderInterface $reader)
        {
    //        $this->debug('consumeLineComments');
    
            $nextChar = $reader->currentChar();
    Severity: Minor
    Found in src/SixtyNine/PhpParse/Scanner/GenericScanner.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 execute has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $file = $input->getArgument('path');
            $outputDir = $input->getArgument('output-dir');
            $phpdoc = $input->getOption('phpdoc');
    Severity: Minor
    Found in src/SixtyNine/AutoTest/Command/AutoTestCommand.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 testBuild has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function testBuild()
        {
            $ns = 'SixtyNine\\ClassGrapher\\Tests\\Fixtures\\';
    
            $builder = new ObjectTableBuilder();
    Severity: Minor
    Found in src/SixtyNine/ClassGrapher/Tests/Model/ObjectTableBuilderTest.php - About 1 hr to fix

      Function render has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function render(ObjectTable $table, $phpdoc = false, $methodStub = false, $ignoreMagic = true)
          {
              $result = array();
      
              foreach ($table as $class) {
      Severity: Minor
      Found in src/SixtyNine/AutoTest/Helper/AutoTestRenderer.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 removeOrphans has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function removeOrphans()
          {
              foreach ($this->graph->getNodes() as $key => $data) {
      
                  $isOrphan = true;
      Severity: Minor
      Found in src/SixtyNine/ClassGrapher/Graph/GraphBuilder.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 execute has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $file = $input->getArgument('path');
              $outputDir = $input->getArgument('output-dir');
              $phpdoc = $input->getOption('phpdoc');
      Severity: Minor
      Found in src/SixtyNine/AutoTest/Command/AutoTestCommand.php - About 1 hr to fix

        Method consumeBlockComments has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function consumeBlockComments(ReaderInterface $reader)
            {
        //        $this->debug('consumeBlockComments');
        
                $nextChar = $reader->currentChar();
        Severity: Minor
        Found in src/SixtyNine/PhpParse/Scanner/GenericScanner.php - About 1 hr to fix

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

              public function render(ObjectTable $table, $phpdoc = false, $methodStub = false, $ignoreMagic = true)
              {
                  $result = array();
          
                  foreach ($table as $class) {
          Severity: Minor
          Found in src/SixtyNine/AutoTest/Helper/AutoTestRenderer.php - About 1 hr to fix

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

                public function build($dir, $sortClasses = false, $sortNs = false, $sortMethods = false, $noParents = false, $noMethods = false, $noNs = false)
                {
                    $otBuilder = new ObjectTableBuilder();
                    $table = $otBuilder->build($dir);
            
            
            Severity: Minor
            Found in src/SixtyNine/ClassGrapher/Dump/DumpBuilder.php - About 1 hr to fix

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

                  public function testParent()
                  {
                      $ns = new _Namespace('NS1\\NS2\\NS3\\NS4');
              
                      $this->assertEquals('NS4', $ns->getBaseName());
              Severity: Minor
              Found in src/SixtyNine/ClassGrapher/Tests/Helper/NamespaceTest.php - About 1 hr to fix

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

                    public function build(ObjectTable $table, $removeOrphans = false)
                    {
                        $this->nodes = array();
                        $this->counter = 0;
                        $this->clusterCounter = 0;
                Severity: Minor
                Found in src/SixtyNine/ClassGrapher/Graph/GraphBuilder.php - About 1 hr to fix

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

                      public function testParse()
                      {
                          $file = __DIR__ . '/../Fixtures/Classes.php';
                          $ns = 'SixtyNine\\ClassGrapher\\Tests\\Fixtures\\';
                          $expected = array(
                  Severity: Minor
                  Found in src/SixtyNine/ClassGrapher/Tests/Parser/ParserTest.php - About 1 hr to fix

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

                        public function testGetNextChar()
                        {
                            $curLine = 1;
                            $curCol = 1;
                    
                    
                    Severity: Minor
                    Found in src/SixtyNine/PhpParse/Tests/Reader/FileReaderTest.php - About 1 hr to fix

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

                          public function build($dir, $sortClasses = false, $sortNs = false, $sortMethods = false, $noParents = false, $noMethods = false, $noNs = false)
                          {
                              $otBuilder = new ObjectTableBuilder();
                              $table = $otBuilder->build($dir);
                      
                      
                      Severity: Minor
                      Found in src/SixtyNine/ClassGrapher/Dump/DumpBuilder.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 build has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function build(ObjectTable $table, $removeOrphans = false)
                          {
                              $this->nodes = array();
                              $this->counter = 0;
                              $this->clusterCounter = 0;
                      Severity: Minor
                      Found in src/SixtyNine/ClassGrapher/Graph/GraphBuilder.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 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function parse()
                          {
                              while (!$this->tokenizer->isEof()) {
                                  if ($token = $this->tokenizer->peekToken()) {
                      
                      
                      Severity: Minor
                      Found in src/SixtyNine/ClassGrapher/Parser/Parser.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 parseClass has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function parseClass()
                          {
                              $extends = array();
                              $implements = array();
                      
                      
                      Severity: Minor
                      Found in src/SixtyNine/ClassGrapher/Parser/Parser.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