YetiForceCompany/YetiForceCRM

View on GitHub
include/Webservices/Utils.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
10%

Method vtwsSaveLeadRelations has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function vtwsSaveLeadRelations($leadId, $relatedId, $setype)
    {
        $db = \App\Db::getInstance();
        $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['crmid' => $leadId])
            ->createCommand()->query();
Severity: Minor
Found in include/Webservices/Utils.php - About 1 hr to fix

    Function vtwsSaveLeadRelations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function vtwsSaveLeadRelations($leadId, $relatedId, $setype)
        {
            $db = \App\Db::getInstance();
            $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['crmid' => $leadId])
                ->createCommand()->query();
    Severity: Minor
    Found in include/Webservices/Utils.php - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid too many return statements within this method.
    Open

            return true;
    Severity: Major
    Found in include/Webservices/Utils.php - About 30 mins to fix

      Reduce the number of returns of this function 5, down to the maximum allowed 3.
      Open

          public static function vtwsSaveLeadRelations($leadId, $relatedId, $setype)
      Severity: Major
      Found in include/Webservices/Utils.php by sonar-php

      Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

      Noncompliant Code Example

      With the default threshold of 3:

      function myFunction(){ // Noncompliant as there are 4 return statements
        if (condition1) {
          return true;
        } else {
          if (condition2) {
            return false;
          } else {
            return true;
          }
        }
        return false;
      }
      

      Missing class import via use statement (line '46', column '22').
      Open

              $dataReader = (new \App\Db\Query())->select(['attachmentsid'])->from('vtiger_seattachmentsrel')->where(['crmid' => $id])->createCommand()->query();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

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

              $dataReader = (new \App\Db\Query())->select(['productid'])
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

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

              $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['relcrmid' => $leadId])
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

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

                  throw new WebServiceException('LEAD_RELATEDLIST_UPDATE_FAILED', 'Failed to move related Records');
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

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

              $dataReader = (new \App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $id])->createCommand()->query();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

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

              $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['crmid' => $leadId])
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

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

                  throw new WebServiceException('LEAD_RELATEDLIST_UPDATE_FAILED', 'Failed to move related Activities/Emails');
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 using static access to class '\App\Db' in method 'vtwsSaveLeadRelatedProducts'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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\Db' in method 'vtwsTransferRelatedRecords'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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\Db' in method 'vtwsSaveLeadRelations'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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\Db' in method 'vtwsSaveLeadRelatedCampaigns'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 'CRMEntity' in method 'vtwsTransferComments'.
      Open

                  CRMEntity::getInstance('ModComments');
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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\Module' in method 'vtwsTransferComments'.
      Open

              if (\App\Module::isModuleActive('ModComments')) {
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 'ModComments' in method 'vtwsTransferComments'.
      Open

                  ModComments::transferRecords($sourceRecordId, $destinationRecordId);
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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\Db' in method 'vtwsGetRelatedActivities'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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\User' in method 'vtwsSaveLeadRelatedProducts'.
      Open

                      'rel_created_user' => \App\User::getCurrentUserId(),
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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

      Define a constant instead of duplicating this literal "relcrmid" 4 times.
      Open

                      'relcrmid' => $row['relcrmid'],
      Severity: Critical
      Found in include/Webservices/Utils.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "parent_id" 4 times.
      Open

              $db->createCommand()->update('vtiger_outsourcedproducts', ['parent_id' => $destinationRecordId], ['parent_id' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "relatedid" 4 times.
      Open

              $db->createCommand()->update('vtiger_lettersin', ['relatedid' => $destinationRecordId], ['relatedid' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "crmid" 14 times.
      Open

              $dataReader = (new \App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $id])->createCommand()->query();
      Severity: Critical
      Found in include/Webservices/Utils.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "relmodule" 3 times.
      Open

                      'relmodule' => $row['relmodule'],
      Severity: Critical
      Found in include/Webservices/Utils.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "vtiger_crmentityrel" 4 times.
      Open

              $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['crmid' => $leadId])
      Severity: Critical
      Found in include/Webservices/Utils.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "module" 3 times.
      Open

                      'module' => $setype,
      Severity: Critical
      Found in include/Webservices/Utils.php by sonar-php

      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.

      Call to undeclared method \App\Db::createCommand
      Open

                  $resultNew = $db->createCommand()->insert('vtiger_crmentityrel', [
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

                  $resultNew = $db->createCommand()->insert('vtiger_crmentityrel', [
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

                  $resultNew = $db->createCommand()->insert('vtiger_seproductsrel', [
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
      Open

                      'rel_created_user' => \App\User::getCurrentUserId(),
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

                  $db->createCommand()->update('vtiger_activity', ['link' => $contactId], ['link' => $leadId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

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

              $dataReader = (new \App\Db\Query())->select(['productid'])
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

                  $db->createCommand()->update('vtiger_activity', ['link' => $accountId], ['link' => $leadId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

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

              $dataReader = (new \App\Db\Query())->select(['attachmentsid'])->from('vtiger_seattachmentsrel')->where(['crmid' => $id])->createCommand()->query();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

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

              $dataReader = (new \App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $id])->createCommand()->query();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

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

              $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['crmid' => $leadId])
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

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

              $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['relcrmid' => $leadId])
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $rowCount = $db->createCommand()->update('vtiger_campaign_records', [
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_ossoutsourcedservices', ['parent_id' => $destinationRecordId], ['parent_id' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_outsourcedproducts', ['parent_id' => $destinationRecordId], ['parent_id' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_lettersin', ['relatedid' => $destinationRecordId], ['relatedid' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_reservations', ['link' => $destinationRecordId], ['link' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_lettersout', ['relatedid' => $destinationRecordId], ['relatedid' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_contactdetails', ['parentid' => $destinationRecordId], ['parentid' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_ossmailview_relation', ['crmid' => $destinationRecordId], ['crmid' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_osstimecontrol', ['link' => $destinationRecordId], ['link' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('vtiger_callhistory', ['destination' => $destinationRecordId], ['destination' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $db->createCommand()->update('u_yf_squoteenquiries', ['accountid' => $destinationRecordId], ['accountid' => $sourceRecordId])->execute();
      Severity: Critical
      Found in include/Webservices/Utils.php by phan

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class WebservicesUtils

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 26 and the first side effect is on line 12.
      Open

      <?php

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

          public static function vtwsGetRelatedNotesAttachments($id, $relatedId)
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 $db. Configured minimum length is 3.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 $db. Configured minimum length is 3.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 $db. Configured minimum length is 3.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 $db. Configured minimum length is 3.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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 $db. Configured minimum length is 3.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/Utils.php by phpmd

      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

              while ($row = $dataReader->readColumn(0)) {

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

           * Function used to get the lead related Notes and Attachments with other entities Account, Contact and Potential.

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

           *

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

          public static function vtwsGetRelatedNotesAttachments($id, $relatedId)

      Line exceeds 120 characters; contains 143 characters
      Open

              $dataReader = (new \App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $id])->createCommand()->query();

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

              }

      Line exceeds 120 characters; contains 155 characters
      Open

              $dataReader = (new \App\Db\Query())->select(['attachmentsid'])->from('vtiger_seattachmentsrel')->where(['crmid' => $id])->createCommand()->query();

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

           * @param int $id        - leadid

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

              if (!$dataReader->count()) {

      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

           * @param int $relatedId -  related entity id (accountid / contactid)

      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

              $dataReader = (new \App\Db\Query())->select(['attachmentsid'])->from('vtiger_seattachmentsrel')->where(['crmid' => $id])->createCommand()->query();

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

              $dbCommand = \App\Db::getInstance()->createCommand();

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

              while ($row = $dataReader->readColumn(0)) {

      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

              $dataReader = (new \App\Db\Query())->select(['productid'])

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

              }

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

              while ($productId = $dataReader->readColumn(0)) {

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

           */

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

              $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['relcrmid' => $leadId])

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

                  return false;

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

                      'module' => $setype,

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

           * @param int                 $fieldId

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

              if (empty($leadId) || empty($relatedId) || (empty($accountId) && empty($contactId))) {

      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

              $dataReader = (new \App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $id])->createCommand()->query();

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

              if (0 === $dataReader->count()) {

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

                  if (0 === $resultNew) {

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

           * Function used to save the lead related services with other entities Account, Contact and Potential.

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

              while ($row = $dataReader->read()) {

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

                  throw new WebServiceException('LEAD_RELATEDLIST_UPDATE_FAILED', 'Failed to move related Activities/Emails');

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

              }

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

                  $db->createCommand()->update('vtiger_activity', ['link' => $contactId], ['link' => $leadId])->execute();

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

              return true;

      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

           * Function used to save the lead related Campaigns with Contact.

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

                  )->execute();

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

                  $dbCommand->insert('vtiger_senotesrel', ['crmid' => $relatedId, 'notesid' => $row])->execute();

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

              $dataReader->close();

      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 false;

      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 (!empty($contactId)) {

      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 false;

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

              if (!$dataReader->count()) {

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

                  return false;

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

              return true;

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

                  ->createCommand()->query();

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

           *

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

           * @param string $setype    - related module(Accounts/Contacts).

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

                  $resultNew = $db->createCommand()->insert('vtiger_crmentityrel', [

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

                  if (0 === $resultNew) {

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

              }

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

           * Function used to get the lead related activities with other entities Account and Contact.

      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 false;

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

              $db = \App\Db::getInstance();

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

           * @param int    $leadId

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

                  $resultNew = $db->createCommand()->insert('vtiger_crmentityrel', [

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

                      'crmid' => $relatedId,

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

                  }

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

           * @param int $leadId

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

           * Function used to transfer all the lead related records to given Entity(Contact/Account) record.

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

           * Function used to save the lead related products with other entities Account, Contact and Potential.

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

          public static function vtwsSaveLeadRelatedProducts($leadId, $relatedId, $setype)

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

                  $resultNew = $db->createCommand()->insert('vtiger_seproductsrel', [

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

                  ])->execute();

      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 false;

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

              return true;

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

           * @param int $relatedId - related entity id to which the records need to be transferred

      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

           * @param int    $leadId

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

                      'crmid' => $relatedId,

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

          }

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

                  ->createCommand()->query();

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

                      'relmodule' => $row['module'],

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

                  if (0 === $resultNew) {

      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

           * vtwsGetFieldfromFieldId.

      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 bool true on success, false otherwise

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

              $rowCount = $db->createCommand()->update('vtiger_campaign_records', [

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

              ], ['crmid' => $leadId]

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

              return true;

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

           * @param string $setype    - related module(Accounts/Contacts).

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

                      'crmid' => $relatedId,

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

                      'relcrmid' => $row['crmid'],

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

              $dataReader->close();

      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

              foreach ($moduleModel->getFields() as $field) {

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

           * @param int    $relatedId - related entity id (contactid/accountid)

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

           *

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

           * @param int    $relatedId - related entity id (accountid/contactid/potentialid)

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

              }

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

          public static function vtwsSaveLeadRelations($leadId, $relatedId, $setype)

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

              $dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['crmid' => $leadId])

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

           * @param int $contactId -  related contact id

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

                  $db->createCommand()->update('vtiger_activity', ['link' => $accountId], ['link' => $leadId])->execute();

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

           * @param int $relatedId - related entity id (contactid/accountid)

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

              if (0 == $rowCount) {

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

              }

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

                      'rel_created_user' => \App\User::getCurrentUserId(),

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

                  ->createCommand()->query();

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

                      'relmodule' => $row['relmodule'],

      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 (0 === $dataReader->count()) {

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

                  ])->execute();

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

           * @return Vtiger_Field_Model|null

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

          }

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

                  ->from('vtiger_seproductsrel')

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

                  ->where(['crmid' => $leadId])

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

              $dataReader->close();

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

              return true;

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

           * @param int    $relatedId - related entity id (accountid/contactid/potentialid)

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

              }

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

                      'relcrmid' => $row['relcrmid'],

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

           * @param Vtiger_Module_Model $moduleModel

      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

          {

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

                  ])->execute();

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

                  }

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

          public static function vtwsGetRelatedActivities($leadId, $accountId, $contactId, $relatedId)

      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

          public static function vtwsSaveLeadRelatedCampaigns($leadId, $relatedId)

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

          /**

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

           * @param string $seType    - related module(Accounts/Contacts)

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

                      'setype' => $setype,

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

                      return false;

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

              $dataReader->close();

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

          public static function vtwsGetFieldfromFieldId($fieldId, Vtiger_Module_Model $moduleModel)

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

                      return $field;

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

           * @param int $accountId - related account id

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

              $db = \App\Db::getInstance();

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

              $db = \App\Db::getInstance();

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

              $dataReader->close();

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

           * @param int    $leadId

      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 false;

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

                      'productid' => $productId,

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

                      'rel_created_time' => date('Y-m-d H:i:s'),

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

              $db = \App\Db::getInstance();

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

              if (0 === $dataReader->count()) {

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

              while ($row = $dataReader->read()) {

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

                      return false;

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

          /**

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

                  'crmid' => $relatedId,

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

                  throw new WebServiceException('LEAD_RELATEDLIST_UPDATE_FAILED', 'Failed to move related Records');

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

              static::vtwsSaveLeadRelatedProducts($leadId, $relatedId, $seType);

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

              static::vtwsSaveLeadRelations($leadId, $relatedId, $seType);

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

           *

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

              $db->createCommand()->update('vtiger_outsourcedproducts', ['parent_id' => $destinationRecordId], ['parent_id' => $sourceRecordId])->execute();

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

          }

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

              //OSSOutsourcedServices

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

              //LettersIn

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

              $db->createCommand()->update('vtiger_reservations', ['link' => $destinationRecordId], ['link' => $sourceRecordId])->execute();

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

              }

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

                  ModComments::transferRecords($sourceRecordId, $destinationRecordId);

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

          /**

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

           * The function transfers related records.

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

              //OutsourcedProducts

      Line exceeds 120 characters; contains 147 characters
      Open

              $db->createCommand()->update('vtiger_callhistory', ['destination' => $destinationRecordId], ['destination' => $sourceRecordId])->execute();

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

                  $dbCommand->insert('vtiger_seattachmentsrel', ['crmid' => $relatedId, 'attachmentsid' => $row])->execute();

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

                      'module' => $setype,

      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 ($fieldId == $field->getId()) {

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

              return null;

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

          /**

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

           * @param int $leadId    - lead entity id

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

              if (!empty($accountId)) {

      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 (empty($leadId) || empty($relatedId) || empty($seType)) {

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

          {

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

              $db->createCommand()->update('vtiger_lettersin', ['relatedid' => $destinationRecordId], ['relatedid' => $sourceRecordId])->execute();

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

              $db->createCommand()->update('vtiger_lettersout', ['relatedid' => $destinationRecordId], ['relatedid' => $sourceRecordId])->execute();

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

              //SQuoteEnquiries

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

              static::vtwsSaveLeadRelatedCampaigns($leadId, $relatedId);

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

              $db = \App\Db::getInstance();

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

          public static function vtwsTransferLeadRelatedRecords($leadId, $relatedId, $seType)

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

          {

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

              $db->createCommand()->update('vtiger_contactdetails', ['parentid' => $destinationRecordId], ['parentid' => $sourceRecordId])->execute();

      Line exceeds 120 characters; contains 144 characters
      Open

              $db->createCommand()->update('vtiger_ossmailview_relation', ['crmid' => $destinationRecordId], ['crmid' => $sourceRecordId])->execute();

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

              $db->createCommand()->update('u_yf_squoteenquiries', ['accountid' => $destinationRecordId], ['accountid' => $sourceRecordId])->execute();

      Line exceeds 120 characters; contains 142 characters
      Open

              $db->createCommand()->update('vtiger_lettersout', ['relatedid' => $destinationRecordId], ['relatedid' => $sourceRecordId])->execute();

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

              static::vtwsGetRelatedNotesAttachments($leadId, $relatedId);

      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

              //CallHistory

      Line exceeds 120 characters; contains 141 characters
      Open

              $db->createCommand()->update('vtiger_lettersin', ['relatedid' => $destinationRecordId], ['relatedid' => $sourceRecordId])->execute();

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

              static::vtwsTransferComments($leadId, $relatedId);

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

           */

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

                  CRMEntity::getInstance('ModComments');

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

              }

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

           * @param int $sourceRecordId

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

              $db->createCommand()->update('vtiger_ossmailview_relation', ['crmid' => $destinationRecordId], ['crmid' => $sourceRecordId])->execute();

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

           * The function transfers the comments.

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

           * @param int $destinationRecordId

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

              if (\App\Module::isModuleActive('ModComments')) {

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

           * @param int $destinationRecordId

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

           */

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

              //OSSTimeControl

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

              static::vtwsTransferRelatedRecords($leadId, $relatedId);

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

          public static function vtwsTransferRelatedRecords($sourceRecordId, $destinationRecordId)

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

              $db->createCommand()->update('vtiger_callhistory', ['destination' => $destinationRecordId], ['destination' => $sourceRecordId])->execute();

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

              //LettersOut

      Line exceeds 120 characters; contains 134 characters
      Open

              $db->createCommand()->update('vtiger_reservations', ['link' => $destinationRecordId], ['link' => $sourceRecordId])->execute();

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

           *

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

          public static function vtwsTransferComments($sourceRecordId, $destinationRecordId)

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

              $db->createCommand()->update('vtiger_ossoutsourcedservices', ['parent_id' => $destinationRecordId], ['parent_id' => $sourceRecordId])->execute();

      Line exceeds 120 characters; contains 153 characters
      Open

              $db->createCommand()->update('vtiger_ossoutsourcedservices', ['parent_id' => $destinationRecordId], ['parent_id' => $sourceRecordId])->execute();

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

              $db->createCommand()->update('vtiger_osstimecontrol', ['link' => $destinationRecordId], ['link' => $sourceRecordId])->execute();

      Line exceeds 120 characters; contains 145 characters
      Open

              $db->createCommand()->update('u_yf_squoteenquiries', ['accountid' => $destinationRecordId], ['accountid' => $sourceRecordId])->execute();

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

              //Reservations

      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

           * @param int $sourceRecordId

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

              //Contacts

      Line exceeds 120 characters; contains 144 characters
      Open

              $db->createCommand()->update('vtiger_contactdetails', ['parentid' => $destinationRecordId], ['parentid' => $sourceRecordId])->execute();

      Line exceeds 120 characters; contains 150 characters
      Open

              $db->createCommand()->update('vtiger_outsourcedproducts', ['parent_id' => $destinationRecordId], ['parent_id' => $sourceRecordId])->execute();

      Line exceeds 120 characters; contains 136 characters
      Open

              $db->createCommand()->update('vtiger_osstimecontrol', ['link' => $destinationRecordId], ['link' => $sourceRecordId])->execute();

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

              //OSSMailView

      Expected 0 spaces before closing bracket; newline found
      Open

              $rowCount = $db->createCommand()->update('vtiger_campaign_records', [

      There are no issues that match your filters.

      Category
      Status