YetiForceCompany/YetiForceCRM

View on GitHub
modules/Calendar/models/Calendar.php

Summary

Maintainability
D
1 day
Test Coverage
F
0%

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

    public function getQuery()
    {
        $queryGenerator = new App\QueryGenerator($this->getModuleName());
        if ($this->has('customFilter')) {
            $queryGenerator->initForCustomViewById($this->get('customFilter'));
Severity: Minor
Found in modules/Calendar/models/Calendar.php - About 3 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Method getQuery has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getQuery()
    {
        $queryGenerator = new App\QueryGenerator($this->getModuleName());
        if ($this->has('customFilter')) {
            $queryGenerator->initForCustomViewById($this->get('customFilter'));
Severity: Major
Found in modules/Calendar/models/Calendar.php - About 3 hrs to fix

    File Calendar.php has 262 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Calendar Model Class.
     *
    Severity: Minor
    Found in modules/Calendar/models/Calendar.php - About 2 hrs to fix

      Method getEntity has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getEntity()
          {
              $return = [];
              $currentUser = \App\User::getCurrentUserModel();
              $moduleModel = Vtiger_Module_Model::getInstance($this->getModuleName());
      Severity: Minor
      Found in modules/Calendar/models/Calendar.php - About 2 hrs to fix

        Method getEntityCount has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getEntityCount(): array
            {
                $colors = \App\Fields\Picklist::getColors('activitytype', false);
                $currentUser = Users_Record_Model::getCurrentUserModel();
                $startDate = DateTimeField::convertToDBTimeZone($this->get('start'));
        Severity: Minor
        Found in modules/Calendar/models/Calendar.php - About 1 hr to fix

          Function getEntityCount has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getEntityCount(): array
              {
                  $colors = \App\Fields\Picklist::getColors('activitytype', false);
                  $currentUser = Users_Record_Model::getCurrentUserModel();
                  $startDate = DateTimeField::convertToDBTimeZone($this->get('start'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.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 getEntity has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getEntity()
              {
                  $return = [];
                  $currentUser = \App\User::getCurrentUserModel();
                  $moduleModel = Vtiger_Module_Model::getInstance($this->getModuleName());
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php - About 45 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          The method getQuery() has an NPath complexity of 5760. The configured NPath complexity threshold is 200.
          Open

              public function getQuery()
              {
                  $queryGenerator = new App\QueryGenerator($this->getModuleName());
                  if ($this->has('customFilter')) {
                      $queryGenerator->initForCustomViewById($this->get('customFilter'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          NPathComplexity

          Since: 0.1

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

          Example

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

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

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

              public function getQuery()
              {
                  $queryGenerator = new App\QueryGenerator($this->getModuleName());
                  if ($this->has('customFilter')) {
                      $queryGenerator->initForCustomViewById($this->get('customFilter'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          CyclomaticComplexity

          Since: 0.1

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

          Example

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

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

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

              public function getQuery()
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

          See

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

          class Calendar_Calendar_Model extends Vtiger_Calendar_Model
          {
              public $moduleName = 'Calendar';
              public $module;
              public $relationAcounts = [
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          CouplingBetweenObjects

          Since: 1.1.0

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

          Example

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

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

          Missing class import via use statement (line '28', column '25').
          Open

                  $queryGenerator = new App\QueryGenerator($this->getModuleName());
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

          Missing class import via use statement (line '193', column '33').
          Open

                      $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                              ['>=', new \yii\db\Expression("CONCAT(due_date, ' ', time_end)"), $dbStartDateTime],
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

          Missing class import via use statement (line '199', column '33').
          Open

                      $dateTimeFieldInstance = new DateTimeField($record['due_date'] . ' ' . $record['time_end']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                              ['<=', new \yii\db\Expression("CONCAT(due_date, ' ', time_end)"), $dbEndDateTime],
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

          Missing class import via use statement (line '133', column '33').
          Open

                      $dateTimeFieldInstance = new DateTimeField($row['date_start'] . ' ' . $row['time_start']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                              ['<=', new \yii\db\Expression("CONCAT(date_start, ' ', time_start)"), $dbEndDateTime],
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                          $subQuery = (new \App\Db\Query())->select(['crmid'])->from('u_#__crmentity_showners')->where(['userid' => $selectedIds]);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                      $end = new DateTime($endDateFormated);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                              ['>=', new \yii\db\Expression("CONCAT(date_start, ' ', time_start)"), $dbStartDateTime],
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                      $begin = new DateTime($startDateFormated);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

          Missing class import via use statement (line '143', column '33').
          Open

                      $dateTimeFieldInstance = new DateTimeField($row['due_date'] . ' ' . $row['time_end']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

                      foreach (new DatePeriod($begin, $interval, $end) as $dt) {
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

              public function getQuery()
              {
                  $queryGenerator = new App\QueryGenerator($this->getModuleName());
                  if ($this->has('customFilter')) {
                      $queryGenerator->initForCustomViewById($this->get('customFilter'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          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 assigning values to variables in if clauses and the like (line '34', column '7').
          Open

              public function getQuery()
              {
                  $queryGenerator = new App\QueryGenerator($this->getModuleName());
                  if ($this->has('customFilter')) {
                      $queryGenerator->initForCustomViewById($this->get('customFilter'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          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_Link_Model' in method 'getSideBarLinks'.
          Open

          }
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getQuery'.
          Open

                      $dbStartDateOject = DateTimeField::convertToDBTimeZone($this->get('start'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getEntity'.
          Open

                      $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->getDetail('date_format'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Users_Record_Model' in method 'getEntityCount'.
          Open

                  $currentUser = Users_Record_Model::getCurrentUserModel();
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Log' in method 'updateEvent'.
          Open

                      \App\Log::error($e->__toString());
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function updateEvent(int $recordId, string $start, string $end, App\Request $request): bool
              {
                  try {
                      $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $this->getModuleName());
                      if ($success = $recordModel->isEditable()) {
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          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 'Calendar_Module_Model' in method 'getQuery'.
          Open

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('current')), 'e');
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateInterval' in method 'getEntityCount'.
          Open

                      $interval = DateInterval::createFromDateString('1 day');
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Language' in method 'getEntityCount'.
          Open

                              $return[$dateKey]['label'] = \App\Language::translate($activityType, $this->getModuleName());
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Link_Model' in method 'getSideBarLinks'.
          Open

                  $links[] = Vtiger_Link_Model::getInstanceFromValues([
                      'linktype' => 'SIDEBARWIDGET',
                      'linklabel' => 'LBL_USERS',
                      'linkclass' => 'js-users-form usersForm ',
                      'template' => 'Filters/Users.tpl',
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'updateEvent'.
          Open

                          $end = DateTimeField::convertToDBTimeZone($end);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                              } else {
                                  $return[$dateKey]['title'] = 1;
                              }
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          ElseExpression

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Cache' in method 'getCleanInstance'.
          Open

                      Vtiger_Cache::set('calendarModels', 'Calendar', clone $instance);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Request' in method 'getSideBarLinks'.
          Open

                  $request = \App\Request::init();
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  $moduleModel = Vtiger_Module_Model::getInstance($this->getModuleName());
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  $editForm = \App\Config::module('Calendar', 'SHOW_EDIT_FORM');
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      } else {
                          $item['start'] = $startDateFormated . ' ' . $startTimeFormated;
                          $item['end'] = $endDateFormated . ' ' . $endTimeFormated;
                      }
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          ElseExpression

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getEntityCount'.
          Open

                      $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Cache' in method 'getCleanInstance'.
          Open

                  $instance = Vtiger_Cache::get('calendarModels', 'Calendar');
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Link_Model' in method 'getSideBarLinks'.
          Open

                  $links[] = Vtiger_Link_Model::getInstanceFromValues([
                      'linktype' => 'SIDEBARWIDGET',
                      'linklabel' => 'LBL_GROUPS',
                      'linkclass' => 'js-group-form groupForm',
                      'template' => 'Filters/Groups.tpl',
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getQuery'.
          Open

                      $dbEndDateObject = DateTimeField::convertToDBTimeZone($this->get('end'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getEntityCount'.
          Open

                  $startDate = DateTimeField::convertToDBTimeZone($this->get('start'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getEntityCount'.
          Open

                      $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Record_Model' in method 'updateEvent'.
          Open

                      $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $this->getModuleName());
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                          } else {
                              $recordModel->set('time_start', $start->format('H:i:s'));
                              $recordModel->set('time_end', $end->format('H:i:s'));
                              $recordModel->set('allday', 0);
                          }
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          ElseExpression

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Fields\Picklist' in method 'getEntity'.
          Open

                  $colors = \App\Fields\Picklist::getColors('activitytype', false);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Purifier' in method 'getEntity'.
          Open

                      $item['title'] = \App\Purifier::encodeHtml($row['subject']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Fields\Picklist' in method 'getEntityCount'.
          Open

                  $colors = \App\Fields\Picklist::getColors('activitytype', false);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Calendar_Module_Model' in method 'getQuery'.
          Open

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('history')), 'e');
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getEntityCount'.
          Open

                  $endDate = DateTimeField::convertToDBTimeZone($this->get('end'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'getEntity'.
          Open

                      $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->getDetail('date_format'));
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_CalendarRightPanel_Model' in method 'getSideBarLinks'.
          Open

                      'filterData' => Vtiger_CalendarRightPanel_Model::getGroupsList($this->moduleName),
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Loader' in method 'getQuery'.
          Open

                          $filterClassName = Vtiger_Loader::getComponentClassName('CalendarFilter', $filter['name'], 'Calendar');
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\User' in method 'getEntity'.
          Open

                  $currentUser = \App\User::getCurrentUserModel();
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      } else {
                          $item['url'] = 'index.php?module=' . $this->getModuleName() . '&view=ActivityState&record=' . $row['id'];
                      }
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          ElseExpression

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_CalendarRightPanel_Model' in method 'getSideBarLinks'.
          Open

                      'filterData' => Vtiger_CalendarRightPanel_Model::getUsersList($this->moduleName),
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'DateTimeField' in method 'updateEvent'.
          Open

                          $start = DateTimeField::convertToDBTimeZone($start);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      $queryGenerator->addCondition('activitytype', implode('##', $types), 'e');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                      $dateTimeFieldInstance = new DateTimeField($row['date_start'] . ' ' . $row['time_start']);
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

          Define a constant instead of duplicating this literal "Y-m-d H:i:s" 4 times.
          Open

                      $dbStartDateTime = $dbStartDateOject->format('Y-m-d H:i:s');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                      $dateTimeFieldInstance = new DateTimeField($row['due_date'] . ' ' . $row['time_end']);
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                  if ($this->get('start') && $this->get('end')) {
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                      $item['allDay'] = 1 == $row['allday'];
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                  $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['SIDEBARWIDGET'], $linkParams)['SIDEBARWIDGET'] ?? [];
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

          Define a constant instead of duplicating this literal "index.php?module=" 3 times.
          Open

                          $item['url'] = 'index.php?module=' . $this->getModuleName() . '&view=EventForm&record=' . $row['id'];
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

          Define a constant instead of duplicating this literal "Calendar" 5 times.
          Open

              public $moduleName = 'Calendar';
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                      $item['allDay'] = 1 == $row['allday'];
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                      $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->getDetail('date_format'));
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

          Define a constant instead of duplicating this literal "Y-m-d" 6 times.
          Open

                      $dbStartDate = $dbStartDateOject->format('Y-m-d');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                      $item['title'] = \App\Purifier::encodeHtml($row['subject']);
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('current')), 'e');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                              ['>', 'due_date', $dbEndDate],
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

          Define a constant instead of duplicating this literal "date_start" 5 times.
          Open

                              ['<', 'date_start', $dbStartDate],
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                  $currentUser = \App\User::getCurrentUserModel();
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                              ['>=', new \yii\db\Expression("CONCAT(due_date, ' ', time_end)"), $dbStartDateTime],
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                              ['<=', new \yii\db\Expression("CONCAT(due_date, ' ', time_end)"), $dbEndDateTime],
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                              ['>=', new \yii\db\Expression("CONCAT(date_start, ' ', time_start)"), $dbStartDateTime],
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                  $queryGenerator->setFields(array_keys($queryGenerator->getModuleFields()));
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                      $queryGenerator->addNativeCondition([
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                  $query = $queryGenerator->createQuery();
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                  $queryGenerator->setField('id');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('history')), 'e');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method read from undeclared class \yii\db\DataReader
          Open

                  while ($row = $dataReader->read()) {
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                      $queryGenerator->initForCustomViewById($this->get('customFilter'));
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                  $queryGenerator->setFields(array_keys($queryGenerator->getModuleFields()));
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('current')), 'e');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                      $queryGenerator->addCondition('activitytype', implode('##', $types), 'e');
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                              ['<=', new \yii\db\Expression("CONCAT(date_start, ' ', time_start)"), $dbEndDateTime],
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Argument 1 (value) is string but \DateTimeField::__construct() takes \type defined at /code/include/fields/DateTimeField.php:31
          Open

                      $dateTimeFieldInstance = new DateTimeField($row['due_date'] . ' ' . $row['time_end']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phan

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

                          $subQuery = (new \App\Db\Query())->select(['crmid'])->from('u_#__crmentity_showners')->where(['userid' => $selectedIds]);
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                  $queryGenerator = new App\QueryGenerator($this->getModuleName());
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                      $queryGenerator->addNativeCondition(['vtiger_activity.status' => $this->get('activitystatus')]);
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method getUsersList from undeclared class \Vtiger_CalendarRightPanel_Model
          Open

                      'filterData' => Vtiger_CalendarRightPanel_Model::getUsersList($this->moduleName),
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

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

                      \App\Log::error($e->__toString());
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Argument 1 (value) is string but \DateTimeField::__construct() takes \type defined at /code/include/fields/DateTimeField.php:31
          Open

                      $dateTimeFieldInstance = new DateTimeField($record['due_date'] . ' ' . $record['time_end']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phan

          Argument 1 (value) is string but \DateTimeField::__construct() takes \type defined at /code/include/fields/DateTimeField.php:31
          Open

                      $dateTimeFieldInstance = new DateTimeField($row['date_start'] . ' ' . $row['time_start']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method close from undeclared class \yii\db\DataReader
          Open

                  $dataReader->close();
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Invalid operator: unary operand of ++(expr) is null (expected int or string or float)
          Open

                                  ++$return[$dateKey]['title'];
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method getGroupsList from undeclared class \Vtiger_CalendarRightPanel_Model
          Open

                      'filterData' => Vtiger_CalendarRightPanel_Model::getGroupsList($this->moduleName),
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Invalid offset "title" of array type array{allDay:true}|array{start:string}
          Open

                                  ++$return[$dateKey]['title'];
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method close from undeclared class \yii\db\DataReader
          Open

                  $dataReader->close();
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Call to method read from undeclared class \yii\db\DataReader
          Open

                  while ($record = $dataReader->read()) {
          Severity: Critical
          Found in modules/Calendar/models/Calendar.php by phan

          Saw possibly unextractable annotation for a fragment of comment '* @param mixed id or name of the module': after mixed, did not see an element name (will guess based on comment order)
          Open

               * @param mixed id or name of the module
          Severity: Info
          Found in modules/Calendar/models/Calendar.php by phan

          Argument 1 (value) is string but \DateTimeField::__construct() takes \type defined at /code/include/fields/DateTimeField.php:31
          Open

                      $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phan

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

                      $dateTimeFieldInstance = new DateTimeField($row['date_start'] . ' ' . $row['time_start']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          LongVariable

          Since: 0.2

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

          Example

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

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

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

                      $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          LongVariable

          Since: 0.2

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

          Example

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

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

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

          class Calendar_Calendar_Model extends Vtiger_Calendar_Model

          The class Calendar_Calendar_Model is not named in CamelCase.
          Open

          class Calendar_Calendar_Model extends Vtiger_Calendar_Model
          {
              public $moduleName = 'Calendar';
              public $module;
              public $relationAcounts = [
          Severity: Minor
          Found in modules/Calendar/models/Calendar.php by phpmd

          CamelCaseClassName

          Since: 0.2

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

          Example

          class class_name {
          }

          Source

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

                  'Project' => ['vtiger_project', 'projectid', 'linktoaccountscontacts'],

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

              ];

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

                      $dbEndDate = $dbEndDateObject->format('Y-m-d');

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

                              ['<', 'date_start', $dbStartDate],

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

                          $conditions[] = ['vtiger_crmentity.smownerid' => $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

                          $item['start'] = $startDateFormated;

          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 query.

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

                          break;

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

                      $queryGenerator->addNativeCondition(['vtiger_activity.status' => $this->get('activitystatus')]);

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

                          $filterInstance = new $filterClassName();

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

                          $subQuery = (new \App\Db\Query())->select(['crmid'])->from('u_#__crmentity_showners')->where(['userid' => $selectedIds]);

          Line exceeds 120 characters; contains 137 characters
          Open

                          $subQuery = (new \App\Db\Query())->select(['crmid'])->from('u_#__crmentity_showners')->where(['userid' => $selectedIds]);

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

              public function getEntity()

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

                  $moduleModel = Vtiger_Module_Model::getInstance($this->getModuleName());

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

                          $item['url'] = 'index.php?module=' . $this->getModuleName() . '&view=EventForm&record=' . $row['id'];

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

                      $startTimeDisplay = $dateTimeFieldInstance->getDisplayTime();

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

                      $endTimeFormated = $dateTimeComponents[1];

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

                      $item['end_display'] = $endDateTimeDisplay;

          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->addCondition('activitytype', implode('##', $types), 'e');

          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

                          ],

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

                      foreach ($this->get('filters') as $filter) {

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

                          $filterClassName = Vtiger_Loader::getComponentClassName('CalendarFilter', $filter['name'], 'Calendar');

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

               * Gets entity data.

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

                      } else {

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

                      $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->getDetail('date_format'));

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

                          $item['start'] = $startDateFormated . ' ' . $startTimeFormated;

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

                              ['<=', new \yii\db\Expression("CONCAT(date_start, ' ', time_start)"), $dbEndDateTime],

          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

                      $dateComponent = $dateTimeComponents[0];

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

                      $item['allDay'] = 1 == $row['allday'];

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

              public $relationAcounts = [

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

              public function getQuery()

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

                  if ($this->get('start') && $this->get('end')) {

          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

                      }

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

                      $item['module'] = $this->getModuleName();

          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

                              'and',

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

                          if ($filterInstance->checkPermissions() && $conditions = $filterInstance->getCondition($filter['value'])) {

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

                      $item['title'] = \App\Purifier::encodeHtml($row['subject']);

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

                      $dateTimeFieldInstance = new DateTimeField($row['due_date'] . ' ' . $row['time_end']);

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

              public $module;

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

              /**

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

               * @return \App\Db\Query

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

                  if (!empty($this->get('activitystatus'))) {

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

                      $dbStartDateOject = DateTimeField::convertToDBTimeZone($this->get('start'));

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

                      }

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

                  $conditions = [];

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

                  switch ($this->get('time')) {

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

               */

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

                          break;

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

                  $colors = \App\Fields\Picklist::getColors('activitytype', false);

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

                      default:

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

                      $item['set'] = 'Task' == $row['activitytype'] ? 'Task' : 'Event';

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

                          [

          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

                          $conditions[] = ['vtiger_crmentity.crmid' => $subQuery];

          Line exceeds 120 characters; contains 121 characters
          Open

                          $item['url'] = 'index.php?module=' . $this->getModuleName() . '&view=ActivityState&record=' . $row['id'];

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

                      $dateTimeFieldInstance = new DateTimeField($row['date_start'] . ' ' . $row['time_start']);

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

                      $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->getDetail('date_format'));

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

                      //Conveting the date format in to Y-m-d . since full calendar expects in the same format

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

                      $end = new DateTime($endDateFormated);

          Line exceeds 120 characters; contains 124 characters
          Open

                      $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->getDetail('date_format'));

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

                      foreach (new DatePeriod($begin, $interval, $end) as $dt) {

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

                          $item['end'] = $endDateFormated;

          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[$dateKey]['title'] = 1;

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

                  while ($record = $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

                      $dateComponent = $dateTimeComponents[0];

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

                      $interval = DateInterval::createFromDateString('1 day');

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

                          $date = strtotime($dt->format('Y-m-d'));

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

                  if (false === $instance) {

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

                              $return[$dateKey]['activityType'] = $activityType;

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

                  return array_values($return);

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

                  $links[] = Vtiger_Link_Model::getInstanceFromValues([

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

                      $instance = new self();

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

                      'template' => 'Filters/Groups.tpl',

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

                      Vtiger_Cache::set('calendarModels', 'Calendar', clone $instance);

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

                      $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $this->getModuleName());

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

                      return $instance;

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

                      if ($success = $recordModel->isEditable()) {

          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->setField('id');

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

                      case 'history':

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

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('history')), 'e');

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

                      $dbStartDate = $dbStartDateOject->format('Y-m-d');

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

                  }

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

                      }

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

              public $moduleName = 'Calendar';

          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

                          $item['url'] = 'index.php?module=' . $this->getModuleName() . '&view=ActivityState&record=' . $row['id'];

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

                  if ($this->has('customFilter')) {

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

                      $userDateTimeString = $dateTimeFieldInstance->getFullcalenderDateTimevalue();

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

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('current')), 'e');

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

                      if ($item['allDay']) {

          Line exceeds 120 characters; contains 150 characters
          Open

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('current')), 'e');

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

                  }

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

                      } else {

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

                          [

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

                      $item['start_display'] = $startDateTimeDisplay;

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

                              ['>', 'due_date', $dbEndDate],

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

                              $query->andWhere($conditions);

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

                      $return[] = $item;

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

                      $selectedIds = $selectedUsers['selectedIds'];

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

              public function getEntityCount(): array

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

                          $conditions[] = ['not in', 'vtiger_crmentity.smownerid', $selectedUsers['excludedIds']];

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

              {

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

               * @throws \App\Exceptions\NoPermittedToRecord

          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

                  $currentUser = \App\User::getCurrentUserModel();

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

                  $request = \App\Request::init();

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

                  $editForm = \App\Config::module('Calendar', 'SHOW_EDIT_FORM');

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

                      $item = [];

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

                      $dateComponent = $dateTimeComponents[0];

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

                      //Conveting the date format in to Y-m-d . since full calendar expects in the same format

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

                      $item['className'] = 'js-popover-tooltip--record ownerCBg_' . $row['assigned_user_id'];

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

                              $return[$dateKey]['type'] = 'widget';

          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 [

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

                  $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['SIDEBARWIDGET'], $linkParams)['SIDEBARWIDGET'] ?? [];

          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(array_keys($queryGenerator->getModuleFields()));

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

                  }

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

                      $dbEndDateTime = $dbEndDateObject->format('Y-m-d H:i:s');

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

                              ['>=', new \yii\db\Expression("CONCAT(date_start, ' ', time_start)"), $dbStartDateTime],

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

                          [

          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

                  }

          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 = [];

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

                      if ($editForm && $moduleModel->getRecordFromArray($row)->setId($row['id'])->isEditable()) {

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

                      $startTimeFormated = $dateTimeComponents[1];

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

                      $dateTimeComponents = explode(' ', $userDateTimeString);

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

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

                  $colors = \App\Fields\Picklist::getColors('activitytype', false);

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

                      $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));

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

                              $return[$dateKey]['borderColor'] = $colors[$record['activitytype']] ?? '';

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

               * Static Function to get the instance of Vtiger Module Model for the given id or name.

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

              /** {@inheritdoc} */

          Line exceeds 120 characters; contains 133 characters
          Open

                  $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['SIDEBARWIDGET'], $linkParams)['SIDEBARWIDGET'] ?? [];

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

                      'filterData' => Vtiger_CalendarRightPanel_Model::getUsersList($this->moduleName),

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

              public function updateEvent(int $recordId, string $start, string $end, App\Request $request): bool

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

                  return $success;

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

                  'ServiceContracts' => ['vtiger_servicecontracts', 'servicecontractsid', 'sc_related_to'],

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

                  }

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

                      case 'current':

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

                      $dbEndDateObject = DateTimeField::convertToDBTimeZone($this->get('end'));

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

                  if ($this->has('filters')) {

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

                      if (isset($selectedUsers['excludedIds']) && 'all' === $selectedIds[0]) {

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

                  }

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

                  return $query;

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

                      $dateTimeComponents = explode(' ', $userDateTimeString);

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

                      $userDateTimeString = $dateTimeFieldInstance->getFullcalenderDateTimevalue();

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

                      $item['start_date'] = $row['date_start'];

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

                      $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));

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

                  $links[] = Vtiger_Link_Model::getInstanceFromValues([

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

                      'historyUsers' => $historyUsers,

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

                  ]);

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

                              $recordModel->set('allday', 1);

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

                          } else {

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

                          ],

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

                              ['<=', new \yii\db\Expression("CONCAT(due_date, ' ', time_end)"), $dbEndDateTime],

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

                  }

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

                      $selectedUsers = $this->get('user');

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

              }

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

                      $startDateTimeDisplay = $dateTimeFieldInstance->getDisplayDateTimeValue();

          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

                      ->createCommand()

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

                      $dateTimeComponents = explode(' ', $userDateTimeString);

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

                              $date = date('Y-m-d', $date);

          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 ($request->getBoolean('allDay')) {

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

                              $recordModel->set('time_start', $start->format('H:i:s'));

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

                          }

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

                          $recordModel->save();

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

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

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

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

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

                  if (!empty($this->get('user')) && isset($this->get('user')['selectedIds'][0])) {

          Line exceeds 120 characters; contains 122 characters
          Open

                      $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->getDetail('date_format'));

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

                      $item['hour_start'] = $startTimeDisplay;

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

               *

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

                  $endDate = strtotime($endDate->format('Y-m-d H:i:s'));

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

                  $dataReader = $this->getQuery()

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

                      $dateTimeComponents = explode(' ', $userDateTimeString);

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

                              $dateKey = $date . '__' . $activityType;

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

                  }

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

                  $historyUsers = $request->has('user') ? $request->get('user') : [];

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

                      'linktype' => 'SIDEBARWIDGET',

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

                      'linklabel' => 'LBL_USERS',

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

                      'linkclass' => 'js-group-form groupForm',

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

                  return $links;

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

                          $success = true;

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

                      $success = false;

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

                  $queryGenerator = new App\QueryGenerator($this->getModuleName());

          Line exceeds 120 characters; contains 150 characters
          Open

                          $queryGenerator->addCondition('activitystatus', implode('##', Calendar_Module_Model::getComponentActivityStateLabel('history')), 'e');

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

                          'or',

          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 ('all' !== $selectedIds[0]) {

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

                      $query->andWhere(array_merge(['or'], $conditions));

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

                  $query->orderBy('vtiger_activity.date_start,vtiger_activity.time_start');

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

               *

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

                  $startDate = strtotime($startDate->format('Y-m-d H:i:s'));

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

                      $userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);

          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

                      'template' => 'Filters/Users.tpl',

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

                      'historyUsers' => $historyUsers,

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

                          $recordModel->set('due_date', $end->format('Y-m-d'));

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

                  'Contacts' => ['vtiger_contactdetails', 'contactid', 'parentid'],

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

                  'HelpDesk' => ['vtiger_troubletickets', 'ticketid', 'parent_id'],

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

                          break;

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

                      $dbStartDateTime = $dbStartDateOject->format('Y-m-d H:i:s');

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

                              ['>=', new \yii\db\Expression("CONCAT(due_date, ' ', time_end)"), $dbStartDateTime],

          Line exceeds 120 characters; contains 123 characters
          Open

                          if ($filterInstance->checkPermissions() && $conditions = $filterInstance->getCondition($filter['value'])) {

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

                  if ($conditions) {

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

                  $dataReader = $this->getQuery()->createCommand()->query();

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

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

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

                      $item['id'] = $row['id'];

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

                      $endDateTimeDisplay = $dateTimeFieldInstance->getDisplayDateTimeValue();

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

                          $item['end'] = $endDateFormated . ' ' . $endTimeFormated;

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

                      $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);

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

                      $end->modify('+1 day');

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

                          if ($date >= $startDate && $date <= $endDate) {

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

                              } else {

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

                  $instance = Vtiger_Cache::get('calendarModels', 'Calendar');

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

                      'PLL_WORKING_TIME',

          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

                      'filterData' => Vtiger_CalendarRightPanel_Model::getGroupsList($this->moduleName),

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

                              $recordModel->set('allday', 0);

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

                      $item['borderColor'] = $colors[$row['activitytype']] ?? '';

          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

                  $endDate = DateTimeField::convertToDBTimeZone($this->get('end'));

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

                      $userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);

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

                              $return[$dateKey]['allDay'] = true;

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

                              $return[$dateKey]['start'] = $date;

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

                              if (isset($return[$dateKey]['title'])) {

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

                                  ++$return[$dateKey]['title'];

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

                              $return[$dateKey]['url'] = 'index.php?module=' . $this->getModuleName() . '&view=List&entityState=Active';

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

              /**

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

              public static function getCleanInstance()

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

                      'linktype' => 'SIDEBARWIDGET',

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

              {

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

                  try {

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

                          $start = DateTimeField::convertToDBTimeZone($start);

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

                          $end = DateTimeField::convertToDBTimeZone($end);

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

               * Gets number of events.

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

                  $startDate = DateTimeField::convertToDBTimeZone($this->get('start'));

          Line exceeds 120 characters; contains 126 characters
          Open

                              $return[$dateKey]['url'] = 'index.php?module=' . $this->getModuleName() . '&view=List&entityState=Active';

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

                  return clone $instance;

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

                      'PLL_HOLIDAY',

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

                              $recordModel->set('time_end', $end->format('H:i:s'));

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

                      ->query();

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

                      $activityType = $record['activitytype'];

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

                      $begin = new DateTime($startDateFormated);

          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

              /** {@inheritdoc} */

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

                      }

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

                  $dataReader->close();

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

                  $currentUser = Users_Record_Model::getCurrentUserModel();

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

                              $return[$dateKey]['label'] = \App\Language::translate($activityType, $this->getModuleName());

          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

                      'PLL_BREAK_TIME',

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

                  ];

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

                      $dateTimeFieldInstance = new DateTimeField($record['due_date'] . ' ' . $record['time_end']);

          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[$dateKey]['className'] = 'fc-draggable picklistCBg_Calendar_activitytype_' . $activityType;

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

               * @param mixed id or name of the module

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

              public static function getCalendarTypes()

          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\Log::error($e->__toString());

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

                      $dateComponent = $dateTimeComponents[0];

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

              public function getSideBarLinks($linkParams)

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

                      'linkclass' => 'js-users-form usersForm ',

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

                      'linklabel' => 'LBL_GROUPS',

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

                          $recordModel->set('date_start', $start->format('Y-m-d'));

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

                  } catch (Exception $e) {

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

                  }

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

          class Calendar_Calendar_Model extends Vtiger_Calendar_Model

          There are no issues that match your filters.

          Category
          Status