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();
- Read upRead up
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);
Function pruneAndMerge
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function pruneAndMerge()
{
$this->prune();
do {
- Read upRead up
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();
- Read upRead up
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');
- Read upRead up
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();
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) {
- Read upRead up
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;
- Read upRead up
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');
Method consumeBlockComments
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function consumeBlockComments(ReaderInterface $reader)
{
// $this->debug('consumeBlockComments');
$nextChar = $reader->currentChar();
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) {
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);
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());
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;
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(
Method testGetNextChar
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetNextChar()
{
$curLine = 1;
$curCol = 1;
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);
- Read upRead up
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;
- Read upRead up
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()) {
- Read upRead up
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();
- Read upRead up
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"