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()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method 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()) {
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()) {
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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()) {
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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 {
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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',
]]);
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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:
- Read upRead up
- Exclude checks
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],
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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());
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
- Exclude checks
Argument 1 (value)
is int
but \App\Pauser::setValue()
takes string
defined at /code/app/Pauser.php:77
Open
$pauser->setValue($lastId);
- Exclude checks
Returning type float
but convertDiscount()
is declared to return int
Open
return -((float) $value);
- Exclude checks
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()) {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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 {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid variables with short names like $i. Configured minimum length is 3. Open
$lastId = $s = $e = $i = $u = 0;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastId = $s = $e = $i = $u = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($this->importRecord()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'NIP' => 'vat_id',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'REGON' => 'registration_number_2',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ADRES_EMAIL' => 'email1',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($rows as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SYM_KRAJU' => ['fieldName' => 'addresslevel1a', 'fn' => 'convertCountry'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($val = $pauser->getValue()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const NAME = 'LBL_ACCOUNTS';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const SEQUENCE = 2;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ULICA_LOKAL' => 'addresslevel8a',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'KOD_POCZTOWY_KOR' => 'addresslevel7b',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'NAZWA' => ['fieldName' => 'accountname', 'fn' => 'decode'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'WOJEWODZTWO' => 'addresslevel2a',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'KOD_POCZTOWY' => 'addresslevel7a',
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'MIEJSCOWOSC_KOR' => 'addresslevel5b',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->skip = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'DOMYSLNY_RABAT' => ['fieldName' => 'discount', 'fn' => 'convertDiscount'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SYM_KRAJU_KOR' => ['fieldName' => 'addresslevel1b', 'fn' => 'convertCountry'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pauser = \App\Pauser::getInstance('WaproAccountLastId');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->row = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $i + $u;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($id = $this->findInMapTable($this->waproId, 'KONTRAHENT')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->logError($th);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->setDataForSave([\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getCounter(): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'UWAGI' => 'description',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pauser->setValue($lastId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$u;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->recordModel->getPreviousValue() ? 1 : 3;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $value
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function convertDiscount(string $value, array $params): float
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'MIEJSCOWOSC' => 'addresslevel5a',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $fieldMap = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query->where(['>', 'ID_KONTRAHENTA', $val]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'POWIAT' => 'addresslevel3a',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->waproId = $row['ID_KONTRAHENTA'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 1:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$i;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastId = $this->waproId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->log("Create {$i} | Update {$u} | Skipped {$s} | Error {$e}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('WaproMapTable', "{$this->waproId}|KONTRAHENT", $this->recordModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 2;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ADRES_WWW' => 'website',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'POWIAT_KOR' => 'addresslevel3b',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ULICA_LOKAL_KOR' => 'addresslevel8b',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastId = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$s;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'TELEFON_FIRMOWY' => ['fieldName' => 'phone', 'fn' => 'convertPhone'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'WOJEWODZTWO_KOR' => 'addresslevel2b',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($query->batch(100, $this->controller->getDb()) as $rows) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function importRecord(): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel = \Vtiger_Record_Model::getCleanInstance('Accounts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 0:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Accounts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return -((float) $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->controller->cron && $this->controller->cron->checkTimeout()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'wtable' => 'KONTRAHENT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Convert discount to system format.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pauser->destroy();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set('wapro_id', $this->waproId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 2:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Throwable $th) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->skip) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$e;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (new \App\Db\Query())->from('dbo.KONTRAHENT')->count('*', $this->controller->getDb());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->loadFromFieldMap();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $params
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 == $lastId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks