YetiForceCompany/YetiForceCRM

View on GitHub
app/TextParser/ProductsTableRelatedModule.php

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function process has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $html = '';
        [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
        $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];
Severity: Minor
Found in app/TextParser/ProductsTableRelatedModule.php - About 1 day 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

Method process has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process()
    {
        $html = '';
        [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
        $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];
Severity: Major
Found in app/TextParser/ProductsTableRelatedModule.php - About 2 hrs to fix

    The method process() has an NPath complexity of 1084. The configured NPath complexity threshold is 200.
    Open

        public function process()
        {
            $html = '';
            [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
            $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];

    NPathComplexity

    Since: 0.1

    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

    Example

    class Foo {
        function bar() {
            // lots of complicated code
        }
    }

    Source https://phpmd.org/rules/codesize.html#npathcomplexity

    The method process() has a Cyclomatic Complexity of 23. The configured cyclomatic complexity threshold is 10.
    Open

        public function process()
        {
            $html = '';
            [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
            $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

    Refactor this function to reduce its Cognitive Complexity from 64 to the 15 allowed.
    Open

        public function process()

    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

    See

    Avoid using static access to class '\App\Record' in method 'process'.
    Open

            if (!empty($relatedModuleRecordId) && \App\Record::isExists($relatedModuleRecordId, $relatedModuleName)) {

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\CurrencyField' in method 'process'.
    Open

                            $html .= \CurrencyField::convertToUserFormat($sum, null, true);

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid assigning values to variables in if clauses and the like (line '76', column '45').
    Open

        public function process()
        {
            $html = '';
            [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
            $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid using static access to class '\Vtiger_Inventory_Model' in method 'process'.
    Open

                $inventory = \Vtiger_Inventory_Model::getInstance($relatedModuleName);

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    The method process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                                } else {
                                    $fieldValue = $fieldModel->getDisplayValue($itemValue, $inventoryRow);
                                }

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid using static access to class '\Vtiger_Record_Model' in method 'process'.
    Open

                $relatedModuleRecordModel = \Vtiger_Record_Model::getInstanceById($relatedModuleRecordId, $relatedModuleName);

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid assigning values to variables in if clauses and the like (line '76', column '104').
    Open

        public function process()
        {
            $html = '';
            [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
            $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                    $html .= "<th style=\"{$headerStyle}text-align:center;\">" . \App\Language::translate($fieldModel->get('label'), $this->textParser->moduleName) . '</th>';

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    The method process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                            } else {
                                $itemValue = $inventoryRow[$columnName];
                                if ('Name' === $typeName) {
                                    $fieldValue = '<strong>' . $fieldModel->getDisplayValue($itemValue, $inventoryRow) . '</strong>';
                                    foreach ($inventory->getFieldsByType('Comment') as $commentField) {

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid assigning values to variables in if clauses and the like (line '50', column '11').
    Open

        public function process()
        {
            $html = '';
            [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
            $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Reference to instance property recordModel from undeclared class \App\TextParser
    Open

            $relatedModuleRecordId = $this->textParser->recordModel->get($relatedModuleField);

    Call to deprecated function \CurrencyField::convertToUserFormat() defined at /code/include/fields/CurrencyField.php:144
    Open

                            $html .= \CurrencyField::convertToUserFormat($sum, null, true);

    Argument 2 (module) is null but \Vtiger_Record_Model::getInstanceById() takes string defined at /code/modules/Vtiger/models/Record.php:763
    Open

                $relatedModuleRecordModel = \Vtiger_Record_Model::getInstanceById($relatedModuleRecordId, $relatedModuleName);

    Argument 1 (moduleName) is null but \Vtiger_Inventory_Model::getInstance() takes string defined at /code/modules/Vtiger/models/Inventory.php:50
    Open

                $inventory = \Vtiger_Inventory_Model::getInstance($relatedModuleName);

    Reference to instance property moduleName from undeclared class \App\TextParser
    Open

                    $html .= "<th style=\"{$headerStyle}text-align:center;\">" . \App\Language::translate($fieldModel->get('label'), $this->textParser->moduleName) . '</th>';

    Argument 2 (moduleName) is null but \App\Record::isExists() takes false|string defined at /code/app/Record.php:266
    Open

            if (!empty($relatedModuleRecordId) && \App\Record::isExists($relatedModuleRecordId, $relatedModuleName)) {

    Argument 2 (user) is null but \CurrencyField::convertToUserFormat() takes \App\User defined at /code/include/fields/CurrencyField.php:144
    Open

                            $html .= \CurrencyField::convertToUserFormat($sum, null, true);

    Avoid excessively long variable names like $relatedModuleRecordId. Keep variable name length under 20.
    Open

            $relatedModuleRecordId = $this->textParser->recordModel->get($relatedModuleField);

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#longvariable

    Avoid excessively long variable names like $relatedModuleRecordModel. Keep variable name length under 20.
    Open

                $relatedModuleRecordModel = \Vtiger_Record_Model::getInstanceById($relatedModuleRecordId, $relatedModuleName);

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#longvariable

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Example: $(custom : ProductsTableRelatedModule|FInvoiceProforma|finvoiceproformaid|seq,name,qty,discount,currency,discountmode,taxmode,price,gross,net,tax,total)$

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function process()

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var mixed Parser type */

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public $default = '$(custom : ProductsTableRelatedModule|__MODULE_NAME__|__RELATION_FIELD_NAME__|__INVENTORY_FIELDS__)$';

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $html = '';

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public $type = 'pdf';

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return string

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {

    Line exceeds 120 characters; contains 193 characters
    Open

            $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $relatedModuleRecordId = $this->textParser->recordModel->get($relatedModuleField);

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        continue;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        foreach ($groupModels as $fieldModel) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            $columnName = $fieldModel->getColumnName();

    Line exceeds 120 characters; contains 122 characters
    Open

                        $html .= "<th class=\"col-type-{$fieldModel->getType()}\" style=\"{$headerStyle}text-align:right;\">";

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            }

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }

    Line exceeds 120 characters; contains 233 characters
    Open

                                $html .= "<td class=\"col-type-barcode\" style=\"{$fieldStyle}font-weight:bold;text-align:center;\"><div data-barcode=\"EAN13\" data-code=\"{$code}\" data-size=\"1\" data-height=\"16\">{$code}</div></td>";

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                    $fieldStyle = $bodyStyle . 'text-align:right;';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            $html .= \CurrencyField::convertToUserFormat($sum, null, true);

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public $name = 'LBL_PRODUCTS_TABLE_RELATED_MODULE';

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var string Default template

    Line exceeds 120 characters; contains 125 characters
    Open

        public $default = '$(custom : ProductsTableRelatedModule|__MODULE_NAME__|__RELATION_FIELD_NAME__|__INVENTORY_FIELDS__)$';

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var string Class name */

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $inventory = \Vtiger_Inventory_Model::getInstance($relatedModuleName);

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $html .= '<tr class="row-' . $counter . '">';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            if ('ItemNumber' === $typeName) {

    Line exceeds 120 characters; contains 168 characters
    Open

                                } elseif (\in_array($typeName, ['TotalPrice', 'Tax', 'MarginP', 'Margin', 'Purchase', 'Discount', 'NetPrice', 'GrossPrice', 'UnitPrice'])) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $html .= "<th class=\"col-type-{$fieldModel->getType()}\" style=\"{$headerStyle}text-align:right;\">";

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $html;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (!$relatedModuleRecordModel->getModule()->isInventory() || empty($fieldsToShow)) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    return $html;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                    $fieldValue = '<strong>' . $fieldModel->getDisplayValue($itemValue, $inventoryRow) . '</strong>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $html .= '</tr>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

            [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $relatedModuleRecordModel = \Vtiger_Record_Model::getInstanceById($relatedModuleRecordId, $relatedModuleName);

    Line exceeds 120 characters; contains 125 characters
    Open

                $html .= '<table class="products-table-related-module" style="width:100%;border-collapse:collapse;"><thead><tr>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Process.

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $html .= '</tr></thead>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                        if ($commentField->isVisible() && ($value = $inventoryRow[$commentField->getColumnName()]) && $comment = $commentField->getDisplayValue($value, $inventoryRow)) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                            $fieldValue .= '<br />' . $comment;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $html .= '</tr></tfoot></table>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $groupModels = [];

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    foreach ($inventoryRows as $inventoryRow) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            } else {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $bodyStyle = 'font-size:8px;border:1px solid #ddd;padding:0px 4px;';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if (!($fieldModel = $inventory->getField($fieldName)) || !$fieldModel->isVisible()) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            $typeName = $fieldModel->getType();

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        if ($fieldModel->isSummary()) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            $sum = 0;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $inventoryRows = $relatedModuleRecordModel->getInventoryData();

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $html .= '<table class="products-table-related-module" style="width:100%;border-collapse:collapse;"><thead><tr>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                foreach ($fieldsToShow as $fieldName) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                $itemValue = $inventoryRow[$columnName];

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                    foreach ($inventory->getFieldsByType('Comment') as $commentField) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                        }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                    $fieldValue = $fieldModel->getDisplayValue($itemValue, $inventoryRow);

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $groupModels[$fieldName] = $fieldModel;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $html .= '<tbody>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $counter = 1;

    Line exceeds 120 characters; contains 129 characters
    Open

                                    $fieldValue = '<strong>' . $fieldModel->getDisplayValue($itemValue, $inventoryRow) . '</strong>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                } elseif (\in_array($typeName, ['TotalPrice', 'Tax', 'MarginP', 'Margin', 'Purchase', 'Discount', 'NetPrice', 'GrossPrice', 'UnitPrice'])) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                } else {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $html .= '</tbody><tfoot><tr>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $html .= "<th style=\"{$headerStyle}text-align:center;\">" . \App\Language::translate($fieldModel->get('label'), $this->textParser->moduleName) . '</th>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            } elseif ('ean' === $columnName) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                if ('Name' === $typeName) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                    $fieldValue = $fieldModel->getDisplayValue($itemValue, $inventoryRow);

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!empty($relatedModuleRecordId) && \App\Record::isExists($relatedModuleRecordId, $relatedModuleName)) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $headerStyle = 'font-size:9px;padding:0px 4px;';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            $fieldStyle = $bodyStyle;

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                $code = $inventoryRow[$columnName];

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                $html .= "<td class=\"col-type-{$typeName}\" style=\"{$fieldStyle}\">{$fieldValue}</td>";

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    foreach ($groupModels as $fieldModel) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            foreach ($inventoryRows as $inventoryRow) {

    Line exceeds 120 characters; contains 122 characters
    Open

                $relatedModuleRecordModel = \Vtiger_Record_Model::getInstanceById($relatedModuleRecordId, $relatedModuleName);

    Line exceeds 120 characters; contains 170 characters
    Open

                    $html .= "<th style=\"{$headerStyle}text-align:center;\">" . \App\Language::translate($fieldModel->get('label'), $this->textParser->moduleName) . '</th>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (!empty($groupModels)) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                $html .= "<td class=\"col-type-ItemNumber\" style=\"{$fieldStyle}font-weight:bold;text-align:center;\">" . $counter++ . '</td>';

    Line exceeds 120 characters; contains 156 characters
    Open

                                $html .= "<td class=\"col-type-ItemNumber\" style=\"{$fieldStyle}font-weight:bold;text-align:center;\">" . $counter++ . '</td>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                $html .= "<td class=\"col-type-barcode\" style=\"{$fieldStyle}font-weight:bold;text-align:center;\"><div data-barcode=\"EAN13\" data-code=\"{$code}\" data-size=\"1\" data-height=\"16\">{$code}</div></td>";

    Line exceeds 120 characters; contains 197 characters
    Open

                                        if ($commentField->isVisible() && ($value = $inventoryRow[$commentField->getColumnName()]) && $comment = $commentField->getDisplayValue($value, $inventoryRow)) {

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                    }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                                $sum += $inventoryRow[$fieldModel->getColumnName()];

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $html .= '</th>';

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }

    There are no issues that match your filters.

    Category
    Status