YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/Wapro/Synchronizer/Accounts.php

Summary

Maintainability
D
2 days
Test Coverage
F
0%

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

    public function process(): int
    {
        $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
        $pauser = \App\Pauser::getInstance('WaproAccountLastId');
        if ($val = $pauser->getValue()) {
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/Accounts.php - About 2 hrs 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 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(): int
    {
        $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
        $pauser = \App\Pauser::getInstance('WaproAccountLastId');
        if ($val = $pauser->getValue()) {
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/Accounts.php - About 1 hr to fix

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

        public function process(): int
        {
            $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
            $pauser = \App\Pauser::getInstance('WaproAccountLastId');
            if ($val = $pauser->getValue()) {

    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

    Missing class import via use statement (line '137', column '15').
    Open

            return (new \App\Db\Query())->from('dbo.KONTRAHENT')->count('*', $this->controller->getDb());

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '54', column '17').
    Open

            $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

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

        public function process(): int
        {
            $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
            $pauser = \App\Pauser::getInstance('WaproAccountLastId');
            if ($val = $pauser->getValue()) {

    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_Record_Model' in method 'importRecord'.
    Open

                $this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Accounts');

    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 '100', column '7').
    Open

        public function importRecord(): int
        {
            if ($id = $this->findInMapTable($this->waproId, 'KONTRAHENT')) {
                $this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Accounts');
            } else {

    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_Record_Model' in method 'importRecord'.
    Open

                $this->recordModel = \Vtiger_Record_Model::getCleanInstance('Accounts');

    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 importRecord uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $this->recordModel = \Vtiger_Record_Model::getCleanInstance('Accounts');
                $this->recordModel->setDataForSave([\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME => [
                    'wtable' => 'KONTRAHENT',
                ]]);

    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 '\App\Cache' in method 'importRecord'.
    Open

            \App\Cache::save('WaproMapTable', "{$this->waproId}|KONTRAHENT", $this->recordModel->getId());

    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 '\App\Pauser' in method 'process'.
    Open

            $pauser = \App\Pauser::getInstance('WaproAccountLastId');

    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

    Move this "case default" clause to the end of this "switch" statement.
    Open

                            default:

    The requirement for a final case default clause is defensive programming. The clause should either take appropriate action, or contain a suitable comment as to why no action is taken. Even when the switch covers all current values of an enum, a default case should still be used because there is no guarantee that the enum won't be extended.

    Noncompliant Code Example

    switch ($param) {  //missing default clause
      case 0:
        do_something();
        break;
      case 1:
        do_something_else();
        break;
    }
    
    switch ($param) {
      default: // default clause should be the last one
        error();
        break;
      case 0:
        do_something();
        break;
      case 1:
        do_something_else();
        break;
    }
    

    Compliant Solution

    switch ($param) {
      case 0:
        do_something();
        break;
      case 1:
        do_something_else();
        break;
      default:
        error();
        break;
    }
    

    See

    • MISRA C:2004, 15.0 - The MISRA C switch syntax shall be used.
    • MISRA C:2004, 15.3 - The final clause of a switch statement shall be the default clause
    • MISRA C++:2008, 6-4-3 - A switch statement shall be a well-formed switch statement.
    • MISRA C++:2008, 6-4-6 - The final clause of a switch statement shall be the default-clause
    • MISRA C:2012, 16.1 - All switch statements shall be well-formed
    • MISRA C:2012, 16.4 - Every switch statement shall have a default label
    • MISRA C:2012, 16.5 - A default label shall appear as either the first or the last switch label of a switch statement
    • MITRE, CWE-478 - Missing Default Case in Switch Statement
    • CERT, MSC01-C. - Strive for logical completeness
    • CERT, MSC01-CPP. - Strive for logical completeness

    Define a constant instead of duplicating this literal "fieldName" 6 times.
    Open

            'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Avoid unused parameters such as '$params'.
    Open

        protected function convertDiscount(string $value, array $params): float

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

    Call to undeclared method \App\Db\Query::from
    Open

            return (new \App\Db\Query())->from('dbo.KONTRAHENT')->count('*', $this->controller->getDb());

    Call to undeclared method \App\Db\Query::from
    Open

            $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');

    Argument 1 (value) is int but \App\Pauser::setValue() takes string defined at /code/app/Pauser.php:77
    Open

                $pauser->setValue($lastId);

    Returning type float but convertDiscount() is declared to return int
    Open

            return -((float) $value);

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function process(): int
        {
            $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
            $pauser = \App\Pauser::getInstance('WaproAccountLastId');
            if ($val = $pauser->getValue()) {
    Severity: Major
    Found in app/Integrations/Wapro/Synchronizer/Accounts.php and 1 other location - About 1 day to fix
    app/Integrations/Wapro/Synchronizer/Contacts.php on lines 40..83

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 298.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function importRecord(): int
        {
            if ($id = $this->findInMapTable($this->waproId, 'KONTRAHENT')) {
                $this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Accounts');
            } else {
    Severity: Major
    Found in app/Integrations/Wapro/Synchronizer/Accounts.php and 1 other location - About 4 hrs to fix
    app/Integrations/Wapro/Synchronizer/Contacts.php on lines 86..107

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 176.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Avoid variables with short names like $i. Configured minimum length is 3.
    Open

            $lastId = $s = $e = $i = $u = 0;

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $s. Configured minimum length is 3.
    Open

            $lastId = $s = $e = $i = $u = 0;

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $id. Configured minimum length is 3.
    Open

            if ($id = $this->findInMapTable($this->waproId, 'KONTRAHENT')) {

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $u. Configured minimum length is 3.
    Open

            $lastId = $s = $e = $i = $u = 0;

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $e. Configured minimum length is 3.
    Open

            $lastId = $s = $e = $i = $u = 0;

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

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

        /** {@inheritdoc} */

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

            }

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

            $lastId = $s = $e = $i = $u = 0;

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

                    try {

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

                        switch ($this->importRecord()) {

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

            'NIP' => 'vat_id',

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

            'REGON' => 'registration_number_2',

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

            'ADRES_EMAIL' => 'email1',

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

        /** {@inheritdoc} */

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

                foreach ($rows as $row) {

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

            'SYM_KRAJU' => ['fieldName' => 'addresslevel1a', 'fn' => 'convertCountry'],

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

            if ($val = $pauser->getValue()) {

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

        const NAME = 'LBL_ACCOUNTS';

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

        const SEQUENCE = 2;

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

            'ULICA_LOKAL' => 'addresslevel8a',

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

            'KOD_POCZTOWY_KOR' => 'addresslevel7b',

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

            'NAZWA' => ['fieldName' => 'accountname', 'fn' => 'decode'],

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

            $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');

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

            'WOJEWODZTWO' => 'addresslevel2a',

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

            'KOD_POCZTOWY' => 'addresslevel7a',

    Line exceeds 120 characters; contains 128 characters
    Open

            'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],

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

            'MIEJSCOWOSC_KOR' => 'addresslevel5b',

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

        public function process(): int

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

                    $this->skip = false;

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

            'DOMYSLNY_RABAT' => ['fieldName' => 'discount', 'fn' => 'convertDiscount'],

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

            'SYM_KRAJU_KOR' => ['fieldName' => 'addresslevel1b', 'fn' => 'convertCountry'],

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

            $pauser = \App\Pauser::getInstance('WaproAccountLastId');

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

                    $this->row = $row;

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

                                break;

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

            return $i + $u;

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

            if ($id = $this->findInMapTable($this->waproId, 'KONTRAHENT')) {

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

                                break;

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

                        $this->logError($th);

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

                $this->recordModel->setDataForSave([\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME => [

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

        public function getCounter(): int

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

        /** {@inheritdoc} */

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

            'UWAGI' => 'description',

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

                $pauser->setValue($lastId);

    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 ($id) {

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

        /** {@inheritdoc} */

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

                                ++$u;

    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

                return $this->recordModel->getPreviousValue() ? 1 : 3;

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

         * @param string $value

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

        protected function convertDiscount(string $value, array $params): float

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

            'MIEJSCOWOSC' => 'addresslevel5a',

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

        protected $fieldMap = [

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

                $query->where(['>', 'ID_KONTRAHENTA', $val]);

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

            'POWIAT' => 'addresslevel3a',

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

                    $this->waproId = $row['ID_KONTRAHENTA'];

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

        {

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

                            case 1:

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

                                ++$i;

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

                        $lastId = $this->waproId;

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

                }

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

            $this->log("Create {$i} | Update {$u} | Skipped {$s} | Error {$e}");

    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

            \App\Cache::save('WaproMapTable', "{$this->waproId}|KONTRAHENT", $this->recordModel->getId());

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

         *

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

            return 2;

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

         * @return int

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

            'ADRES_WWW' => 'website',

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

            'POWIAT_KOR' => 'addresslevel3b',

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

            'ULICA_LOKAL_KOR' => 'addresslevel8b',

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

        ];

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

                $lastId = 0;

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

                                ++$s;

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

        /** {@inheritdoc} */

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

            $this->recordModel->save();

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

        {

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

        /** {@inheritdoc} */

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

            'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],

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

            'TELEFON_FIRMOWY' => ['fieldName' => 'phone', 'fn' => 'convertPhone'],

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

            'WOJEWODZTWO_KOR' => 'addresslevel2b',

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

            foreach ($query->batch(100, $this->controller->getDb()) as $rows) {

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

        public function importRecord(): int

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

                $this->recordModel = \Vtiger_Record_Model::getCleanInstance('Accounts');

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

        }

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

                            default:

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

                            case 0:

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

                $this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Accounts');

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

                ]]);

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

            return -((float) $value);

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

                if ($this->controller->cron && $this->controller->cron->checkTimeout()) {

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

                    break;

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

            }

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

                    'wtable' => 'KONTRAHENT',

    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

         * Convert discount to system format.

    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

                                break;

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

                $pauser->destroy();

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

            $this->recordModel->set('wapro_id', $this->waproId);

    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

                            case 2:

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

                    } catch (\Throwable $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

        }

    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 ($this->skip) {

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

                        }

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

                        ++$e;

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

        }

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

            return (new \App\Db\Query())->from('dbo.KONTRAHENT')->count('*', $this->controller->getDb());

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

            $this->loadFromFieldMap();

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

         * @param array  $params

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

            if (0 == $lastId) {

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

                return 0;

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

         */

    There are no issues that match your filters.

    Category
    Status