YetiForceCompany/YetiForceCRM

View on GitHub
include/Webservices/ConvertLead.php

Summary

Maintainability
D
1 day
Test Coverage
F
0%

Function vtwsConvertlead has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
    {
        \App\Log::trace('Start ' . __METHOD__);
        if (empty($entityvalues['assignedTo'])) {
            $entityvalues['assignedTo'] = $user->id;
Severity: Minor
Found in include/Webservices/ConvertLead.php - About 6 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Method vtwsConvertlead has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
    {
        \App\Log::trace('Start ' . __METHOD__);
        if (empty($entityvalues['assignedTo'])) {
            $entityvalues['assignedTo'] = $user->id;
Severity: Major
Found in include/Webservices/ConvertLead.php - About 3 hrs to fix

    Function vtwsPopulateConvertLeadEntities has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)
        {
            $targetModuleModel = Vtiger_Module_Model::getInstance($entityvalue['name']);
            $entityName = $entityvalue['name'];
            $dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->createCommand()->query();
    Severity: Minor
    Found in include/Webservices/ConvertLead.php - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method vtwsPopulateConvertLeadEntities has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)
        {
            $targetModuleModel = Vtiger_Module_Model::getInstance($entityvalue['name']);
            $entityName = $entityvalue['name'];
            $dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->createCommand()->query();
    Severity: Minor
    Found in include/Webservices/ConvertLead.php - About 1 hr to fix

      Function vtwsValidateConvertLeadEntityMandatoryValues has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function vtwsValidateConvertLeadEntityMandatoryValues($entity, Vtiger_Module_Model $targetModuleModel)
          {
              $mandatoryFields = $targetModuleModel->getMandatoryFieldModels();
              foreach ($mandatoryFields as $field => $fieldModel) {
                  if (empty($entity[$field])) {
      Severity: Minor
      Found in include/Webservices/ConvertLead.php - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function vtwsUpdateConvertLeadStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function vtwsUpdateConvertLeadStatus($entityIds, $leadId, Users_Record_Model $user)
          {
              $db = \App\Db::getInstance();
              if ('' != $entityIds['Accounts'] || '' != $entityIds['Contacts']) {
                  \App\Cache::delete('Leads.converted', $leadId);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php - About 35 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

      The method vtwsConvertlead() has an NPath complexity of 4680. The configured NPath complexity threshold is 200.
      Open

          public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
          {
              \App\Log::trace('Start ' . __METHOD__);
              if (empty($entityvalues['assignedTo'])) {
                  $entityvalues['assignedTo'] = $user->id;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phpmd

      NPathComplexity

      Since: 0.1

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

      Example

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

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

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

          public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)
          {
              $targetModuleModel = Vtiger_Module_Model::getInstance($entityvalue['name']);
              $entityName = $entityvalue['name'];
              $dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->createCommand()->query();
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phpmd

      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

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

          public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
          {
              \App\Log::trace('Start ' . __METHOD__);
              if (empty($entityvalues['assignedTo'])) {
                  $entityvalues['assignedTo'] = $user->id;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phpmd

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

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

          public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by sonar-php

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

      See

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

          public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by sonar-php

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

      See

      The class WebservicesConvertLead has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
      Open

      class WebservicesConvertLead
      {
          /**
           * The function convert the lead.
           *
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phpmd

      CouplingBetweenObjects

      Since: 1.1.0

      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

      Example

      class Foo {
          /**
           * @var \foo\bar\X
           */
          private $x = null;
      
          /**
           * @var \foo\bar\Y
           */
          private $y = null;
      
          /**
           * @var \foo\bar\Z
           */
          private $z = null;
      
          public function setFoo(\Foo $foo) {}
          public function setBar(\Bar $bar) {}
          public function setBaz(\Baz $baz) {}
      
          /**
           * @return \SplObjectStorage
           * @throws \OutOfRangeException
           * @throws \InvalidArgumentException
           * @throws \ErrorException
           */
          public function process(\Iterator $it) {}
      
          // ...
      }

      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

      Missing class import via use statement (line '40', column '23').
      Open

              $eventHandler = new App\EventHandler();
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '88', column '16').
      Open

                          throw new WebServiceException('UNKNOWN_OPERATION', $e->getMessage() . ' : ' . $entityvalue['name']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '132', column '22').
      Open

              $dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->createCommand()->query();
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '236', column '15').
      Open

                      throw new WebServiceException('FAILED_TO_MARK_LEAD_CONVERTED', 'Failed mark lead converted');
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '34', column '12').
      Open

              if ((new \App\Db\Query())->select(['converted'])->from('vtiger_leaddetails')->where(['converted' => 1, 'leadid' => $leadIdComponents])->exists()) {
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '14').
      Open

                  throw new WebServiceException('LEAD_ALREADY_CONVERTED', $translateAlreadyConvertedError);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '\WebservicesUtils' in method 'vtwsConvertlead'.
      Open

                  \WebservicesUtils::vtwsGetRelatedActivities($leadIdComponents, $accountId, $contactId, $relatedId);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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\Log' in method 'vtwsConvertlead'.
      Open

              \App\Log::trace('End ' . __METHOD__);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '\WebservicesUtils' in method 'vtwsConvertLeadTransferHandler'.
      Open

                  \WebservicesUtils::vtwsTransferLeadRelatedRecords($leadIdComponents, $entityidComponents, $entityvalues['transferRelatedRecordsTo']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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\Log' in method 'vtwsConvertlead'.
      Open

              \App\Log::trace('Start ' . __METHOD__);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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\Log' in method 'vtwsConvertlead'.
      Open

                  \App\Log::error('Error converting a lead: ' . $translateAlreadyConvertedError);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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\Log' in method 'vtwsConvertlead'.
      Open

                          \App\Log::error('Error converting a lead: ' . $e->getMessage());
      Severity: Minor
      Found in include/Webservices/ConvertLead.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

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

                                  } else {
                                      $defaultValue = $fieldModel->getDefaultFieldValue();
                                      if ('' !== $defaultValue) {
                                          $recordModel->set($fieldName, $defaultValue);
                                      }
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class 'Vtiger_Module_Model' in method 'vtwsPopulateConvertLeadEntities'.
      Open

              $targetModuleModel = Vtiger_Module_Model::getInstance($entityvalue['name']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 'Vtiger_Record_Model' in method 'vtwsConvertlead'.
      Open

              $recordModel = Vtiger_Record_Model::getInstanceById($entityvalues['leadId']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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\Language' in method 'vtwsConvertlead'.
      Open

                  $translateAlreadyConvertedError = \App\Language::translate('LBL_LEAD_ALREADY_CONVERTED', 'Leads');
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 'vtwsUpdateConvertLeadStatus'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '\WebservicesUtils' in method 'vtwsPopulateConvertLeadEntities'.
      Open

                      $entityField = \WebservicesUtils::vtwsGetFieldfromFieldId($row[$column], $targetModuleModel);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 '\WebservicesUtils' in method 'vtwsPopulateConvertLeadEntities'.
      Open

                      $leadField = \WebservicesUtils::vtwsGetFieldfromFieldId($row['leadfid'], $recordModel->getModule());
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 'Vtiger_Record_Model' in method 'vtwsConvertlead'.
      Open

                              $recordModel = Vtiger_Record_Model::getCleanInstance($entityvalue['name']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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\Cache' in method 'vtwsUpdateConvertLeadStatus'.
      Open

                  \App\Cache::delete('Leads.converted', $leadId);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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 'Vtiger_Module_Model' in method 'vtwsUpdateConvertLeadStatus'.
      Open

                      $moduleModel = Vtiger_Module_Model::getInstance($module);
      Severity: Minor
      Found in include/Webservices/ConvertLead.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\Log' in method 'vtwsConvertlead'.
      Open

                  \App\Log::error('Error converting a lead: ' . $e->getMessage());
      Severity: Minor
      Found in include/Webservices/ConvertLead.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

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

                      } else {
                          $entity[$field] = '????';
                      }
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phpmd

      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

      Define a constant instead of duplicating this literal "Contacts" 7 times.
      Open

              $availableModules = ['Accounts', 'Contacts'];
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "create" 3 times.
      Open

              if (empty($entityvalues['entities']['Accounts']['create']) && empty($entityvalues['entities']['Contacts']['create'])) {
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "converted" 3 times.
      Open

              if ((new \App\Db\Query())->select(['converted'])->from('vtiger_leaddetails')->where(['converted' => 1, 'leadid' => $leadIdComponents])->exists()) {
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "convert_to_id" 3 times.
      Open

                          if ('Accounts' == $entityvalue['name'] && !empty($entityvalue['convert_to_id']) && \is_int($entityvalue['convert_to_id'])) {
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "Accounts" 10 times.
      Open

                  $entityvalues['transferRelatedRecordsTo'] = 'Accounts';
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "Error converting a lead: " 3 times.
      Open

                  \App\Log::error('Error converting a lead: ' . $translateAlreadyConvertedError);
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "leadId" 3 times.
      Open

              $recordModel = Vtiger_Record_Model::getInstanceById($entityvalues['leadId']);
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "assignedTo" 3 times.
      Open

              if (empty($entityvalues['assignedTo'])) {
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "transferRelatedRecordsTo" 5 times.
      Open

              if (empty($entityvalues['transferRelatedRecordsTo'])) {
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 "entities" 4 times.
      Open

              if (empty($entityvalues['entities']['Accounts']['create']) && empty($entityvalues['entities']['Contacts']['create'])) {
      Severity: Critical
      Found in include/Webservices/ConvertLead.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 method error from undeclared class \App\Log
      Open

                          \App\Log::error('Error converting a lead: ' . $e->getMessage());
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

      Invalid offset "leadId" of array type array{assignedTo:}|array{transferRelatedRecordsTo:'Accounts'}|array{transferRelatedRecordsTo:mixed,assignedTo:}|string
      Open

              $recordModel = Vtiger_Record_Model::getInstanceById($entityvalues['leadId']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

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

              if ((new \App\Db\Query())->select(['converted'])->from('vtiger_leaddetails')->where(['converted' => 1, 'leadid' => $leadIdComponents])->exists()) {
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

      Call to method trace from undeclared class \App\Log
      Open

              \App\Log::trace('End ' . __METHOD__);
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

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

                      $db->createCommand()
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

      Argument 2 (entityIds) is array<string>|array<string>|array{Accounts:mixed}|array{}</string></string> but \WebservicesConvertLead::vtwsConvertLeadTransferHandler() takes int defined at /code/include/Webservices/ConvertLead.php:209
      Open

                  static::vtwsConvertLeadTransferHandler($leadIdComponents, $entityIds, $entityvalues);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

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

              $dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->createCommand()->query();
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

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

                  $result = $db->createCommand()
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

      When fetching an array index from a value of type string, found an array index of type 'transferRelatedRecordsTo', but expected the index to be of type int
      Open

                  \WebservicesUtils::vtwsTransferLeadRelatedRecords($leadIdComponents, $entityidComponents, $entityvalues['transferRelatedRecordsTo']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      When appending to a value of type string, found an array access index of type 'assignedTo', but expected the index to be of type int
      Open

                  $entityvalues['assignedTo'] = $user->id;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Invalid offset "entities" of array type array{assignedTo:}|array{transferRelatedRecordsTo:'Accounts'}|array{transferRelatedRecordsTo:mixed,assignedTo:}|string
      Open

              if (empty($entityvalues['entities']['Accounts']['create']) && empty($entityvalues['entities']['Contacts']['create'])) {
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Argument 2 (entity) is array{assigned_user_id:} but \WebservicesConvertLead::vtwsPopulateConvertLeadEntities() takes string defined at /code/include/Webservices/ConvertLead.php:128
      Open

                      $entityObjectValues = static::vtwsPopulateConvertLeadEntities($entityvalue, $entityObjectValues, $recordModel, $leadInfo);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Returning type array<string>|array<string>|array{Accounts:mixed}|array{}</string></string> but vtwsConvertlead() is declared to return int
      Open

              return $entityIds;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Call to method error from undeclared class \App\Log
      Open

                  \App\Log::error('Error converting a lead: ' . $e->getMessage());
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

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

                  $db->createCommand()
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

      Argument 1 (leadIdComponents) is null but \WebservicesConvertLead::vtwsConvertLeadTransferHandler() takes int defined at /code/include/Webservices/ConvertLead.php:209
      Open

                  static::vtwsConvertLeadTransferHandler($leadIdComponents, $entityIds, $entityvalues);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Suspicious array access to \entity
      Open

                          $entityObjectValues['parent_id'] = $entityIds['Accounts'];
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Invalid offset "leadId" of array type array{entities:mixed,assignedTo:,transferRelatedRecordsTo:'Accounts'|mixed}|string
      Open

                  static::vtwsUpdateConvertLeadStatus($entityIds, $entityvalues['leadId'], $user);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      When fetching an array index from a value of type string, found an array index of type string, but expected the index to be of type int
      Open

                      $entity[$entityFieldName] = $leadinfo[$leadFieldName];
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Argument 2 (key) is int but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
      Open

                  \App\Cache::delete('Leads.converted', $leadId);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Returning type null but vtwsConvertlead() is declared to return int
      Open

                  return null;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Call to deprecated function \Vtiger_Field_Model::getFieldName() defined at /code/modules/Vtiger/models/Field.php:203
      Open

                      $entityFieldName = $entityField->getFieldName();
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      When fetching an array index from a value of type string, found an array index of type 'transferRelatedRecordsTo', but expected the index to be of type int
      Open

                  $entityidComponents = $entityIds[$entityvalues['transferRelatedRecordsTo']];
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Reference to undeclared property \Users_Record_Model->id
      Open

                  $entityvalues['assignedTo'] = $user->id;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Invalid offset "leadId" of array type array{assignedTo:}|array{transferRelatedRecordsTo:'Accounts'}|array{transferRelatedRecordsTo:mixed,assignedTo:}|string
      Open

              $leadIdComponents = $entityvalues['leadId'];
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Argument 1 (leadId) is null but \WebservicesUtils::vtwsGetRelatedActivities() takes int defined at /code/include/Webservices/Utils.php:167
      Open

                  \WebservicesUtils::vtwsGetRelatedActivities($leadIdComponents, $accountId, $contactId, $relatedId);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Returning type null but vtwsConvertlead() is declared to return int
      Open

                  return null;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Return type of vtwsPopulateConvertLeadEntities() is undeclared type \entity
      Open

          public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Call to deprecated function \Vtiger_Field_Model::getFieldName() defined at /code/modules/Vtiger/models/Field.php:203
      Open

                      $leadFieldName = $leadField->getFieldName();
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Suspicious array access to int
      Open

              if ('' != $entityIds['Accounts'] || '' != $entityIds['Contacts']) {
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Returning type string but vtwsPopulateConvertLeadEntities() is declared to return \entity
      Open

              return $entity;
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Suspicious array access to int
      Open

                  $entityidComponents = $entityIds[$entityvalues['transferRelatedRecordsTo']];
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Suspicious array access to int
      Open

                          ->update($tablename, ['isconvertedfromlead' => 1], [$moduleModel->getEntityInstance()->tab_name_index[$tablename] => $entityIds[$module]])
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      When appending to a value of type string, found an array access index of type string, but expected the index to be of type int
      Open

                      $entity[$entityFieldName] = $leadinfo[$leadFieldName];
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Call to method trace from undeclared class \App\Log
      Open

              \App\Log::trace('Start ' . __METHOD__);
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

      Argument 4 (leadinfo) is array but \WebservicesConvertLead::vtwsPopulateConvertLeadEntities() takes string defined at /code/include/Webservices/ConvertLead.php:128
      Open

                      $entityObjectValues = static::vtwsPopulateConvertLeadEntities($entityvalue, $entityObjectValues, $recordModel, $leadInfo);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Argument 1 (recordId) is null but \Vtiger_Record_Model::getInstanceById() takes int defined at /code/modules/Vtiger/models/Record.php:763
      Open

              $recordModel = Vtiger_Record_Model::getInstanceById($entityvalues['leadId']);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Call to method error from undeclared class \App\Log
      Open

                  \App\Log::error('Error converting a lead: ' . $translateAlreadyConvertedError);
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

      Argument 1 (entityIds) is array<string>|array<string>|array{Accounts:mixed}|array{}</string></string> but \WebservicesConvertLead::vtwsUpdateConvertLeadStatus() takes int defined at /code/include/Webservices/ConvertLead.php:227
      Open

                  static::vtwsUpdateConvertLeadStatus($entityIds, $entityvalues['leadId'], $user);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Argument 2 (leadId) is null but \WebservicesConvertLead::vtwsUpdateConvertLeadStatus() takes int defined at /code/include/Webservices/ConvertLead.php:227
      Open

                  static::vtwsUpdateConvertLeadStatus($entityIds, $entityvalues['leadId'], $user);
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phan

      Call to undeclared function \vtws_delete()
      Open

                      vtws_delete($id, $user);
      Severity: Critical
      Found in include/Webservices/ConvertLead.php by phan

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

                  $translateAlreadyConvertedError = \App\Language::translate('LBL_LEAD_ALREADY_CONVERTED', 'Leads');
      Severity: Minor
      Found in include/Webservices/ConvertLead.php by phpmd

      LongVariable

      Since: 0.2

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

      Example

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

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

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

      class WebservicesConvertLead

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in include/Webservices/ConvertLead.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

           * The function convert the lead.

      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

                      } catch (Exception $e) {

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

              try {

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

                  $relatedId = $entityIds[$entityvalues['transferRelatedRecordsTo']];

      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

                  $entityvalues['transferRelatedRecordsTo'] = 'Accounts';

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

              $leadInfo = $recordModel->getData();

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

                      try {

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

                                      $recordModel->set($fieldName, $entityObjectValues[$fieldName]);

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

                              $entityIds[$entityName] = $recordModel->getId();

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

                          }

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

           * Populate the entity fields with the lead info.

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

              \App\Log::trace('Start ' . __METHOD__);

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

                      $entityvalue = $entityvalues['entities'][$entityName];

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

                          if ('Accounts' == $entityvalue['name'] && !empty($entityvalue['convert_to_id']) && \is_int($entityvalue['convert_to_id'])) {

      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 ($availableModules as $entityName) {

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

                                  } else {

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

                              $recordModel->save();

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

                  $accountId = $entityIds['Accounts'];

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

           *

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

           *

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

           * @return int

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

              if ((new \App\Db\Query())->select(['converted'])->from('vtiger_leaddetails')->where(['converted' => 1, 'leadid' => $leadIdComponents])->exists()) {

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

              }

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

              $eventHandler->trigger('EntityBeforeConvertLead');

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

                      }

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

                              $create = false;

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

                          if ($create) {

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

                  \WebservicesUtils::vtwsGetRelatedActivities($leadIdComponents, $accountId, $contactId, $relatedId);

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

           * @param string              $leadinfo

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

              if (empty($entityvalues['assignedTo'])) {

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

                  throw new WebServiceException('LEAD_ALREADY_CONVERTED', $translateAlreadyConvertedError);

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

                          }

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

                      vtws_delete($id, $user);

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

           * @param array               $entityvalue

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

          public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)

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

          {

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

                      $entityObjectValues['assigned_user_id'] = $entityvalues['assignedTo'];

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

                      if ('Contacts' == $entityvalue['name'] && !empty($entityIds['Accounts'])) {

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

                              $fieldModelList = $recordModel->getModule()->getFields();

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

                                      $defaultValue = $fieldModel->getDefaultFieldValue();

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

                                      if ('' !== $defaultValue) {

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

              }

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

              $targetModuleModel = Vtiger_Module_Model::getInstance($entityvalue['name']);

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

                                      }

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

                          throw new WebServiceException('UNKNOWN_OPERATION', $e->getMessage() . ' : ' . $entityvalue['name']);

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

                  static::vtwsConvertLeadTransferHandler($leadIdComponents, $entityIds, $entityvalues);

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

                  $eventHandler->addParams('entityIds', $entityIds);

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

                  $eventHandler->trigger('EntityAfterConvertLead');

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

                  \App\Log::error('Error converting a lead: ' . $e->getMessage());

      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 Vtiger_Record_Model $recordModel

      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 ($fieldModelList as $fieldName => &$fieldModel) {

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

                          \App\Log::error('Error converting a lead: ' . $e->getMessage());

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

           * @return entity array

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

              $leadIdComponents = $entityvalues['leadId'];

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

              $availableModules = ['Accounts', 'Contacts'];

      Line exceeds 120 characters; contains 127 characters
      Open

              if (empty($entityvalues['entities']['Accounts']['create']) && empty($entityvalues['entities']['Contacts']['create'])) {

      Line exceeds 120 characters; contains 138 characters
      Open

                      $entityObjectValues = static::vtwsPopulateConvertLeadEntities($entityvalue, $entityObjectValues, $recordModel, $leadInfo);

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

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

              \App\Log::trace('End ' . __METHOD__);

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

           * @param string              $entity

      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($entityvalues['transferRelatedRecordsTo'])) {

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

              $eventHandler = new App\EventHandler();

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

                      $entityObjectValues = [];

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

                              $recordModel = Vtiger_Record_Model::getCleanInstance($entityvalue['name']);

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

                  static::vtwsUpdateConvertLeadStatus($entityIds, $entityvalues['leadId'], $user);

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

              } catch (Exception $e) {

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

              return $entityIds;

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

           * If mandatory field is not provided populate with '????'.

      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             $entityvalues

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

          {

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

              }

      Line exceeds 120 characters; contains 144 characters
      Open

                          if ('Accounts' == $entityvalue['name'] && !empty($entityvalue['convert_to_id']) && \is_int($entityvalue['convert_to_id'])) {

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

                          break;

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

                      if (null === $leadField) {

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

           */

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

              try {

      Line exceeds 120 characters; contains 145 characters
      Open

                  \WebservicesUtils::vtwsTransferLeadRelatedRecords($leadIdComponents, $entityidComponents, $entityvalues['transferRelatedRecordsTo']);

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

                  \App\Cache::delete('Leads.converted', $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

                      if ($defaultvalue && empty($entity[$fieldname])) {

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

                  }

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

                  $entity = static::vtwsValidateConvertLeadEntityMandatoryValues($entity, $targetModuleModel);

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

              foreach ($mandatoryFields as $field => $fieldModel) {

      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

                          ->execute();

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

                          $column = 'contactfid';

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

                          $column = 'leadfid';

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

                  foreach ($targetModuleModel->getFields() as $fieldname => $field) {

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

                      $defaultvalue = $field->getDefaultFieldValue();

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

                          $entity[$fieldname] = $defaultvalue;

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

                          $entity[$fieldname] = $fieldvalue;

      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

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

           *

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

                  $result = $db->createCommand()

      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

              $eventHandler->setParams(['entityValues' => $entityvalues, 'user' => $user, 'leadInfo' => $leadInfo]);

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

                  if (!empty($entityvalues['entities'][$entityName]['create'])) {

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

              }

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

              $recordModel = Vtiger_Record_Model::getInstanceById($entityvalues['leadId']);

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

                      $entityObjectValues = static::vtwsPopulateConvertLeadEntities($entityvalue, $entityObjectValues, $recordModel, $leadInfo);

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

                  $translateAlreadyConvertedError = \App\Language::translate('LBL_LEAD_ALREADY_CONVERTED', 'Leads');

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

                          $entityObjectValues['parent_id'] = $entityIds['Accounts'];

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

                  }

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

                  switch ($entityName) {

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

                          $column = 'accountfid';

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

              }

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

                      case 'Contacts':

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

              $dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->createCommand()->query();

      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

           * Validate convert lead entity mandatory values.

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

              if ($dataReader->count()) {

      Line exceeds 120 characters; contains 251 characters
      Open

                      if (('picklist' === $fieldModel->getFieldDataType() || 'multipicklist' === $fieldModel->getFieldDataType() || 'date' === $fieldModel->getFieldDataType() || 'datetime' === $fieldModel->getFieldDataType()) && $fieldModel->isEditable()) {

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

                      case 'Accounts':

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

                      throw new WebServiceException('FAILED_TO_MARK_LEAD_CONVERTED', 'Failed mark lead converted');

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

                      }

      Line exceeds 120 characters; contains 158 characters
      Open

                          ->update($tablename, ['isconvertedfromlead' => 1], [$moduleModel->getEntityInstance()->tab_name_index[$tablename] => $entityIds[$module]])

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

                  }

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

                      $entityField = \WebservicesUtils::vtwsGetFieldfromFieldId($row[$column], $targetModuleModel);

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

                      $leadField = \WebservicesUtils::vtwsGetFieldfromFieldId($row['leadfid'], $recordModel->getModule());

      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

                      ->update('vtiger_leaddetails', ['converted' => 1], ['leadid' => $leadId])

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

                  //update the modifiedtime and modified by information for the record

      Line exceeds 120 characters; contains 155 characters
      Open

              if ((new \App\Db\Query())->select(['converted'])->from('vtiger_leaddetails')->where(['converted' => 1, 'leadid' => $leadIdComponents])->exists()) {

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

                          $create = true;

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

                                  if (isset($entityObjectValues[$fieldName])) {

      Line exceeds 120 characters; contains 126 characters
      Open

          public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)

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

           * @param string              $entity

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

              return $entity;

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

           * @param int                $entityIds

      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()

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

              $entityName = $entityvalue['name'];

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

                  $row = $dataReader->read();

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

                  do {

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

           * @param Vtiger_Module_Model $targetModuleModel

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

          public static function vtwsValidateConvertLeadEntityMandatoryValues($entity, Vtiger_Module_Model $targetModuleModel)

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

                      if (('picklist' === $fieldModel->getFieldDataType() || 'multipicklist' === $fieldModel->getFieldDataType() || 'date' === $fieldModel->getFieldDataType() || 'datetime' === $fieldModel->getFieldDataType()) && $fieldModel->isEditable()) {

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

                          $entity[$field] = '????';

      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

                      ->execute();

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

           * @param Users_Record_Model $user

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

          public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)

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

                  $entityvalues['assignedTo'] = $user->id;

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

                  \App\Log::error('Error converting a lead: ' . $translateAlreadyConvertedError);

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

              $entityIds = [];

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

              if (empty($entityvalues['entities']['Accounts']['create']) && empty($entityvalues['entities']['Contacts']['create'])) {

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

                      //update the contacts relation

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

                              $entityIds[$entityName] = $entityvalue['convert_to_id'];

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

                                          $recordModel->set($fieldName, $defaultValue);

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

                  $contactId = $entityIds['Contacts'] ?? 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

                          break;

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

                      $leadFieldName = $leadField->getFieldName();

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

                      $entity[$entityFieldName] = $leadinfo[$leadFieldName];

      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($entity[$field])) {

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

                      } else {

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

           *

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

          public static function vtwsConvertLeadTransferHandler($leadIdComponents, $entityIds, $entityvalues)

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

              }

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

                  $entityidComponents = $entityIds[$entityvalues['transferRelatedRecordsTo']];

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

           * The function updates the status convert lead.

      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 ($moduleArray as $module) {

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

                          ->update($tablename, ['isconvertedfromlead' => 1], [$moduleModel->getEntityInstance()->tab_name_index[$tablename] => $entityIds[$module]])

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

                  \WebservicesUtils::vtwsTransferLeadRelatedRecords($leadIdComponents, $entityidComponents, $entityvalues['transferRelatedRecordsTo']);

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

          }

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

              } catch (Exception $e) {

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

          }

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

           */

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

              $moduleArray = ['Accounts', 'Contacts'];

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

                      $moduleModel = Vtiger_Module_Model::getInstance($module);

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

                  $count = 1;

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

                          continue;

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

              return $entity;

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

           *

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

                          $entity[$field] = $fieldModel->getDefaultFieldValue();

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

           * @param string $entityvalues

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

           * @param Users_Record_Model $user

      Line exceeds 120 characters; contains 139 characters
      Open

                      ->update('vtiger_crmentity', ['modifiedtime' => date('Y-m-d H:i:s'), 'modifiedby' => $user->getId()], ['crmid' => $leadId])

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

                      $tablename = $moduleModel->getFieldByName('isconvertedfromlead')->getTableName();

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

                      if (null === $entityField) {

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

                      if (!empty($fieldvalue)) {

      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

                      ->update('vtiger_crmentity', ['modifiedtime' => date('Y-m-d H:i:s'), 'modifiedby' => $user->getId()], ['crmid' => $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

                          break;

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

                  foreach ($entityvalue as $fieldname => $fieldvalue) {

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

              $mandatoryFields = $targetModuleModel->getMandatoryFieldModels();

      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

          public static function vtwsUpdateConvertLeadStatus($entityIds, $leadId, Users_Record_Model $user)

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

              if ('' != $entityIds['Accounts'] || '' != $entityIds['Contacts']) {

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

                      $entityFieldName = $entityField->getFieldName();

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

                      ++$count;

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

           * @param int    $entityIds

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

              }

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

                      default:

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

                          continue;

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

           * @return string

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

                  }

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

           * @param int    $leadIdComponents

      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()

      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

           * function to handle the transferring of related records for lead.

      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

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

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

                  if (false === $result) {

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

                  if (!empty($entityIds[$module])) {

      There are no issues that match your filters.

      Category
      Status