sixty-nine/ClassGrapher

View on GitHub

Showing 46 of 46 total issues

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

      Avoid too many return statements within this method.
      Open

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

        Function consumeString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

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

            protected function pruneEmptyNode($curNode)
            {
                foreach ($curNode->children as $name => $child) {
                    $this->pruneEmptyNode($child);
        
        
        Severity: Minor
        Found in src/SixtyNine/ClassGrapher/Helper/NamespaceTree.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 buildGroups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function buildGroups(NamespaceTreeItem $node, $curNamespace = '', $parentCluster = '')
            {
                foreach ($node->children as $name => $child) {
                    $nodes = array();
                    $namespace = ($curNamespace === '' ? '' : $curNamespace . '\\') . $name;
        Severity: Minor
        Found in src/SixtyNine/ClassGrapher/Graph/GraphBuilder.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