Showing 155 of 15,735 total issues
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 groupLines
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function groupLines()
{
$lineGroups = [];
$currentGroup = 0;
foreach ($this->getChildren() 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 measureOffset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function measureOffset(bool $afterPageDividing = false)
{
$rules = $this->getStyle()->getRules();
$parent = $this->getParent();
$top = $parent->getStyle()->getOffsetTop();
- 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 attachClasses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function attachClasses()
{
if ($this->domElement instanceof \DOMElement && $this->domElement->hasAttribute('class')) {
$classNames = [];
foreach (explode(' ', $this->domElement->getAttribute('class')) as $className) {
- 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 measureWidth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
if ($this->parentWidth === $this->getParent()->getParent()->getDimensions()->getWidth()) {
return $this;
}
- 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 measureWidth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
$style = $this->getStyle();
if ($this->parentWidth === $this->getParent()->getDimensions()->getWidth() && null !== $this->getDimensions()->getWidth()) {
if (!$this->isForMeasurement()) {
- 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 iterateChildren
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function iterateChildren(callable $fn, bool $reverse = false, bool $deep = true)
{
$allChildren = [];
if ($deep) {
$this->getAllChildren($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 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"
Further reading
Function getChildrenWidth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getChildrenWidth()
{
$width = '0';
foreach ($this->getChildren() as $childBox) {
if ($childBox->isForMeasurement()) {
- 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 div
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function div(string ...$numbers)
{
if (!isset($numbers[2])) {
if ((float) $numbers[0] !== (float) 0 && (float) $numbers[1] !== (float) 0) {
return bcdiv($numbers[0], $numbers[1], static::$scale);
- 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
Avoid too many return
statements within this method. Open
return $this->getBox()->getChildrenWidth();
Avoid too many return
statements within this method. Open
return Math::mul($this->getFont()->getSize()->getConverted(), $size);
Avoid too many return
statements within this method. Open
return Math::add($this->getHeight(), $style->getHorizontalMarginsWidth());
Avoid too many return
statements within this method. Open
return $size . '%'; // percent values are calculated later
Avoid too many return
statements within this method. Open
return Math::mul($font->getSize()->getConverted(), $size);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $this->finish();
Avoid too many return
statements within this method. Open
return static::$customFontFiles[$this->family][$weight][$style];
Avoid too many return
statements within this method. Open
return $this->fontDir . static::$fontFiles[static::$defaultFontFamily][$this->weight][$this->style];