Showing 155 of 15,735 total issues
Method getOuterHeight
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOuterHeight()
{
$box = $this->getBox();
if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
return '0';
Function loadFontData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function loadFontData()
{
$fileName = $this->getFontFileName();
$fileContent = file_get_contents($fileName);
$font = \FontLib\Font::load($fileName);
- 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 replacePageNumbers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function replacePageNumbers()
{
$allChildren = [];
$this->getAllChildren($allChildren);
foreach ($allChildren as $child) {
- 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 parseImage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseImage(array $rulesParsed)
{
if ($element = $this->getElement()) {
if (($domElement = $element->getDOMElement()) && isset($domElement->tagName)) {
if ('img' === $domElement->tagName && $domElement->getAttribute('src')) {
- 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 parseFont
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseFont(array $rulesParsed)
{
$finalRules = [];
foreach ($rulesParsed as $ruleName => $ruleValue) {
if ('font' === substr($ruleName, 0, 4)) {
- 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 getStyleHeight
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getStyleHeight()
{
if (!$this->getBox()->isForMeasurement()) {
return '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 getBoxesByType
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getBoxesByType(string $shortClassName, string $until = '')
{
$boxes = [];
$untilWas = 0;
$allChildren = [];
- 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 parseInline
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function parseInline()
{
$parsed = array_merge($this->getMandatoryRules(), $this->getDefaultRules());
if ($this->content) {
$rules = explode(';', $this->content);
- 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 setRenderable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setRenderable(bool $renderable = true, bool $forceUpdate = false)
{
$changed = $this->renderable !== $renderable;
if (!$this->renderable && $renderable) {
$this->restoreRenderableState();
- 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 hideEmptyLines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function hideEmptyLines()
{
foreach ($this->getChildren() as $child) {
if ($child instanceof LineBox) {
if ($child->isEmpty() && !$child->getStyle()->haveSpacing()) {
- 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 getFontFileName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getFontFileName()
{
if (isset(static::$fontFiles[$this->family])) {
$match = $this->matchFont();
if (file_exists($this->fontDir . $match)) {
- 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 normalize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function normalize($ruleValue, string $ruleName = ''): array
{
if (null !== $this->normalized) {
return $this->normalized;
}
- 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 addBorderInstructions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addBorderInstructions(array $element, string $pdfX, string $pdfY, string $width, string $height)
Method addBackgroundImageInstructions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addBackgroundImageInstructions(array $element, $pdfX, $pdfY, $width, $height)
Method addBackgroundColorInstructions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addBackgroundColorInstructions(array $element, $pdfX, $pdfY, $width, $height)
Method addBackgroundColorInstructions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addBackgroundColorInstructions(array $element, $pdfX, $pdfY, $width, $height)
Method appendTableRowGroupBox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function appendTableRowGroupBox($childDomElement, $element, $style, $parentBlock, string $display)
Function getMinWidth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getMinWidth()
{
$box = $this->getBox();
if (!$box->isForMeasurement()) {
return '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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function render(): string
{
if ($this->title) {
$this->addValue('Title', $this->document->filterText($this->title, 'UTF-16', true, 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
Function loadFromArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function loadFromArray(array $decoded)
{
if (!\is_array($decoded)) {
throw new \ErrorException('Invalid fonts json structure.');
}
- 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"