YetiForceCompany/YetiForcePDF

View on GitHub

Showing 155 of 15,735 total issues

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

    public function appendBarcode($childDomElement, $element, $style, $parentBlock)
    {
        $box = (new BarcodeBox())
            ->setDocument($this->document)
            ->setElement($element)
Severity: Minor
Found in lib/Layout/LineBox.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 containContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function containContent()
    {
        if ($this instanceof TextBox && '' === trim($this->getTextContent())) {
            return false;
        }
Severity: Minor
Found in lib/Layout/Box.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 getRules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRules(string $ruleName = null)
    {
        if ($ruleName) {
            if (isset($this->rules[$ruleName])) {
                if (\is_array($this->rules[$ruleName])) {
Severity: Minor
Found in lib/Style/Style.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 getNumberValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNumberValues($ruleValue, bool $isFont = false)
    {
        if ($ruleValue instanceof NumericValue) {
            return $ruleValue;
        }
Severity: Minor
Found in lib/Style/Normalizer/Normalizer.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 getAllFontInstances has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAllFontInstances()
    {
        $instances = [];
        foreach ($this->fontInstances as $weights) {
            foreach ($weights as $styles) {
Severity: Minor
Found in lib/Document.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 getRows has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRows()
    {
        $rows = [];
        foreach ($this->getChildren() as $rowGroup) {
            if ($rowGroup instanceof TableRowGroupBox) {
Severity: Minor
Found in lib/Layout/TableBox.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 measureWidth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function measureWidth(bool $afterPageDividing = false)
    {
        $style = $this->getStyle();
        if ('auto' === $style->getRules('width')) {
            $img = $style->getBackgroundImageStream();
Severity: Minor
Found in lib/Layout/ImageBox.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 applyBorderSpacing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function applyBorderSpacing($rulesParsed)
    {
        if ($this->getElement()) {
            if ($this->box instanceof TableCellBox) {
                $tableWrapperStyle = $this->getParent();
Severity: Minor
Found in lib/Style/Style.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 setUpAbsoluteBoxes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setUpAbsoluteBoxes()
    {
        $this->document->setCurrentPage($this);
        $this->getBox()->getOffset()->setLeft('0');
        $this->getBox()->getOffset()->setTop('0');
Severity: Minor
Found in lib/Page.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 getInnerHeight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getInnerHeight(): string
    {
        $box = $this->getBox();
        if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
            return '0';
Severity: Minor
Found in lib/Layout/Dimensions/BoxDimensions.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 toRGBA has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function toRGBA($colorInput, bool $inPDFColorSpace = false): array
    {
        $colorInput = trim(strtolower($colorInput));
        if ($colorInput) {
            if ('#' === $colorInput[0]) {
Severity: Minor
Found in lib/Style/Color.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 getPages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPages(int $groupIndex = null)
    {
        if ($groupIndex) {
            $pages = [];
            foreach ($this->pages as $page) {
Severity: Minor
Found in lib/Document.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 getMaxLineHeight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMaxLineHeight()
    {
        if ($this->maxLineHeight) {
            return $this->maxLineHeight;
        }
Severity: Minor
Found in lib/Style/Style.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 addBorderInstructions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addBorderInstructions(array $element, string $pdfX, string $pdfY, string $width, string $height)
    {
        if ('none' === $this->getStyle()->getRules('display')) {
            return $element;
        }
Severity: Minor
Found in lib/Layout/Box.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 getCells has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCells()
    {
        $cells = [];
        foreach ($this->getChildren() as $rowGroup) {
            foreach ($rowGroup->getChildren() as $row) {
Severity: Minor
Found in lib/Layout/TableBox.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