YetiForceCompany/YetiForceCRM

View on GitHub
modules/OpenStreetMap/models/Coordinate.php

Summary

Maintainability
D
1 day
Test Coverage
F
10%

File Coordinate.php has 368 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Coordiante model.
 *
Severity: Minor
Found in modules/OpenStreetMap/models/Coordinate.php - About 4 hrs to fix

    The class OpenStreetMap_Coordinate_Model has an overall complexity of 58 which is very high. The configured complexity threshold is 50.
    Open

    class OpenStreetMap_Coordinate_Model extends \App\Base
    {
        /**
         * Radius earth.
         */

    Method getMarkerColor has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function getMarkerColor($value)
        {
            static $indexColor = 0;
            if (empty($value)) {
                return '#000';
    Severity: Major
    Found in modules/OpenStreetMap/models/Coordinate.php - About 2 hrs to fix

      Method readAllCoordinatesFromCustomeView has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function readAllCoordinatesFromCustomeView()
          {
              $moduleModel = $this->get('srcModuleModel');
              $moduleName = $moduleModel->getName();
              $excludedIds = $this->get('excluded_ids');
      Severity: Major
      Found in modules/OpenStreetMap/models/Coordinate.php - About 2 hrs to fix

        Method readCoordinatesByRecords has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function readCoordinatesByRecords(array $records)
            {
                $moduleModel = $this->get('srcModuleModel');
                $groupByField = $this->get('groupBy');
                $coordinatesCenter = $this->get('coordinatesCenter');
        Severity: Minor
        Found in modules/OpenStreetMap/models/Coordinate.php - About 1 hr to fix

          Function readAllCoordinatesFromCustomeView has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function readAllCoordinatesFromCustomeView()
              {
                  $moduleModel = $this->get('srcModuleModel');
                  $moduleName = $moduleModel->getName();
                  $excludedIds = $this->get('excluded_ids');
          Severity: Minor
          Found in modules/OpenStreetMap/models/Coordinate.php - About 1 hr 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 readCoordinatesByRecords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function readCoordinatesByRecords(array $records)
              {
                  $moduleModel = $this->get('srcModuleModel');
                  $groupByField = $this->get('groupBy');
                  $coordinatesCenter = $this->get('coordinatesCenter');
          Severity: Minor
          Found in modules/OpenStreetMap/models/Coordinate.php - About 25 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 readAllCoordinatesFromCustomeView() has an NPath complexity of 4320. The configured NPath complexity threshold is 200.
          Open

              public function readAllCoordinatesFromCustomeView()
              {
                  $moduleModel = $this->get('srcModuleModel');
                  $moduleName = $moduleModel->getName();
                  $excludedIds = $this->get('excluded_ids');

          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 readAllCoordinatesFromCustomeView() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
          Open

              public function readAllCoordinatesFromCustomeView()
              {
                  $moduleModel = $this->get('srcModuleModel');
                  $moduleName = $moduleModel->getName();
                  $excludedIds = $this->get('excluded_ids');

          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 16 to the 15 allowed.
          Open

              public function readAllCoordinatesFromCustomeView()

          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 OpenStreetMap_Coordinate_Model has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
          Open

          class OpenStreetMap_Coordinate_Model extends \App\Base
          {
              /**
               * Radius earth.
               */

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

                  $queryGenerator = new App\QueryGenerator($moduleName);

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

                  $dataReader = (new App\Db\Query())->select(['count' => 'COUNT(*)', 'module_name'])

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

                      $records = (new App\Db\Query())

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

                  $queryGenerator = new App\QueryGenerator($moduleName);

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

                  $queryGenerator = new App\QueryGenerator($moduleName);

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

                  $dataReader = (new App\Db\Query())->from('u_#__openstreetmap')

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

                  if (!(new \App\Db\Query())->from('u_#__openstreetmap_cache')

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

                  $queryGenerator = new App\QueryGenerator($moduleName);

          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\Purifier' in method 'getLabelToPopupByArray'.
          Open

                          $html .= \App\Purifier::encodeHtml($data[$fieldName]) . '<br />';

          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 'getLabelToPopupByArray'.
          Open

                  $html .= '<button class="btn btn-danger btn-xs endTrack marginTB3"><span class="fas fa-flag-checkered mr-2"></span>' . \App\Language::translate('LBL_END') . '</button><br />';

          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 'getLabelToPopupByArray'.
          Open

                  $html .= '<button class="btn btn-success btn-xs startTrack marginTB3 mr-3"><span class="fas fa-truck mr-2"></span>' . \App\Language::translate('LBL_START') . '</button>';

          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 'getLabelToPopupByArray'.
          Open

                  $html .= '<button class="btn btn-warning btn-xs indirectPoint marginTB3 mr-3"><span class="fas fa-flag mr-2"></span>' . \App\Language::translate('LBL_INDIRECT_POINT', 'OpenStreetMap') . '</button>';

          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\Config' in method 'readCoordinatesByRecords'.
          Open

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

          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\Config' in method 'getLabelsToPopupById'.
          Open

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

          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_Mass_Action' in method 'getCoordinatesCustomView'.
          Open

                      return $this->readCoordinatesByRecords(Vtiger_Mass_Action::getRecordsListFromRequest($this->get('request')));

          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\Config' in method 'readAllCoordinatesFromCustomeView'.
          Open

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

          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 '\vtlib\Functions' in method 'getLabelsToPopupById'.
          Open

                  $recodMetaData = \vtlib\Functions::getCRMRecordMetadata($crmid);

          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 'readCoordinatesCache'.
          Open

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

          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 'Users_Privileges_Model' in method 'readCoordinatesCache'.
          Open

                  $currentUser = Users_Privileges_Model::getCurrentUserModel();

          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 'readCoordinatesCache'.
          Open

                          $this->set('srcModuleModel', Vtiger_Module_Model::getInstance($moduleName));

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function getCoordinatesCenter()
              {
                  $coordinatesCenter = [];
                  if (!$this->isEmpty('lat') && !$this->isEmpty('lon')) {
                      $coordinatesCenter = [

          IfStatementAssignment

          Since: 2.7.0

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

          Example

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

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

          Avoid using static access to class 'App\Config' in method 'getLabelToPopupByArray'.
          Open

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function readAllCoordinatesFromCustomeView()
              {
                  $moduleModel = $this->get('srcModuleModel');
                  $moduleName = $moduleModel->getName();
                  $excludedIds = $this->get('excluded_ids');

          IfStatementAssignment

          Since: 2.7.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Field_Model' in method 'readAllCoordinatesFromCustomeView'.
          Open

                      $fieldModel = Vtiger_Field_Model::getInstance($groupByField, $moduleModel);

          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 'getCachedRecords'.
          Open

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

          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 'getLabelToPopupByArray'.
          Open

                  return $html . '<button class="btn btn-primary btn-xs searchInRadius marginTB3"><span class="fas fa-arrows-to-dot mr-2"></span>' . \App\Language::translate('LBL_SEARCH_IN_RADIUS', 'OpenStreetMap') . '</button>';

          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\Purifier' in method 'getLabelsToPopupById'.
          Open

                          $html .= \App\Purifier::encodeHtml($value) . '<br />';

          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 "u_#__openstreetmap.lat" 6 times.
          Open

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lat');

          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 "srcModuleModel" 3 times.
          Open

                  $moduleModel = $this->get('srcModuleModel');

          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 "latMax" 3 times.
          Open

                      'latMax' => $lat + rad2deg($radius / $earthRadius),

          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 "OpenStreetMap" 6 times.
          Open

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

          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 "mapPinFields" 4 times.
          Open

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

          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_crmentity.crmid" 5 times.
          Open

                  $queryGenerator->addNativeCondition(['vtiger_crmentity.crmid' => $crmid]);

          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 "user_id" 5 times.
          Open

                      ->from('u_#__openstreetmap_cache')->where(['user_id' => Users_Privileges_Model::getCurrentUserModel()->getId()])

          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" 4 times.
          Open

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

          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 "u_#__openstreetmap_cache" 6 times.
          Open

                      ->from('u_#__openstreetmap_cache')->where(['user_id' => Users_Privileges_Model::getCurrentUserModel()->getId()])

          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 "latMin" 3 times.
          Open

                      'latMin' => $lat - rad2deg($radius / $earthRadius),

          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 "crmids" 4 times.
          Open

                          ->select(['crmids'])

          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 "" 3 times.
          Open

                  $html .= '<button class="btn btn-success btn-xs startTrack marginTB3 mr-3"><span class="fas fa-truck mr-2"></span>' . \App\Language::translate('LBL_START') . '</button>';

          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 "moduleName" 4 times.
          Open

                  $moduleName = $this->get('moduleName');

          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_name" 7 times.
          Open

                  $dataReader = (new App\Db\Query())->select(['count' => 'COUNT(*)', 'module_name'])

          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 "color" 3 times.
          Open

                              'color' => '#000',

          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 "coordinatesCenter" 3 times.
          Open

                  $this->set('coordinatesCenter', $coordinatesCenter);

          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 "u_#__openstreetmap.lon" 6 times.
          Open

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lon');

          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 "lonMax" 3 times.
          Open

                      'lonMax' => $long + rad2deg($radius / $earthRadius / cos(deg2rad($lat))),

          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 "label" 3 times.
          Open

                              'label' => $popup,

          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 "u_#__openstreetmap" 3 times.
          Open

                  $dataReader = (new App\Db\Query())->from('u_#__openstreetmap')

          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 "lonMin" 3 times.
          Open

                      'lonMin' => $long - rad2deg($radius / $earthRadius / cos(deg2rad($lat))),

          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 createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $row = $queryGenerator->createQuery()->one();

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

                  $dataReader = (new App\Db\Query())->from('u_#__openstreetmap')

          Call to method setCustomColumn from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setCustomColumn('vtiger_crmentity.crmid');

          Call to method setCustomColumn from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lat');

          Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->addNativeCondition(['vtiger_crmentity.crmid' => $crmid]);

          Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setFields($fields);

          Call to method setCustomColumn from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setCustomColumn('vtiger_crmentity.crmid');

          Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setFields($fields[$moduleName]);

          Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                      $queryGenerator->addNativeCondition(['not in', 'vtiger_crmentity.crmid', $excludedIds]);

          Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator = new App\QueryGenerator($moduleName);

          Call to method addCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                      $queryGenerator->addCondition($this->get('search_key'), $searchValue, $operator);

          Call to method setCustomColumn from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lat');

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

                  $dataReader = (new App\Db\Query())->select(['count' => 'COUNT(*)', 'module_name'])

          Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $dataReader = $queryGenerator->createQuery()->createCommand()->query();

          Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $query = $queryGenerator->createQuery();

          Call to method parseBaseSearchParamsToCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);

          Call to method parseAdvFilter from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->parseAdvFilter($transformedSearchParams);

          Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $dataReader = $queryGenerator->createQuery()->createCommand()->query();

          Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator = new App\QueryGenerator($moduleName);

          Call to method initForCustomViewById from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->initForCustomViewById($this->get('viewname'));

          Call to method setAdvancedConditions from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                      $queryGenerator->setAdvancedConditions($advancedConditions);

          Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator = new App\QueryGenerator($moduleName);

          Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator = new App\QueryGenerator($moduleName);

          Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setFields($fields);

          Call to method addJoin from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->addJoin(['LEFT JOIN', 'u_#__openstreetmap', 'u_#__openstreetmap.crmid = vtiger_crmentity.crmid']);

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

                  \App\Db::getInstance()->createCommand()

          Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->addNativeCondition(['u_#__openstreetmap.type' => 'a']);

          Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                      $queryGenerator->addNativeCondition([

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

                      $records = (new App\Db\Query())

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

                  App\Db::getInstance()->createCommand()

          Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setFields(['id']);

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

                      App\Db::getInstance()->createCommand()->insert('u_#__openstreetmap_cache', [

          Return type of getInstance() is undeclared type \self
          Open

              public static function getInstance()

          Call to method setCustomColumn from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lon');

          Call to method addJoin from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->addJoin(['LEFT JOIN', 'u_#__openstreetmap', 'vtiger_crmentity.crmid = u_#__openstreetmap.crmid']);

          Parameter $record has undeclared type \type
          Open

              public function addCache($record)

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

                  if (!(new \App\Db\Query())->from('u_#__openstreetmap_cache')

          Call to method setCustomColumn from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lon');

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

                  $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);

          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 OpenStreetMap_Coordinate_Model extends \App\Base

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

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

          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

          The class OpenStreetMap_Coordinate_Model is not named in CamelCase.
          Open

          class OpenStreetMap_Coordinate_Model extends \App\Base
          {
              /**
               * Radius earth.
               */

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

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

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

          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

               * Radius earth.

          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

              const EARTH_RADIUS = 6378137;

          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

                  return new self();

          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 get instance.

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

                      'lonMin' => $long - rad2deg($radius / $earthRadius / cos(deg2rad($lat))),

          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 array

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

                  }

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

                      $coordinatesCenter = \App\Map\Coordinates::getInstance()->getCoordinatesByValue($searchValue);

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

                  foreach ($row as $value) {

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

                  $moduleName = $recodMetaData['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

                  $dataReader->close();

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

                      if (!empty($data[$fieldName])) {

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

                  if (empty($value)) {

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

                      return '#000';

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

                      return self::$colors[$value];

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

                      'FFBBBB', 'FFACEC', 'FFBBDD', 'FFBBF7', 'F2BCFE', 'EDBEFE', 'D0BCFE', 'FFCECE', 'FFC8F2',

          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

                      'FFC8E3', 'FFCAF9', 'F5CAFF', 'F0CBFE', 'DDCEFF', 'FFDFDF', 'FFDFF8', 'FFDFEF', 'FFDBFB',

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

                      'lonMax' => $long + rad2deg($radius / $earthRadius / cos(deg2rad($lat))),

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

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

              public function getLabelsToPopupById($crmid)

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

                  $queryGenerator->setFields($fields[$moduleName]);

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

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

          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

                      '872187', '9A03FE', '892EE4', '3923D6', '2966B8', '23819C', 'BF00BF', 'BC2EBC', 'A827FE',

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

                      'F5EEFD', 'EFEDFC', 'EAF1FB', 'DBF0F7', 'FFF9FF', 'FDF9FD', 'FEFDFF', 'FEFDFF', 'F7F5FE',

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

                      '74FEF8', '62FDCE', '72FE95', '9999FF', '99C7FF', 'A8E4FF', '75ECFD', '92FEF9', '7DFDD7',

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

                      'F9F9FF', 'F9FCFF', 'FDFEFF', 'F9FEFF', 'FDFFFF', 'F7FFFD', 'F9FFFB', '1FCB4A', '59955C',

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

                      'DFE32D', '7CEB98', '93BF96', '99FD77', '52FF20', '95FF4F', 'FFFFAA', 'EDEF85', '93EEAA',

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

                      'F1FEED', 'E7FFDF', 'F2FFEA', 'FFFFE3', 'FCFCE9', 'FAFEFB', 'FBFDFB', 'FDFFFD', 'F5FFF2',

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

                      'F4CAD6', 'FFA8FF', 'EFCDF8', 'C6C6FF', 'C0E7F3', 'DCEDEA', 'FFEAEA', 'F8DAE2', 'FFC4FF',

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

                  self::$colors[$value] = $color;

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

                  if (!empty($groupByField)) {

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

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

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

                  return $coordinates;

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

                      return $this->readCoordinatesByRecords(Vtiger_Mass_Action::getRecordsListFromRequest($this->get('request')));

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

                  $radius = $this->get('radius');

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

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

                  $recodMetaData = \vtlib\Functions::getCRMRecordMetadata($crmid);

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

               * @param int $recordId

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

                              'color' => '#000',

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

                  }

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

                      'F4F4BF', 'FFF284', 'FFECB0', 'FFE099', 'FFE6B5', 'FFD9B7', 'FFD7B3', 'F7F7CE', 'FFF7B7',

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

                      'ECD9D9', 'F1F1D6', 'F5EFE0', 'F2E4D5', 'F5E7E2', 'F0DDD5', 'F5E8E2', 'F3E7E7', 'F5F5E2',

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

                      'F9F5EC', 'F9F3EC', 'F9EFEC', 'F5E8E2', 'FAF2EF', 'F8F1F1', 'FDFDF9', 'FDFCF9', 'FCF9F5',

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

              }

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

              {

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

                  }

          Line exceeds 120 characters; contains 121 characters
          Open

                      return $this->readCoordinatesByRecords(Vtiger_Mass_Action::getRecordsListFromRequest($this->get('request')));

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

                      $groupByFieldColumn = $fieldModel->get('column');

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

              public static function getInstance()

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

                      'latMin' => $lat - rad2deg($radius / $earthRadius),

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

                          'lon' => $this->get('lon'),

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

                  $dataReader = (new App\Db\Query())->from('u_#__openstreetmap')

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

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

          Line exceeds 120 characters; contains 183 characters
          Open

                  $html .= '<button class="btn btn-danger btn-xs endTrack marginTB3"><span class="fas fa-flag-checkered mr-2"></span>' . \App\Language::translate('LBL_END') . '</button><br />';

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

               * @staticvar int $indexColor

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

                      '8BFEA8', 'AAAAFF', 'A8CFFF', 'BBEBFF', '8CEFFD', 'A5FEFA', '8FFEDD', 'A3FEBA', 'BBBBFF',

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

                  $moduleModel = $this->get('srcModuleModel');

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

                  $groupByField = $this->get('groupBy');

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

                  $radius = $this->get('radius');

          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 \self

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

                  $long = $coordinates['lon'];

          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

                  $defaultColors = ['ff0000', 'ff00de', '7000ff', '001eff', '00c2ff', '00ff45', 'ff9b00', '961d5f',

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

                      'FFF1C6', 'FFEAB7', 'FFEAC4', 'FFE1C6', 'FFE2C8', 'F9F9DD', 'FFF9CE', 'FFF5D7', 'FFF2D2',

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

                  ++$indexColor;

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

                  $fields = $fields[$moduleName];

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

                      $andWhere[] = ['<', 'u_#__openstreetmap.lat', $margins['latMax']];

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

                      $andWhere[] = ['>', 'u_#__openstreetmap.lat', $margins['latMin']];

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

              /**

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

                      $fieldModel = Vtiger_Field_Model::getInstance($groupByField, $moduleModel);

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

               * @return float[]

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

                  $lat = $coordinates['lat'];

          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 get coordinates of center point.

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

               *

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

                  $queryGenerator->addNativeCondition(['vtiger_crmentity.crmid' => $crmid]);

          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

                              'label' => $popup,

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

               *

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

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

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

                      'F4D2F4', 'EFD7FF', 'EDDFFB', 'E3E0FA', 'E0EAF8', 'C9EAF3', 'FFECFF', 'F4D2F4', 'F9EEFF',

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

                      '8ADCFF', '3DE4FC', '5FFEF7', '33FDC0', '4BFE78', '8C8CFF', '99C7FF', '99E0FF', '63E9FC',

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

                      'BBDAFF', 'CEF0FF', 'ACF3FD', 'B5FFFC', 'A5FEE3', 'B5FFC8', 'CACAFF', 'D0E6FF', 'D9F3FF',

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

                      'FFBE28', 'FFCE73', 'FFBB7D', 'FFBD82', 'EEEEA2', 'FFE920', 'FFDD75', 'FFC848', 'FFD586',

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

                      'C0A545', 'C27E3A', 'C47557', 'B05F3C', 'C17753', 'B96F6F', 'D7D78A', 'CEB86C', 'C98A4B',

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

                      'E4C0B1', 'ECD5CA', 'E6CCCC', 'EEEECE', 'EFE7CF', 'EEDCC8', 'F0DCD5', 'EACDC1', 'F0DDD5',

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

                      'D900D9', 'BA21E0', '8282FF', '4FBDDD', '8DC7BB', 'FF8E8E', 'E994AB', 'FF2DFF', 'CB59E8',

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

                  $moduleName = $moduleModel->getName();

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

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

          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

                  $queryGenerator->initForCustomViewById($this->get('viewname'));

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

                  $queryGenerator->setCustomColumn('vtiger_crmentity.crmid');

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

               * The function return the border coordinates for the point.

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

                  $earthRadius = static::EARTH_RADIUS;

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

              /**

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

                  if (!$this->isEmpty('lat') && !$this->isEmpty('lon')) {

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

                  $queryGenerator = new App\QueryGenerator($moduleName);

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

                  return $html;

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

               * Function to get coordinates for record.

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

              {

          Line exceeds 120 characters; contains 206 characters
          Open

                  $html .= '<button class="btn btn-warning btn-xs indirectPoint marginTB3 mr-3"><span class="fas fa-flag mr-2"></span>' . \App\Language::translate('LBL_INDIRECT_POINT', 'OpenStreetMap') . '</button>';

          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

                      'F1ECFF', 'FFF2F2', 'FFFEFB', 'FFF9FC', 'FFF9FE', 'FFFDFF', 'FDF9FF', 'FBF9FF', '800080',

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

                      'BCB4F3', 'A9C5EB', '8CD1E6', 'FFBBFF', 'EEBBEE', 'DFB0FF', 'DBBFF7', 'CBC5F5', 'BAD0EF',

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

                      'D0977B', 'C88E8E', 'E1E1A8', 'DECF9C', 'DAAF85', 'DAA794', 'CF8D72', 'DAAC96', 'D1A0A0',

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

                      'EFCDF8', 'DBDBFF', 'D8F0F8', 'E7F3F1', 'FFEAEA', 'FAE7EC', 'FFE3FF', 'F8E9FC', 'EEEEFF',

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

               *

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

                  $queryGenerator->addJoin(['LEFT JOIN', 'u_#__openstreetmap', 'vtiger_crmentity.crmid = u_#__openstreetmap.crmid']);

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

                  if (!empty($selectedIds)) {

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

               * Get coordinates for all records in the listview.

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

               * @return array

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

                      $fields[] = $groupByField;

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

                      'FF800D', 'E0E04E', 'D9C400', 'F9BB00', 'EAA400', 'FFBF48', 'FFA04A', 'FF9C42', 'E6E671',

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

                  $queryGenerator->setFields($fields);

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

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lon');

          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

              }

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

               * @return array

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

              public function readAllCoordinatesFromCustomeView()

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

                  $moduleModel = $this->get('srcModuleModel');

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

                      $queryGenerator->addNativeCondition(['not in', 'vtiger_crmentity.crmid', $excludedIds]);

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

                          ['>', 'u_#__openstreetmap.lon', $margins['lonMin']],

          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

                  $currentUser = Users_Privileges_Model::getCurrentUserModel();

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

                  $insertedData = [];

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

               */

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

                  $moduleName = $this->get('moduleName');

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

                  return [

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

                  if ($searchValue = $this->get('searchValue')) {

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

                  $this->set('coordinatesCenter', $coordinatesCenter);

          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

                  return $coordinates;

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

              public function getLabelToPopupByArray($data, $moduleName)

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

               * Draws color.

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

                      'F9D9FF', 'F4DCFE', 'E6DBFF', 'FFECEC', 'FFEEFB', 'FFECF5', 'FFEEFD', 'FDF2FF', 'FAECFF',

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

                      '9B4EE9', '6755E3', '2F74D0', '2897B7', 'DB00DB', 'D54FD5', 'B445FE', 'A55FEB', '8678E9',

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

                      'CD85FE', 'C79BF2', 'B0A7F1', '8EB4E6', '7BCAE1', 'FFA4FF', 'EAA6EA', 'D698FE', 'CEA8F4',

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

                      '8FFF6F', 'C0FF97', 'FFFF99', 'F2F4B3', 'BDF4CB', 'C9DECB', 'CAFEB8', 'A5FF8A', 'D1FFB3',

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

                      'CB876D', 'C06A45', 'C98767', 'C48484', 'DBDB97', 'D6C485', 'D19C67', 'D29680', 'C87C5B',

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

                      'E9E9BE', 'E3D6AA', 'DDB791', 'DFB4A4', 'D69E87', 'E0BBA9', 'D7ACAC', 'EEEECE', 'EADFBF',

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

                      '1F88A7', '4A9586', 'FF2626', 'D73E68', 'B300B3', '8D18AB', '5B5BFF', '25A0C5', '5EAE9E',

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

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lat');

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

                  return [];

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

               */

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

                  $queryGenerator->setFields($fields);

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

                      ->createCommand($db)->query();

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

                  foreach ($records as $recordId) {

          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

                          $coordinates[] = [

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

               */

          Line exceeds 120 characters; contains 137 characters
          Open

                  $html = '<b><a href="index.php?module=' . $moduleName . '&view=Detail&record=' . $data['crmid'] . '"><span class="description">';

          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 $html . '<button class="btn btn-primary btn-xs searchInRadius marginTB3"><span class="fas fa-arrows-to-dot mr-2"></span>' . \App\Language::translate('LBL_SEARCH_IN_RADIUS', 'OpenStreetMap') . '</button>';

          Line exceeds 120 characters; contains 219 characters
          Open

                  return $html . '<button class="btn btn-primary btn-xs searchInRadius marginTB3"><span class="fas fa-arrows-to-dot mr-2"></span>' . \App\Language::translate('LBL_SEARCH_IN_RADIUS', 'OpenStreetMap') . '</button>';

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

          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 (isset(self::$colors[$value])) {

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

                      'F8FBFE', 'EAF7FB', '5757FF', '62A9FF', '62D0FF', '06DCFB', '01FCEF', '03EBA6', '01F33E',

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

                      'C0F7FE', 'CEFFFD', 'BEFEEB', 'CAFFD8', 'E1E1FF', 'DBEBFF', 'ECFAFF', 'C0F7FE', 'E1FFFE',

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

                      'FFFFB5', 'F5F7C4', 'D6F8DE', 'DBEADC', 'DDFED1', 'B3FF99', 'DFFFCA', 'FFFFC8', 'F7F9D0',

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

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

                  if (empty($searchParams)) {

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

                      $searchParams = [];

          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

               * @return array

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

               */

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

                      $records[$row['module_name']] = $row['count'];

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

              public function saveCache($records)

          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

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

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

                      if (!empty($value)) {

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

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

               * Adding records to the clipboard.

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

                  $html = '<b><a href="index.php?module=' . $moduleName . '&view=Detail&record=' . $data['crmid'] . '"><span class="description">';

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

                      ->where(['crmids' => $record])->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

                  $html .= '<button class="btn btn-success btn-xs startTrack marginTB3 mr-3"><span class="fas fa-truck mr-2"></span>' . \App\Language::translate('LBL_START') . '</button>';

          Line exceeds 120 characters; contains 178 characters
          Open

                  $html .= '<button class="btn btn-success btn-xs startTrack marginTB3 mr-3"><span class="fas fa-truck mr-2"></span>' . \App\Language::translate('LBL_START') . '</button>';

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

              public static $colors = [];

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

                      'FF79E1', 'FF73B9', 'FE67EB', 'E77AFE', 'D97BFD', 'A27AFE', 'FF8A8A', 'FF86E3', 'FF86C2',

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

                      'BDFFEA', 'EAFFEF', 'EEEEFF', 'ECF4FF', 'F9FDFF', 'E6FCFF', 'F2FFFE', 'CFFEF0', 'EAFFEF',

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

                      'FFF2D9', 'FFEBD9', 'FFE6D0', 'FBFBE8', 'FFFBDF', 'FFFAEA', 'FFF9EA', 'FFF7E6', 'FFF4EA',

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

                      'FFF1E6', 'FEFEFA', 'FFFEF7', 'FFFDF7', 'FFFDF9', 'FFFDF9', 'FFFEFD', 'FFF9F4', 'D1D17A',

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

                      'E4C6A7', 'E6C5B9', 'DEB19E', 'E8CCBF', 'DDB9B9', 'E9E9C0', 'EDE4C9', 'E9D0B6', 'EBD0C7',

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

                  return $color;

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

               *

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

                  $coordinatesCenter = $this->get('coordinatesCenter');

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

                  $coordinates = [];

          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

              {

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

                  $coordinatesCenter = $this->get('coordinatesCenter');

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

              public function getCoordinatesCenter()

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

                      $queryGenerator->setAdvancedConditions($advancedConditions);

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

                  return $coordinatesCenter;

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

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

               * @return array

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

                  $queryGenerator->addNativeCondition(['u_#__openstreetmap.type' => 'a']);

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

                  if ($excludedIds && !empty($excludedIds) && \is_array($excludedIds) && \count($excludedIds) > 0) {

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

              public function readCoordinates($recordId)

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

                          ['<', 'u_#__openstreetmap.lat', $margins['latMax']],

          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

                  $modules = $this->get('cache');

          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 set all records from module to cache.

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

                          $html .= \App\Purifier::encodeHtml($data[$fieldName]) . '<br />';

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

              {

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

                  $html .= '<button class="btn btn-warning btn-xs indirectPoint marginTB3 mr-3"><span class="fas fa-flag mr-2"></span>' . \App\Language::translate('LBL_INDIRECT_POINT', 'OpenStreetMap') . '</button>';

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

                  static $indexColor = 0;

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

                      'FF4AFF', 'DD75DD', 'C269FE', 'AE70ED', 'A095EE', '7BA7E1', '57BCD9', 'FF86FF', 'E697E6',

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

                      'A6CAA9', 'AAFD8E', '6FFF44', 'ABFF73', 'FFFF84', 'EEF093', 'A4F0B7', 'B4D1B6', 'BAFEA3',

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

                      '9191FF', '67C7E2', 'A5D3CA', 'FFA4A4', 'EDA9BC', 'F206FF', 'CB59E8', 'A8A8FF', '8ED6EA',

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

               * @param int[] $records Array with id of records

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

               */

          Line exceeds 120 characters; contains 123 characters
          Open

                  $queryGenerator->addJoin(['LEFT JOIN', 'u_#__openstreetmap', 'vtiger_crmentity.crmid = u_#__openstreetmap.crmid']);

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

                      $margins = self::getMargins($coordinatesCenter, $radius);

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

                  }

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

                  $searchValue = $this->get('search_value');

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

                  $searchParams = $this->getArray('search_params');

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

                      $queryGenerator->addNativeCondition([

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

                          ['>', 'u_#__openstreetmap.lat', $margins['latMin']],

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

               * Get coordinates for records from the clipboard.

          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

                          ->createCommand($db)->queryColumn();

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

                          $this->set('srcModuleModel', Vtiger_Module_Model::getInstance($moduleName));

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

                  $moduleName = $this->get('moduleName');

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

                      $insertedData[] = [$userId, $moduleName, $recordId];

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

                  $moduleName = $this->get('moduleName');

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

                      ->delete('u_#__openstreetmap_cache', ['module_name' => $moduleName, 'user_id' => Users_Privileges_Model::getCurrentUserModel()->getId()])

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

                  $moduleName = $this->get('moduleName');

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

                  }

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

                      $coordinatesCenter = [

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

                          'lat' => $this->get('lat'),

          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

                  $popup = self::getLabelsToPopupById($recordId);

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

                  $coordinates = [];

          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 string

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

                      'A5DBEB', 'FFCEFF', 'F0C4F0', 'E8C6FF', 'E1CAF9', 'D7D1F8', 'CEDEF4', 'B8E2EF', 'FFDFFF',

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

                      '6A6AFF', '75B4FF', '75D6FF', '24E0FB', '1FFEF3', '03F3AB', '0AFE47', '7979FF', '86BCFF',

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

                      'FAFFF7', 'FFFFFD', 'FDFDF0', 'BABA21', 'C8B400', 'DFA800', 'DB9900', 'FFB428', 'FF9331',

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

                      'E6CE00', 'FFCB2F', 'FFB60B', 'FFC65B', 'FFAB60', 'FFAC62', 'EAEA8A', 'F7DE00', 'FFD34F',

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

                  }

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

                  $queryGenerator = new App\QueryGenerator($moduleName);

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

                  $andWhere = ['and', ['vtiger_crmentity.crmid' => $records], ['u_#__openstreetmap.type' => 'a']];

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

                              'label' => self::getLabelToPopupByArray($row, $moduleName),

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

                  $selectedIds = $this->get('selectedIds');

          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

                  $queryGenerator->addJoin(['LEFT JOIN', 'u_#__openstreetmap', 'u_#__openstreetmap.crmid = vtiger_crmentity.crmid']);

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

                          $coordinates[] = [

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

                  $dataReader = (new App\Db\Query())->select(['count' => 'COUNT(*)', 'module_name'])

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

                          $coordinates[$moduleName] = $this->readCoordinatesByRecords($records);

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

               * @param array $records Array with records 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

                      $records[] = $row['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

               * @param array $coordinates

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

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

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

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

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

                      if (!empty($row['lat'] && !empty($row['lon']))) {

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

               * Function to get content in popup.

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

                  foreach ($fields[$moduleName] as $fieldName) {

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

                  $html .= '<button class="btn btn-danger btn-xs endTrack marginTB3"><span class="fas fa-flag-checkered mr-2"></span>' . \App\Language::translate('LBL_END') . '</button><br />';

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

               */

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

                      'E29BFD', 'B89AFE', 'FFA8A8', 'FFACEC', 'FFA8D3', 'FEA9F3', 'EFA9FE', 'E7A9FE', 'C4ABFE',

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

                      '4985D6', '2FAACE', 'F900F9', 'DD75DD', 'BD5CFE', 'AE70ED', '9588EC', '6094DB', '44B4D5',

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

                      '48FB0D', '2DC800', '59DF00', '9D9D00', 'B6BA18', '27DE55', '6CA870', '79FC4E', '32DF00',

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

                      '61F200', 'C8C800', 'CDD11B', '4AE371', '80B584', '89FC63', '36F200', '66FF00', 'DFDF00',

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

               * Function to get coordinates for many records.

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

               * @return array

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

              public function readCoordinatesByRecords(array $records)

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

                  $query = $queryGenerator->createQuery();

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

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

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

                          ];

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

               * Get coordinates for select records.

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

                  if ('all' == $selectedIds) {

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

                  $operator = $this->get('operator');

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

                  $fields = $fields[$moduleName];

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

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

              public function saveAllRecordsToCache()

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

              {

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

                  $queryGenerator->setFields(['id']);

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

                  $this->saveCache($records);

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

                      'FFC48E', 'FFC895', 'F1F1B1', 'FFF06A', 'FFE699', 'FFD062', 'FFDEA2', 'FFCFA4', 'FFCEA2',

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

                      'FF5353', 'DD597D', 'CA00CA', 'A41CC6', '7373FF', '29AFD6', '74BAAC', 'FF7373', 'E37795',

          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($coordinatesCenter) && !empty($radius)) {

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

                  $dataReader = $query->andWhere($andWhere)->createCommand()->query();

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

                          $coordinates[] = [

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

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

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

                  $excludedIds = $this->get('excluded_ids');

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

                  $groupByField = $this->get('groupBy');

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

                  $queryGenerator = new App\QueryGenerator($moduleName);

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

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lat');

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

                      $queryGenerator->addCondition($this->get('search_key'), $searchValue, $operator);

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

                  $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);

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

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

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

                      ->groupBy('module_name')

          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

               *

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

                  return $coordinates;

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

                  App\Db::getInstance()->createCommand()

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

              public function deleteCache()

          Line exceeds 120 characters; contains 149 characters
          Open

                      ->delete('u_#__openstreetmap_cache', ['module_name' => $moduleName, 'user_id' => Users_Privileges_Model::getCurrentUserModel()->getId()])

          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

                  $records = [];

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

                      App\Db::getInstance()->createCommand()->insert('u_#__openstreetmap_cache', [

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

               */

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

              private function getMargins($coordinates, $radius)

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

              {

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

                  $coordinatesCenter = [];

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

                  $row = $queryGenerator->createQuery()->one();

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

                          $html .= \App\Purifier::encodeHtml($value) . '<br />';

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

                  $html .= '</span></a></b><input type=hidden class="coordinates" data-lon="' . $data['lon'] . '" data-lat="' . $data['lat'] . '">';

          Line exceeds 120 characters; contains 138 characters
          Open

                  $html .= '</span></a></b><input type=hidden class="coordinates" data-lon="' . $data['lon'] . '" data-lat="' . $data['lat'] . '">';

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

                      'E3FBE9', 'E9F1EA', 'EAFEE2', 'D2FFC4', 'E8FFD9', 'FFFFD7', 'FAFBDF', 'E3FBE9', 'F3F8F4',

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

                      'FDFAF9', 'FDFAF9', 'FCF7F5', 'FDFBFB', 'F70000', 'B9264F', '990099', '74138C', '0000CE',

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

                      'C0E0DA', 'FFB5B5', 'F0B9C8', 'FF7DFF', 'D881ED', 'B7B7FF', 'A6DEEE', 'CFE7E2', 'FFC8C8',

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

                      'EFF9FC', 'F2F9F8', 'FFFDFD', 'FEFAFB', 'FFFDFF', 'FFFFFF', 'FDFDFF', 'FAFDFE', 'F7FBFA', ];

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

                  $color = '#' . $defaultColors[$indexColor];

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

                      $fields[] = $groupByField;

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

                      $andWhere[] = ['<', 'u_#__openstreetmap.lon', $margins['lonMax']];

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

                      if (!empty($row['lat'] && !empty($row['lon']))) {

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

                              'color' => self::getMarkerColor($row[$groupByField] ?? '')

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

                      return $this->readAllCoordinatesFromCustomeView();

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

                  if (!empty($searchValue) && $operator) {

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

                  if (!empty($coordinatesCenter) && !empty($radius)) {

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

                          'and',

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

                          ['<', 'u_#__openstreetmap.lon', $margins['lonMax']],

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

                      ]);

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

                              'label' => self::getLabelToPopupByArray($row, $moduleName),

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

                              'color' => self::getMarkerColor($row[$groupByFieldColumn]),

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

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

                          ->from('u_#__openstreetmap_cache')

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

               *

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

               * Removes records in the clipbord.

          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

                  $radius *= 1000;

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

                      'latMax' => $lat + rad2deg($radius / $earthRadius),

          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 get label in popup.

          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

                  $html = '';

          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 ($row = $dataReader->read()) {

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

               * @param array  $data

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

               * @return string color

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

              private function getMarkerColor($value)

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

                      'FE8BF0', 'EA8DFE', 'DD88FD', 'AD8BFE', 'FF9797', 'FF97E8', 'FF97CB', 'FE98F1', 'ED9EFE',

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

                  $queryGenerator->setCustomColumn('vtiger_crmentity.crmid');

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

                      $andWhere[] = ['>', 'u_#__openstreetmap.lon', $margins['lonMin']];

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

              public function getCoordinatesCustomView()

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

                  $moduleName = $moduleModel->getName();

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

                  $fields = App\Config::module('OpenStreetMap', 'mapPinFields');

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

                  $queryGenerator->setCustomColumn('u_#__openstreetmap.lon');

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

                  if ($advancedConditions = $this->get('advancedConditions')) {

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

                      ->from('u_#__openstreetmap_cache')->where(['user_id' => Users_Privileges_Model::getCurrentUserModel()->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

                  $userId = Users_Privileges_Model::getCurrentUserModel()->getId();

          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

                  $dataReader = $queryGenerator->createQuery()->createCommand()->query();

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

                  $this->deleteCache();

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

                  if (!(new \App\Db\Query())->from('u_#__openstreetmap_cache')

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

                          'module_name' => $moduleName,

          Line exceeds 120 characters; contains 123 characters
          Open

                  $queryGenerator->addJoin(['LEFT JOIN', 'u_#__openstreetmap', 'u_#__openstreetmap.crmid = vtiger_crmentity.crmid']);

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

                          unset($searchParams[$key]);

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

                  }

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

                  $userId = $currentUser->getId();

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

                          ->where(['user_id' => $userId, 'module_name' => $moduleName])

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

                      if (!empty($records)) {

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

                  }

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

               * Save records to clipboard.

          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

                          'crmids' => $record,

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

                  $dataReader = $queryGenerator->createQuery()->createCommand()->query();

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

                      if (!empty($row['lat'] && !empty($row['lon']))) {

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

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

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

                  return $records;

          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

                      $margins = self::getMargins($coordinatesCenter, $radius);

          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

              public function getCachedRecords()

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

               * @return array

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

                  $coordinates = [];

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

                      $records = (new App\Db\Query())

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

                          ->select(['crmids'])

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

                  }

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

                      ->batchInsert('u_#__openstreetmap_cache', ['user_id', 'module_name', 'crmids'], $insertedData)

          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 type $record

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

              public function addCache($record)

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

                          'user_id' => Users_Privileges_Model::getCurrentUserModel()->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

                  foreach ($searchParams as $key => $value) {

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

                  $queryGenerator->parseAdvFilter($transformedSearchParams);

          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

               * Get total count of records in the clipboard.

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

              {

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

                  \App\Db::getInstance()->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

                  $coordinates = [];

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

              }

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

              /**

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

               *

          Line exceeds 120 characters; contains 124 characters
          Open

                      ->from('u_#__openstreetmap_cache')->where(['user_id' => Users_Privileges_Model::getCurrentUserModel()->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

                  foreach ($modules as $moduleName) {

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

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

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

          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 $coordinates;

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

                  $records = [];

          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

                  $queryGenerator = new App\QueryGenerator($moduleName);

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

                  }

          Class name "OpenStreetMap_Coordinate_Model" is not in camel caps format
          Open

          class OpenStreetMap_Coordinate_Model extends \App\Base

          There are no issues that match your filters.

          Category
          Status