Function displayShapeInfo
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
protected function displayShapeInfo(AbstractShape $oShape): void
{
$this->append('<div class="infoBlk" id="div' . $oShape->getHashCode() . 'Info">');
$this->append('<dl>');
$this->append('<dt>HashCode</dt><dd>' . $oShape->getHashCode() . '</dd>');
- 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
File Sample_Header.php
has 449 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Header file.
*/
use PhpOffice\PhpPresentation\AbstractShape;
Method displayShapeInfo
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function displayShapeInfo(AbstractShape $oShape): void
{
$this->append('<div class="infoBlk" id="div' . $oShape->getHashCode() . 'Info">');
$this->append('<dl>');
$this->append('<dt>HashCode</dt><dd>' . $oShape->getHashCode() . '</dd>');
Function displayPhpPresentationInfo
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt): void
{
$this->append('<div class="infoBlk" id="divPhpPresentationInfo">');
$this->append('<dl>');
$this->append('<dt>Number of slides</dt><dd>' . $oPHPPpt->getSlideCount() . '</dd>');
- 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 displayPhpPresentationInfo
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt): void
{
$this->append('<div class="infoBlk" id="divPhpPresentationInfo">');
$this->append('<dl>');
$this->append('<dt>Number of slides</dt><dd>' . $oPHPPpt->getSlideCount() . '</dd>');
Function getEndingNotes
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function getEndingNotes($writers)
{
$result = '';
// Do not show execution time for index
- 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 displayPhpPresentation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function displayPhpPresentation(PhpPresentation $oPHPPpt): void
{
$this->append('<li><span><i class="fa fa-folder-open"></i> PhpPresentation</span>');
$this->append('<ul>');
$this->append('<li><span class="shape" id="divPhpPresentation"><i class="fa fa-info-circle"></i> Info "PhpPresentation"</span></li>');
- 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 getConstantName
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getConstantName($class, $search, $startWith = '')
{
$fooClass = new ReflectionClass($class);
$constants = $fooClass->getConstants();
$constName = null;
- 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 displayShape
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function displayShape(AbstractShape $shape): void
{
if ($shape instanceof Drawing\Gd) {
$this->append('<li><span class="shape" id="div' . $shape->getHashCode() . '">Shape "Drawing\Gd"</span></li>');
} elseif ($shape instanceof Drawing\File) {
- 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"