YetiForceCompany/YetiForceCRM

View on GitHub
modules/Project/models/Gantt.php

Summary

Maintainability
F
6 days
Test Coverage
F
0%

File Gantt.php has 564 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Gantt Model class.
 *
Severity: Major
Found in modules/Project/models/Gantt.php - About 1 day to fix

    Method getProject has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function getProject($id, $viewName = null)
        {
            if (!\is_array($id) && isset($this->tasksById[$id])) {
                return [$this->tasksById[$id]];
            }
    Severity: Major
    Found in modules/Project/models/Gantt.php - About 3 hrs to fix

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

      class Project_Gantt_Model
      {
          /**
           * @var array project tasks,milesones and projects
           */
      Severity: Minor
      Found in modules/Project/models/Gantt.php by phpmd

      Method getGanttTasks has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getGanttTasks($projectIds)
          {
              $taskTime = 0;
              $queryGenerator = new App\QueryGenerator('ProjectTask');
              $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
      Severity: Major
      Found in modules/Project/models/Gantt.php - About 2 hrs to fix

        Method getGanttMilestones has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getGanttMilestones($projectIds)
            {
                $queryGenerator = new App\QueryGenerator('ProjectMilestone');
                $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);
                $queryGenerator->addNativeCondition(['vtiger_projectmilestone.projectid' => $projectIds]);
        Severity: Major
        Found in modules/Project/models/Gantt.php - About 2 hrs to fix

          Function cleanup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              private function cleanup($tasks)
              {
                  $clean = [];
                  foreach ($tasks as $task) {
                      if (0 !== $task['id']) {
          Severity: Minor
          Found in modules/Project/models/Gantt.php - About 2 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

          Function normalizeParents has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              private function normalizeParents()
              {
                  // not set parents are children of root node
                  foreach ($this->tasks as &$task) {
                      if (!isset($task['parent']) && 0 !== $task['id']) {
          Severity: Minor
          Found in modules/Project/models/Gantt.php - About 2 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

          Function getProject has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              private function getProject($id, $viewName = null)
              {
                  if (!\is_array($id) && isset($this->tasksById[$id])) {
                      return [$this->tasksById[$id]];
                  }
          Severity: Minor
          Found in modules/Project/models/Gantt.php - About 2 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

          Project_Gantt_Model has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Project_Gantt_Model
          {
              /**
               * @var array project tasks,milesones and projects
               */
          Severity: Minor
          Found in modules/Project/models/Gantt.php - About 2 hrs to fix

            Function getStatuses has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getStatuses()
                {
                    $closingStatuses = Settings_RealizationProcesses_Module_Model::getStatusNotModify();
                    if (empty($closingStatuses['Project'])) {
                        $closingStatuses['Project'] = ['status' => []];
            Severity: Minor
            Found in modules/Project/models/Gantt.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

            Method getStatuses has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getStatuses()
                {
                    $closingStatuses = Settings_RealizationProcesses_Module_Model::getStatusNotModify();
                    if (empty($closingStatuses['Project'])) {
                        $closingStatuses['Project'] = ['status' => []];
            Severity: Minor
            Found in modules/Project/models/Gantt.php - About 1 hr to fix

              Function calculateLevels has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function calculateLevels()
                  {
                      $parents = $this->getAllParentRecordsIds();
                      foreach ($this->tasks as &$task) {
                          $task['level'] = \count($parents[$task['id']]);
              Severity: Minor
              Found in modules/Project/models/Gantt.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

              Method getById has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getById($id)
                  {
                      $this->getStatuses();
                      $projects = $this->getProject($id);
                      $title = '';
              Severity: Minor
              Found in modules/Project/models/Gantt.php - About 1 hr to fix

                Method findOutStartDates has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function findOutStartDates(&$node)
                    {
                        $maxTimeStampValue = 2147483647;
                        $firstDate = $this->iterateNodes($node, $maxTimeStampValue, function (&$child, $firstDate) {
                            if (!empty($child['start_date']) && '1970-01-01' !== $child['start_date']) {
                Severity: Minor
                Found in modules/Project/models/Gantt.php - About 1 hr to fix

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

                      private function getParentRecordsIdsRecursive($parentId, $parents = [])
                      {
                          if (empty($parentId)) {
                              return $parents;
                          }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php - About 55 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      public function getById($id)
                      {
                          $this->getStatuses();
                          $projects = $this->getProject($id);
                          $title = '';
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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

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

                      public function getGanttTasks($projectIds)
                      {
                          $taskTime = 0;
                          $queryGenerator = new App\QueryGenerator('ProjectTask');
                          $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      public function getGanttMilestones($projectIds)
                      {
                          $queryGenerator = new App\QueryGenerator('ProjectMilestone');
                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);
                          $queryGenerator->addNativeCondition(['vtiger_projectmilestone.projectid' => $projectIds]);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      private function &getRecordWithChildren(&$task)
                      {
                          foreach ($this->tasks as &$child) {
                              if (isset($child['parent']) && $child['parent'] === $task['id']) {
                                  if (empty($task['children'])) {
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  The method getProject() has an NPath complexity of 82992. The configured NPath complexity threshold is 200.
                  Open

                      private function getProject($id, $viewName = null)
                      {
                          if (!\is_array($id) && isset($this->tasksById[$id])) {
                              return [$this->tasksById[$id]];
                          }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 getStatuses() has an NPath complexity of 432. The configured NPath complexity threshold is 200.
                  Open

                      public function getStatuses()
                      {
                          $closingStatuses = Settings_RealizationProcesses_Module_Model::getStatusNotModify();
                          if (empty($closingStatuses['Project'])) {
                              $closingStatuses['Project'] = ['status' => []];
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 getStatuses() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function getStatuses()
                      {
                          $closingStatuses = Settings_RealizationProcesses_Module_Model::getStatusNotModify();
                          if (empty($closingStatuses['Project'])) {
                              $closingStatuses['Project'] = ['status' => []];
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  CyclomaticComplexity

                  Since: 0.1

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

                  Example

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

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

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

                      private function getProject($id, $viewName = null)
                      {
                          if (!\is_array($id) && isset($this->tasksById[$id])) {
                              return [$this->tasksById[$id]];
                          }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  CyclomaticComplexity

                  Since: 0.1

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

                  Example

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

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

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

                      private function findOutStartDates(&$node)
                      {
                          $maxTimeStampValue = 2147483647;
                          $firstDate = $this->iterateNodes($node, $maxTimeStampValue, function (&$child, $firstDate) {
                              if (!empty($child['start_date']) && '1970-01-01' !== $child['start_date']) {
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 18 to the 15 allowed.
                  Open

                      private function cleanup($tasks)
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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

                  Class "Project_Gantt_Model" has 21 methods, which is greater than 20 authorized. Split it into smaller classes.
                  Open

                  class Project_Gantt_Model
                  Severity: Major
                  Found in modules/Project/models/Gantt.php by sonar-php

                  A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

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

                      private function getProject($id, $viewName = null)
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by sonar-php

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

                  See

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

                      private function normalizeParents()
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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

                  Avoid using undefined variables such as '$childrenIds' which will lead to PHP notices.
                  Open

                                  $childrenIds[] = $row['id'];
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

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

                  Avoid using undefined variables such as '$childrenIds' which will lead to PHP notices.
                  Open

                              $projects = array_merge($projects, $this->getProject($childrenIds, $viewName));
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

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

                  Avoid using undefined variables such as '$queryGenerator' which will lead to PHP notices.
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

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

                  Avoid using undefined variables such as '$projectIdsRows' which will lead to PHP notices.
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

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

                  Avoid using undefined variables such as '$rootProjectIds' which will lead to PHP notices.
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

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

                  Avoid using undefined variables such as '$childrenIds' which will lead to PHP notices.
                  Open

                          if (!empty($childrenIds)) {
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

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

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

                          $queryGenerator = new App\QueryGenerator('ProjectTask');
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 '134', column '22').
                  Open

                          return ((int) (new DateTime($startDateStr))->diff(new DateTime($endDateStr), true)->format('%a')) * 24 * 60 * 60 * 1000;
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 '443', column '25').
                  Open

                          $queryGenerator = new App\QueryGenerator('Project');
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 '610', column '25').
                  Open

                          $queryGenerator = new App\QueryGenerator('ProjectMilestone');
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 '134', column '57').
                  Open

                          return ((int) (new DateTime($startDateStr))->diff(new DateTime($endDateStr), true)->format('%a')) * 24 * 60 * 60 * 1000;
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 '652', column '8').
                  Open

                      public function getGanttMilestones($projectIds)
                      {
                          $queryGenerator = new App\QueryGenerator('ProjectMilestone');
                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);
                          $queryGenerator->addNativeCondition(['vtiger_projectmilestone.projectid' => $projectIds]);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 '\App\Colors' in method 'getStatuses'.
                  Open

                              $colors['Project']['projectstatus'][$value['projectstatus']] = \App\Colors::get($value['color'] ?? '', $value['projectstatus']);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Colors' in method 'getStatuses'.
                  Open

                              $colors['ProjectMilestone']['projectmilestone_status'][$value['projectmilestone_status']] = \App\Colors::get($value['color'] ?? '', $value['projectmilestone_status']);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getProject'.
                  Open

                                  'priority_label' => \App\Language::translate($row['projectpriority'] ?? '', 'Project'),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 getProject uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $project['dependentOn'] = [$project['parentId']];
                              }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Language' in method 'getGanttTasks'.
                  Open

                                  'priority_label' => \App\Language::translate($row['projecttaskpriority'] ?? '', 'ProjectTask'),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getStatuses'.
                  Open

                              $this->statuses['Project'][] = $status = ['value' => $value['projectstatus'], 'label' => App\Language::translate($value['projectstatus'], 'Project'), 'closing' => \in_array($value['projectstatus'], $closingStatuses['Project']['status'])];
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Owner' in method 'getGanttTasks'.
                  Open

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'Settings_RealizationProcesses_Module_Model' in method 'getStatuses'.
                  Open

                          $closingStatuses = Settings_RealizationProcesses_Module_Model::getStatusNotModify();
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getStatuses'.
                  Open

                              $this->statuses['ProjectMilestone'][] = $status = ['value' => $value['projectmilestone_status'], 'label' => App\Language::translate($value['projectmilestone_status'], 'ProjectMilestone'), 'closing' => \in_array($value['projectmilestone_status'], $closingStatuses['ProjectMilestone']['status'])];
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 getGanttMilestones uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $milestone['dependentOn'] = [$milestone['parentId']];
                              }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Owner' in method 'getProject'.
                  Open

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getStatuses'.
                  Open

                          $projectMilestone = array_values(App\Fields\Picklist::getValues('projectmilestone_status'));
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getStatuses'.
                  Open

                          $project = array_values(App\Fields\Picklist::getValues('projectstatus'));
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getStatuses'.
                  Open

                          $projectTask = array_values(App\Fields\Picklist::getValues('projecttaskstatus'));
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getStatuses'.
                  Open

                          $configColors = \App\Config::module('Project', 'defaultGanttColors');
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 getProject uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $query = $queryGenerator->createQuery();
                          }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Language' in method 'getProject'.
                  Open

                                  'status_label' => App\Language::translate($row['projectstatus'], 'Project'),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 calculateLevels uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $task['hasChild'] = false;
                              }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Colors' in method 'getProject'.
                  Open

                                  'color' => ($row['projectstatus'] && isset($this->statusColors['Project']['projectstatus'][$row['projectstatus']])) ? $this->statusColors['Project']['projectstatus'][$row['projectstatus']] : \App\Colors::getRandomColor('projectstatus_' . $row['id']),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 getStatuses uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->statusColors = $colors;
                          }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Language' in method 'getGanttTasks'.
                  Open

                                  'status_label' => App\Language::translate($row['projecttaskstatus'], 'ProjectTask'),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Colors' in method 'getGanttTasks'.
                  Open

                                  'color' => ($row['projecttaskstatus'] && isset($this->statusColors['ProjectTask']['projecttaskstatus'][$row['projecttaskstatus']])) ? $this->statusColors['ProjectTask']['projecttaskstatus'][$row['projecttaskstatus']] : App\Colors::getRandomColor('projecttaskstatus_' . $row['id']),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 getAllParentRecordsIds uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $parents[$task['id']] = [];
                              }
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Colors' in method 'getGanttMilestones'.
                  Open

                                  'color' => ($row['projectmilestone_status'] && isset($this->statusColors['ProjectMilestone']['projectmilestone_status'][$row['projectmilestone_status']])) ? $this->statusColors['ProjectMilestone']['projectmilestone_status'][$row['projectmilestone_status']] : App\Colors::getRandomColor('projectmilestone_status_' . $row['id']),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 'getStatuses'.
                  Open

                              $this->statuses['ProjectTask'][] = $status = ['value' => $value['projecttaskstatus'], 'label' => App\Language::translate($value['projecttaskstatus'], 'ProjectTask'), 'closing' => \in_array($value['projecttaskstatus'], $closingStatuses['ProjectTask']['status'])];
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Colors' in method 'getStatuses'.
                  Open

                              $colors['ProjectTask']['projecttaskstatus'][$value['projecttaskstatus']] = \App\Colors::get($value['color'] ?? '', $value['projecttaskstatus']);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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\Owner' in method 'getGanttMilestones'.
                  Open

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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 "priority" 3 times.
                  Open

                                  'priority' => $queryGenerator->getModuleField('projectpriority')->getDisplayValue($row['projectpriority'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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" 5 times.
                  Open

                              $node['start'] = date('Y-m-d H:i:s', $firstDate);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "canDelete" 5 times.
                  Open

                                  'canDelete' => false,
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "sum_time" 12 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "1970-01-01" 3 times.
                  Open

                              if (!empty($child['start_date']) && '1970-01-01' !== $child['start_date']) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "cantWriteOnParent" 5 times.
                  Open

                                  'cantWriteOnParent' => false,
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projecttaskname" 3 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectmilestone_priority" 5 times.
                  Open

                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "targetenddate" 9 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectstatus" 16 times.
                  Open

                          $project = array_values(App\Fields\Picklist::getValues('projectstatus'));
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projecttask_no" 3 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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" 16 times.
                  Open

                          if ($firstDate < 0 || '2038-01-19' === date('Y-m-d', $firstDate)) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "children" 14 times.
                  Open

                                  if (empty($task['children'])) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "progress" 7 times.
                  Open

                                  if (!isset($task['progress'])) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "value" 3 times.
                  Open

                              $this->statuses['Project'][] = $status = ['value' => $value['projectstatus'], 'label' => App\Language::translate($value['projectstatus'], 'Project'), 'closing' => \in_array($value['projectstatus'], $closingStatuses['Project']['status'])];
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectname" 3 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "ProjectMilestone" 12 times.
                  Open

                          if (empty($closingStatuses['ProjectMilestone'])) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "end_date" 14 times.
                  Open

                                  $taskDate = strtotime($child['end_date']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "color" 15 times.
                  Open

                              $colors['Project']['projectstatus'][$value['projectstatus']] = \App\Colors::get($value['color'] ?? '', $value['projectstatus']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projecttaskstatus" 16 times.
                  Open

                          $projectTask = array_values(App\Fields\Picklist::getValues('projecttaskstatus'));
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "border" 3 times.
                  Open

                                      'border' => $project['color']
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "planned_duration" 3 times.
                  Open

                              $project['planned_duration'] = $project['estimated_work_time'];
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "project_no" 3 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "label" 7 times.
                  Open

                              $this->statuses['Project'][] = $status = ['value' => $value['projectstatus'], 'label' => App\Language::translate($value['projectstatus'], 'Project'), 'closing' => \in_array($value['projectstatus'], $closingStatuses['Project']['status'])];
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectmilestone_no" 3 times.
                  Open

                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "canWrite" 5 times.
                  Open

                                  'canWrite' => false,
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "dependentOn" 3 times.
                  Open

                                  $project['dependentOn'] = [$project['parentId']];
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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_date" 16 times.
                  Open

                              if (!empty($child['start_date']) && '1970-01-01' !== $child['start_date']) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by sonar-php

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

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

                  Noncompliant Code Example

                  With the default threshold of 3:

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

                  Compliant Solution

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

                  Exceptions

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

                  Define a constant instead of duplicating this literal "parent" 13 times.
                  Open

                                  if (!empty($task['parent'])) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "parents" 3 times.
                  Open

                              $task['parents'] = $parents[$task['id']];
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "" href="" 3 times.
                  Open

                              $project['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $project['no'] . '" href="' . $project['url'] . '" target="_blank" rel="noreferrer noopener">' . $project['no'] . '</a>';
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by sonar-php

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

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

                  Noncompliant Code Example

                  With the default threshold of 3:

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

                  Compliant Solution

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

                  Exceptions

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

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

                                  'module' => 'Project',
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "closing" 6 times.
                  Open

                              $this->statuses['Project'][] = $status = ['value' => $value['projectstatus'], 'label' => App\Language::translate($value['projectstatus'], 'Project'), 'closing' => \in_array($value['projectstatus'], $closingStatuses['Project']['status'])];
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "assigned_user_id" 12 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "assigned_user_name" 3 times.
                  Open

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "ProjectTask" 14 times.
                  Open

                          if (empty($closingStatuses['ProjectTask'])) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectpriority" 4 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "<a class="showReferenceTooltip js-popover-tooltip--record" title="" times.></a>
                  Open

                              $project['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $project['no'] . '" href="' . $project['url'] . '" target="_blank" rel="noreferrer noopener">' . $project['no'] . '</a>';
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "number" 3 times.
                  Open

                              $project['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $project['no'] . '" href="' . $project['url'] . '" target="_blank" rel="noreferrer noopener">' . $project['no'] . '</a>';
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "estimated_work_time" 16 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "parentId" 11 times.
                  Open

                                  'parentId' => !empty($row['parentid']) ? $row['parentid'] : null,
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectmilestone_status" 17 times.
                  Open

                          $projectMilestone = array_values(App\Fields\Picklist::getValues('projectmilestone_status'));
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "priority_label" 3 times.
                  Open

                                  'priority_label' => \App\Language::translate($row['projectpriority'] ?? '', 'Project'),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "depends" 3 times.
                  Open

                                      $task['depends'] = '';
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projecttaskpriority" 4 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "status_label" 3 times.
                  Open

                                  'status_label' => App\Language::translate($row['projectstatus'], 'Project'),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "startdate" 7 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "parentid" 11 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "style" 3 times.
                  Open

                              $project['style'] = [
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectid" 8 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "canAdd" 5 times.
                  Open

                                  'canAdd' => false,
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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" 5 times.
                  Open

                              $node['start'] = date('Y-m-d H:i:s', $firstDate);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "duration" 5 times.
                  Open

                              $node['duration'] = 24 * 60 * 60 * 1000;
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "normalized_status" 3 times.
                  Open

                                  'normalized_status' => $queryGenerator->getModuleField('projectstatus')->getDisplayValue($row['projectstatus'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "Project" 15 times.
                  Open

                          if (empty($closingStatuses['Project'])) {
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "status" 9 times.
                  Open

                              $closingStatuses['Project'] = ['status' => []];
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "projectmilestonename" 3 times.
                  Open

                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "description" 4 times.
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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 "STATUS_ACTIVE" 3 times.
                  Open

                                  'status' => 'STATUS_ACTIVE',
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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.

                  Avoid unused local variables such as '$projectIdsRows'.
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

                  Detects when a local variable is declared and/or assigned, but not used.

                  Example

                  class Foo {
                      public function doSomething()
                      {
                          $i = 5; // Unused
                      }
                  }

                  Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                  Avoid unused local variables such as '$queryGenerator'.
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

                  Detects when a local variable is declared and/or assigned, but not used.

                  Example

                  class Foo {
                      public function doSomething()
                      {
                          $i = 5; // Unused
                      }
                  }

                  Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                  Avoid unused local variables such as '$rootProjectIds'.
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

                  Detects when a local variable is declared and/or assigned, but not used.

                  Example

                  class Foo {
                      public function doSomething()
                      {
                          $i = 5; // Unused
                      }
                  }

                  Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

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

                              $milestoneName = $queryGenerator->getModuleField('projectmilestonename')->getDisplayValue($row['projectmilestonename'], $row['id'], false, true);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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/Project/models/Gantt.php by phan

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

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'no' => $queryGenerator->getModuleField('projecttask_no')->getDisplayValue($row['projecttask_no'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Call to method getUserLabel from undeclared class \App\Fields\Owner
                  Open

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Parameter $tasks has undeclared type \task[]
                  Open

                      private function cleanup($tasks)
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

                  Suspicious array access to \task
                  Open

                                      $task['depends'] = '';
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'normalized_status' => $queryGenerator->getModuleField('projectstatus')->getDisplayValue($row['projectstatus'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                          $queryGenerator = new App\QueryGenerator('ProjectMilestone');
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'estimated_work_time' => $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'priority' => $queryGenerator->getModuleField('projecttaskpriority')->getDisplayValue($row['projecttaskpriority'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Return type of flattenRecordTasks() is undeclared type \task[]
                  Open

                      private function flattenRecordTasks($nodes, $flat = [])
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

                  Suspicious attempt to unset an offset of a value of type \task
                  Open

                                      unset($task['parent']);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

                  Variable $rootProjectIds is undeclared
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

                  Return type of getGanttMilestones() is undeclared type \milestone[]
                  Open

                      public function getGanttMilestones($projectIds)
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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/Project/models/Gantt.php by phan

                  Variable $queryGenerator is undeclared
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'status_label' => $queryGenerator->getModuleField('projectmilestone_status')->getDisplayValue($row['projectmilestone_status'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'normalized_status' => $queryGenerator->getModuleField('projecttaskstatus')->getDisplayValue($row['projecttaskstatus'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'estimated_work_time' => $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Variable $childrenIds was undeclared, but array fields are being added to it.
                  Open

                                  $childrenIds[] = $row['id'];
                  Severity: Info
                  Found in modules/Project/models/Gantt.php by phan

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

                              $projectName = $queryGenerator->getModuleField('projectname')->getDisplayValue($row['projectname'], $row['id'], false, true);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                          $queryGenerator->addNativeCondition(['vtiger_projectmilestone.projectid' => $projectIds]);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Variable $projectIdsRows is undeclared
                  Open

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

                  Return type of cleanup() is undeclared type \task[]
                  Open

                      private function cleanup($tasks)
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

                  Return type of getGanttTasks() is undeclared type \task[]
                  Open

                      public function getGanttTasks($projectIds)
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'no' => $queryGenerator->getModuleField('project_no')->getDisplayValue($row['project_no'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Call to method getUserLabel from undeclared class \App\Fields\Owner
                  Open

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                          $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                              $task['planned_duration'] = $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Suspicious array access to \task
                  Open

                              if (0 !== $task['id']) {
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

                  Suspicious array access to \task
                  Open

                                  if (0 === $task['parent']) {
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phan

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

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

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

                                  'priority_label' => $queryGenerator->getModuleField('projectmilestone_priority')->getDisplayValue($row['projectmilestone_priority'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

                  Call to method getUserLabel from undeclared class \App\Fields\Owner
                  Open

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  $milestone['v'] = $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                              $taskName = $queryGenerator->getModuleField('projecttaskname')->getDisplayValue($row['projecttaskname'], $row['id'], false, true);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                          $queryGenerator = new App\QueryGenerator('ProjectTask');
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.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/Project/models/Gantt.php by phan

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

                                  'priority' => $queryGenerator->getModuleField('projectpriority')->getDisplayValue($row['projectpriority'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'no' => $queryGenerator->getModuleField('projectmilestone_no')->getDisplayValue($row['projectmilestone_no'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                          $queryGenerator = new App\QueryGenerator('Project');
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                              $query = $queryGenerator->getCustomViewQueryById($viewName);
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'description' => $queryGenerator->getModuleField('description')->getDisplayValue($row['description'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'normalized_status' => $queryGenerator->getModuleField('projectmilestone_status')->getDisplayValue($row['projectmilestone_status'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

                                  'priority' => $queryGenerator->getModuleField('projectmilestone_priority')->getDisplayValue($row['projectmilestone_priority'], $row['id'], false, true),
                  Severity: Critical
                  Found in modules/Project/models/Gantt.php by phan

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

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

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                          foreach ($project as $value) {
                              $this->statuses['Project'][] = $status = ['value' => $value['projectstatus'], 'label' => App\Language::translate($value['projectstatus'], 'Project'), 'closing' => \in_array($value['projectstatus'], $closingStatuses['Project']['status'])];
                              if (!$status['closing']) {
                                  $this->activeStatuses['Project'][] = $status;
                              }
                  Severity: Major
                  Found in modules/Project/models/Gantt.php and 2 other locations - About 3 hrs to fix
                  modules/Project/models/Gantt.php on lines 389..395
                  modules/Project/models/Gantt.php on lines 397..403

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 152.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                          foreach ($projectMilestone as $value) {
                              $this->statuses['ProjectMilestone'][] = $status = ['value' => $value['projectmilestone_status'], 'label' => App\Language::translate($value['projectmilestone_status'], 'ProjectMilestone'), 'closing' => \in_array($value['projectmilestone_status'], $closingStatuses['ProjectMilestone']['status'])];
                              if (!$status['closing']) {
                                  $this->activeStatuses['ProjectMilestone'][] = $status;
                              }
                  Severity: Major
                  Found in modules/Project/models/Gantt.php and 2 other locations - About 3 hrs to fix
                  modules/Project/models/Gantt.php on lines 381..387
                  modules/Project/models/Gantt.php on lines 397..403

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 152.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                          foreach ($projectTask as $value) {
                              $this->statuses['ProjectTask'][] = $status = ['value' => $value['projecttaskstatus'], 'label' => App\Language::translate($value['projecttaskstatus'], 'ProjectTask'), 'closing' => \in_array($value['projecttaskstatus'], $closingStatuses['ProjectTask']['status'])];
                              if (!$status['closing']) {
                                  $this->activeStatuses['ProjectTask'][] = $status;
                              }
                  Severity: Major
                  Found in modules/Project/models/Gantt.php and 2 other locations - About 3 hrs to fix
                  modules/Project/models/Gantt.php on lines 381..387
                  modules/Project/models/Gantt.php on lines 389..395

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 152.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  class Project_Gantt_Model

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

                      private function getProject($id, $viewName = null)
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  ShortVariable

                  Since: 0.2

                  Detects when a field, local, or parameter has a very short name.

                  Example

                  class Something {
                      private $q = 15; // VIOLATION - Field
                      public static function main( array $as ) { // VIOLATION - Formal
                          $r = 20 + $this->q; // VIOLATION - Local
                          for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                              $r += $this->q;
                          }
                      }
                  }

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

                  The class Project_Gantt_Model is not named in CamelCase.
                  Open

                  class Project_Gantt_Model
                  {
                      /**
                       * @var array project tasks,milesones and projects
                       */
                  Severity: Minor
                  Found in modules/Project/models/Gantt.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

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

                      public function getById($id)
                  Severity: Minor
                  Found in modules/Project/models/Gantt.php by phpmd

                  ShortVariable

                  Since: 0.2

                  Detects when a field, local, or parameter has a very short name.

                  Example

                  class Something {
                      private $q = 15; // VIOLATION - Field
                      public static function main( array $as ) { // VIOLATION - Formal
                          $r = 20 + $this->q; // VIOLATION - Local
                          for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                              $r += $this->q;
                          }
                      }
                  }

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

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

                      /**

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

                                      $parents = $this->getParentRecordsIdsRecursive($task['parent'], $parents);

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

                       */

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

                      private function getAllParentRecordsIds()

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

                          }

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

                       * Calculate task levels and dependencies.

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

                       * Calculate duration in seconds.

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

                       * @var array if some task is already loaded get it from here

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

                       * Get parent nodes id as associative array [taskId]=>[parentId1,parentId2,...].

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

                          if (empty($parentId)) {

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

                                  break;

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

                          foreach ($parents as $parentsId) {

                  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->tasks as &$task) {

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

                       * @var array rootNode needed for tree generation process

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

                      /**

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

                       * @param array      $parents  initial value

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

                              if (!empty($task['parent'])) {

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

                                  $parents[$task['id']] = $this->getParentRecordsIdsRecursive($task['parent']);

                  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

                              if (\in_array($task['id'], $hasChild)) {

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

                              }

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

                      {

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

                      /**

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

                              }

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

                      public $statusColors = [];

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

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

                          }

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

                       * Normalize task parent property set as 0 if not exists (root node).

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

                       * @var array project tasks,milesones and projects

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

                      private $tree = [];

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

                      private $tasksById = [];

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

                       */

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

                                  $parents[$task['id']] = [];

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

                      /**

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

                       */

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

                          // not set parents are children of root node

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

                                  $idExists = false;

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

                       */

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

                      /**

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

                              return $parents;

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

                                  $task['hasChild'] = true;

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

                      /**

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

                      private $statuses;

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

                              if ($task['id'] === $parentId) {

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

                          // if parent id is set but we don't have it - it means that project is subproject so connect it to root node

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

                              if (!empty($task['parent'])) {

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

                       * @var array colors for statuses

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

                       * @var array statuses - with closing value

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

                          if (!\in_array($parentId, $parents)) {

                  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

                       * Collect all parents of all tasks.

                  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->tasks as $task) {

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

                      }

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

                              }

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

                       * @param string $startDateStr

                  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

                       * @var array task nodes as tree with children

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

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

                       *

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

                       * @return int

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

                      private function normalizeParents()

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

                                  $task['parent'] = 0;

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

                      private $activeStatuses;

                  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

                      {

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

                          foreach ($this->tasks as &$task) {

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

                              foreach ($parentsId as $parentId) {

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

                       * @param string $endDateStr

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

                      private $tasks = [];

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

                       */

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

                       */

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

                       */

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

                       *

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

                      {

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

                          unset($task);

                  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

                                  $task['hasChild'] = false;

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

                          unset($parents);

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

                       */

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

                      private $rootNode;

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

                      /**

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

                          }

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

                          foreach ($this->tasks as $task) {

                  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

                          $parents = $this->getAllParentRecordsIds();

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

                              $task['level'] = \count($parents[$task['id']]);

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

                                  if (!\in_array($parentId, $hasChild)) {

                  Line exceeds 120 characters; contains 128 characters
                  Open

                          return ((int) (new DateTime($startDateStr))->diff(new DateTime($endDateStr), true)->format('%a')) * 24 * 60 * 60 * 1000;

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

                       */

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

                              }

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

                       * @return array

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

                      private function calculateLevels()

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

                          $hasChild = [];

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

                      /**

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

                       * @var array - without closing value - for JS filter

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

                              $parents[] = $parentId;

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

                          }

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

                      private function calculateDuration($startDateStr, $endDateStr): int

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

                      }

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

                              if (!isset($task['parent']) && 0 !== $task['id']) {

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

                          }

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

                      /**

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

                       *

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

                       * @param int|string $parentId

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

                       */

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

                      private function getParentRecordsIdsRecursive($parentId, $parents = [])

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

                          $parents = [];

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

                                  if (!empty($task['parent'])) {

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

                              }

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

                              $task['parents'] = $parents[$task['id']];

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

                      /**

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

                                      $hasChild[] = $parentId;

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

                          return ((int) (new DateTime($startDateStr))->diff(new DateTime($endDateStr), true)->format('%a')) * 24 * 60 * 60 * 1000;

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

                          foreach ($this->tasks as &$task) {

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

                      }

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

                      {

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

                          foreach ($this->tasks as &$task) {

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

                       * @param       $nodes tasks tree

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

                              if (!empty($node['children'])) {

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

                       */

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

                                  if (0 === $task['parent']) {

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

                                      unset($task['children']);

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

                       * @param callable $callback     what to do with task

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

                              if (!empty($child['start_date']) && '1970-01-01' !== $child['start_date']) {

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

                                  $task['children'][] = &$this->getRecordWithChildren($child);

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

                       */

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

                      private function cleanup($tasks)

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

                                      unset($task['parent']);

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

                                  $clean[] = $task;

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

                       *

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

                          if (empty($node['children'])) {

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

                          }

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

                                  }

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

                          if (empty($node['start_date'])) {

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

                       * @return array task with parents property int[]

                  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

                          $this->tree = &$this->getRecordWithChildren($this->rootNode);

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

                              $currentValue = $callback($child, $currentValue);

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

                       *

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

                              $node['start'] = date('Y-m-d H:i:s', $firstDate);

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

                              }

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

                       *

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

                              }

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

                      }

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

                       *

                  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 (isset($task['parents'])) {

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

                          return $clean;

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

                                  if (!$idExists) {

                  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

                       * Collect task all parent nodes.

                  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

                       * Remove root node and children because they are not needed anymore.

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

                       * @param task[] $tasks

                  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

                                          $idExists = true;

                  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

                          }

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

                      private function collectChildrens()

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

                      }

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

                                      unset($task['depends']);

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

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

                          return $currentValue;

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

                              return $firstDate;

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

                              $firstDate = strtotime(date('Y-m-d'));

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

                                  foreach ($this->tasks as $parent) {

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

                                      if ($task['parent'] === $parent['id']) {

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

                      }

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

                      private function &getRecordWithChildren(&$task)

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

                                  if (empty($task['children'])) {

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

                       * Flatten task tree with proper order to use it in frontend gantt lib.

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

                       */

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

                       */

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

                      /**

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

                       *

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

                       *

                  Line exceeds 120 characters; contains 123 characters
                  Open

                       * @param mixed    $currentValue initial result which will be evaluated if there are some child nodes like array reduce

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

                                  $currentValue = $this->iterateNodes($child, $currentValue, $callback);

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

                              }

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

                                      $task['parent'] = 0;

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

                                      $task['children'] = [];

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

                       * Add root node to generate tree structure.

                  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 mixed

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

                          }

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

                          $this->iterateNodes($node, $firstDate, function (&$child, $firstDate) {

                  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

                          array_unshift($this->tasks, $this->rootNode);

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

                                      unset($task['parents']);

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

                                  if (isset($task['depends'])) {

                  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 ($firstDate < 0 || '2038-01-19' === date('Y-m-d', $firstDate)) {

                  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

                       * @param array $flat  initial array

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

                                  if (isset($task['children'])) {

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

                                      $task['progress'] = 100;

                  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 (isset($child['parent']) && $child['parent'] === $task['id']) {

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

                          foreach ($nodes as $node) {

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

                       * Sort all node types (task,milestones,projects) so each parent task is before its child (frontend lib needs this).

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

                      /**

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

                      private function addRootNode()

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

                          foreach ($tasks as $task) {

                  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

                       * Iterate through children and search for start date.

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

                                  if ($taskStartDate < $firstDate && $taskStartDate > 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

                              $flat[] = $node;

                  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 task[] new array (not mutated)

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

                          $clean = [];

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

                              if (0 !== $task['id']) {

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

                                      $task['depends'] = '';

                  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

                       * Iterate through all tasks in tree.

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

                       * @param array    $node         starting point - might by rootNode

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

                          foreach ($node['children'] as &$child) {

                  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

                              $node['duration'] = 24 * 60 * 60 * 1000;

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

                              $node['start_date'] = date('Y-m-d', $firstDate);

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

                          // iterate one more time setting up empty dates

                  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 task[]

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

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

                      public function iterateNodes(&$node, $currentValue, $callback)

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

                              if (!empty($child['children'])) {

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

                      private function findOutStartDates(&$node)

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

                       * @param array $task

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

                                  $flat = $this->flattenRecordTasks($node['children'], $flat);

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

                       * @param array $node

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

                          $maxTimeStampValue = 2147483647;

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

                          $firstDate = $this->iterateNodes($node, $maxTimeStampValue, function (&$child, $firstDate) {

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

                                      return $taskStartDate;

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

                              if (empty($child['start_date']) || '1970-01-01' === $child['start_date']) {

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

                          return $task;

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

                      private function flattenRecordTasks($nodes, $flat = [])

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

                          $this->rootNode = ['id' => 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

                                  $taskStartDate = strtotime($child['start_date']);

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

                          foreach ($this->tasks as &$child) {

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

                          }

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

                      {

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

                                  }

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

                                  if (!isset($task['progress'])) {

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

                       * @param mixed    $currentValue initial result which will be evaluated if there are some child nodes like array reduce

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

                       * @return int timestamp

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

                          });

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

                          }

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

                              }

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

                       *

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

                              return $lastDate;

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

                       */

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

                          if (empty($closingStatuses['ProjectTask'])) {

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

                              if (!$status['closing']) {

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

                          foreach ($projectMilestone as $value) {

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

                              }

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

                       * Get project data.

                  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

                          return $firstDate;

                  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

                              $closingStatuses['Project'] = ['status' => []];

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

                      }

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

                          $this->findOutStartDates($this->rootNode);

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

                      /**

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

                              $id = [$id];

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

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_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

                      {

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

                                  if ($taskDate > $lastDate) {

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

                          });

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

                          $projectMilestone = array_values(App\Fields\Picklist::getValues('projectmilestone_status'));

                  Line exceeds 120 characters; contains 156 characters
                  Open

                              $colors['ProjectTask']['projecttaskstatus'][$value['projecttaskstatus']] = \App\Colors::get($value['color'] ?? '', $value['projecttaskstatus']);

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

                          $this->calculateLevels();

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

                              return [$this->tasksById[$id]];

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

                          if (!\is_array($id)) {

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

                       * @param array $node

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

                      }

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

                      private function calculateDurations()

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

                      {

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

                          if (empty($closingStatuses['ProjectMilestone'])) {

                  Line exceeds 120 characters; contains 274 characters
                  Open

                              $this->statuses['ProjectTask'][] = $status = ['value' => $value['projecttaskstatus'], 'label' => App\Language::translate($value['projecttaskstatus'], 'ProjectTask'), 'closing' => \in_array($value['projecttaskstatus'], $closingStatuses['ProjectTask']['status'])];

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

                                  $this->activeStatuses['ProjectTask'][] = $status;

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

                          $this->calculateDurations();

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

                       * Iterate through children and search for end date.

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

                      private function findOutEndDates(&$node)

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

                                  $taskDate = strtotime($child['end_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

                       */

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

                          }

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

                          $project = array_values(App\Fields\Picklist::getValues('projectstatus'));

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

                          if (!empty($configColors)) {

                  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

                       * @return int timestamp

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

                          $lastDate = $this->iterateNodes($node, 0, function (&$child, $lastDate) {

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

                          if (empty($closingStatuses['Project'])) {

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

                          foreach ($project as $value) {

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

                              }

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

                          }

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

                              $this->statusColors = $colors;

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

                          }

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

                       *

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

                       */

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

                          if (!\is_array($id) && isset($this->tasksById[$id])) {

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

                          if ($viewName) {

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

                       */

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

                              if (!empty($child['start_date']) && '1970-01-01' !== $child['start_date']) {

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

                          // iterate one more time setting up empty dates

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

                              $closingStatuses['ProjectMilestone'] = ['status' => []];

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

                              if (!$status['closing']) {

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

                              $this->statusColors = $configColors;

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

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

                              if (empty($task['duration']) && isset($task['start_date'], $task['end_date'])) {

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

                                  $this->activeStatuses['ProjectMilestone'][] = $status;

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

                          $projectTask = array_values(App\Fields\Picklist::getValues('projecttaskstatus'));

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

                       */

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

                       *

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

                       * @return array

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

                          } 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

                       *

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

                       * Calculate task duration in days.

                  Line exceeds 120 characters; contains 250 characters
                  Open

                              $this->statuses['Project'][] = $status = ['value' => $value['projectstatus'], 'label' => App\Language::translate($value['projectstatus'], 'Project'), 'closing' => \in_array($value['projectstatus'], $closingStatuses['Project']['status'])];

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

                          }

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

                              $this->statuses['ProjectMilestone'][] = $status = ['value' => $value['projectmilestone_status'], 'label' => App\Language::translate($value['projectmilestone_status'], 'ProjectMilestone'), 'closing' => \in_array($value['projectmilestone_status'], $closingStatuses['ProjectMilestone']['status'])];

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

                       * Prepare tasks and gather some information.

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

                              // empty id means that we want all projects

                  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

                          $this->iterateNodes($node, $lastDate, function (&$child, $lastDate) {

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

                      public function getStatuses()

                  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['ProjectTask']['projecttaskstatus'][$value['projecttaskstatus']] = \App\Colors::get($value['color'] ?? '', $value['projecttaskstatus']);

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

                          $this->addRootNode();

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

                          $projects = [];

                  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

                              $node['end'] = $lastDate;

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

                                  $child['end_date'] = date('Y-m-d', $lastDate);

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

                                  $task['duration'] = $this->calculateDuration($task['start_date'], $task['end_date']);

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

                       * Collect all statuses.

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

                      {

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

                          $closingStatuses = Settings_RealizationProcesses_Module_Model::getStatusNotModify();

                  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['Project']['projectstatus'][$value['projectstatus']] = \App\Colors::get($value['color'] ?? '', $value['projectstatus']);

                  Line exceeds 120 characters; contains 140 characters
                  Open

                              $colors['Project']['projectstatus'][$value['projectstatus']] = \App\Colors::get($value['color'] ?? '', $value['projectstatus']);

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

                      private function prepareRecords()

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

                      {

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

                          $queryGenerator = new App\QueryGenerator('Project');

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

                              $lastDate = strtotime(date('Y-m-d'));

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

                          if (empty($node['end_date'])) {

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

                          if (0 === $lastDate) {

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

                                  $child['end'] = $lastDate;

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

                              if (empty($child['end_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

                          return $lastDate;

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

                          foreach ($this->tasks as &$task) {

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

                              }

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

                              $closingStatuses['ProjectTask'] = ['status' => []];

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

                          $colors = ['Project' => [], 'ProjectMilestone' => [], 'ProjectTask' => []];

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

                                  $this->activeStatuses['Project'][] = $status;

                  Line exceeds 120 characters; contains 307 characters
                  Open

                              $this->statuses['ProjectMilestone'][] = $status = ['value' => $value['projectmilestone_status'], 'label' => App\Language::translate($value['projectmilestone_status'], 'ProjectMilestone'), 'closing' => \in_array($value['projectmilestone_status'], $closingStatuses['ProjectMilestone']['status'])];

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

                              }

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

                       * @param mixed|null $viewName

                  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

                      private function getProject($id, $viewName = null)

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

                          $this->collectChildrens();

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

                      }

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

                       * @param array|int  $id       project id

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

                          }

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

                          if ($id !== [0]) {

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

                                  $child['start_date'] = date('Y-m-d', $firstDate);

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

                              return $firstDate;

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

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

                      /**

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

                          $this->findOutEndDates($this->rootNode);

                  Line exceeds 120 characters; contains 262 characters
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'parentid', 'projectname', 'projectpriority', 'description', 'project_no', 'projectstatus', 'sum_time', 'startdate', 'actualenddate', 'targetenddate', 'progress', 'assigned_user_id', 'estimated_work_time']);

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

                              $query = $queryGenerator->getCustomViewQueryById($viewName);

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

                                  $child['start'] = date('Y-m-d H:i:s', $firstDate);

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

                              $node['end_date'] = date('Y-m-d', $lastDate);

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

                          }

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

                              $this->statuses['Project'][] = $status = ['value' => $value['projectstatus'], 'label' => App\Language::translate($value['projectstatus'], 'Project'), 'closing' => \in_array($value['projectstatus'], $closingStatuses['Project']['status'])];

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

                              $this->statuses['ProjectTask'][] = $status = ['value' => $value['projecttaskstatus'], 'label' => App\Language::translate($value['projecttaskstatus'], 'ProjectTask'), 'closing' => \in_array($value['projecttaskstatus'], $closingStatuses['ProjectTask']['status'])];

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

                          $this->normalizeParents();

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

                                      return $taskDate;

                  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

                              $colors['ProjectMilestone']['projectmilestone_status'][$value['projectmilestone_status']] = \App\Colors::get($value['color'] ?? '', $value['projectmilestone_status']);

                  Line exceeds 120 characters; contains 179 characters
                  Open

                              $colors['ProjectMilestone']['projectmilestone_status'][$value['projectmilestone_status']] = \App\Colors::get($value['color'] ?? '', $value['projectmilestone_status']);

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

                              if (!$status['closing']) {

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

                          }

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

                          $configColors = \App\Config::module('Project', 'defaultGanttColors');

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

                          }

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

                                  ['parentid' => $id],

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

                                  ['projectid' => array_diff($id, array_keys($this->tasksById))]

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

                                  $project['end'] = strtotime($project['end_date']);

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

                       * @param mixed|null $viewName

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

                          $projectIds = array_column($projects, 'id');

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

                          $milestones = $this->getGanttMilestones($projectIds);

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

                          $this->tasks = array_merge($projects, $milestones, $ganttTasks);

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

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),

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

                                  'open' => true,

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

                                  $project['start'] = date('Y-m-d H:i:s', strtotime($row['startdate']));

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

                          return $projects;

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

                          $ganttTasks = $this->getGanttTasks($projectIds);

                  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

                              'activeStatuses' => $this->activeStatuses,

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

                                  'no' => $queryGenerator->getModuleField('project_no')->getDisplayValue($row['project_no'], $row['id'], false, true),

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

                                      $title = $project['label'];

                  Line exceeds 120 characters; contains 266 characters
                  Open

                                  'color' => ($row['projectstatus'] && isset($this->statusColors['Project']['projectstatus'][$row['projectstatus']])) ? $this->statusColors['Project']['projectstatus'][$row['projectstatus']] : \App\Colors::getRandomColor('projectstatus_' . $row['id']),

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

                              unset($project['color']);

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

                              $projects[] = $project;

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

                          }

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

                          $this->prepareRecords();

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

                                  'progress' => (int) $row['progress'],

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

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

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

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),

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

                       * @return array projects,milestones,tasks

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

                          ];

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

                          if (!empty($this->tree) && !empty($this->tree['children'])) {

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

                          $this->getStatuses();

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

                              foreach ($projects as $project) {

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

                          $this->tasks = array_merge($projects, $milestones, $ganttTasks);

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

                          }

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

                                  'name' => $projectName,

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

                                  'status_label' => App\Language::translate($row['projectstatus'], 'Project'),

                  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(date('Y-m-d', strtotime($row['targetenddate'])) . ' +1 days');

                  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

                          $projectIds = array_merge($projectIds, array_column($milestones, 'id'));

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

                              'title' => $title

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

                          if (!empty($this->tree) && !empty($this->tree['children'])) {

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

                              $response['tasks'] = $this->cleanup($this->flattenRecordTasks($this->tree['children']));

                  Line exceeds 120 characters; contains 137 characters
                  Open

                              $projectName = $queryGenerator->getModuleField('projectname')->getDisplayValue($row['projectname'], $row['id'], false, true);

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

                                  'parentId' => !empty($row['parentid']) ? $row['parentid'] : null,

                  Line exceeds 120 characters; contains 143 characters
                  Open

                                  'description' => $queryGenerator->getModuleField('description')->getDisplayValue($row['description'], $row['id'], false, true),

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

                                  'color' => ($row['projectstatus'] && isset($this->statusColors['Project']['projectstatus'][$row['projectstatus']])) ? $this->statusColors['Project']['projectstatus'][$row['projectstatus']] : \App\Colors::getRandomColor('projectstatus_' . $row['id']),

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

                              ];

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

                                  unset($project['parentId']);

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

                                  $project['end_date'] = date('Y-m-d', $endDate);

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

                              $project['style'] = [

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

                                      'fill' => $project['color'],

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

                              if ($id !== [0] && !\in_array($row['id'], $id)) {

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

                          }

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

                       */

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

                              'cantWriteOnParent' => false,

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

                      {

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

                          $projects = $this->getProject($id);

                  Line exceeds 120 characters; contains 134 characters
                  Open

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),

                  Line exceeds 120 characters; contains 153 characters
                  Open

                                  'normalized_status' => $queryGenerator->getModuleField('projectstatus')->getDisplayValue($row['projectstatus'], $row['id'], false, true),

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

                              if (!empty($row['startdate'])) {

                  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

                              'canWrite' => false,

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

                          if (!empty((int) $id)) {

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

                              'canDelete' => false,

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

                              $project = [

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

                                  'canDelete' => false,

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

                              if (empty($project['parentId'])) {

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

                              $project['target_end_date'] = $row['targetenddate'] ? date('Y-m-d', strtotime($row['targetenddate'])) : '';

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

                      {

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

                          $projects = $this->getProject(0, $viewName);

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

                          $response = [

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

                              'statusColors' => $this->statusColors,

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

                              $response['tasks'] = $this->cleanup($this->flattenRecordTasks($this->tree['children']));

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

                          $projectIds = array_column($projects, 'id');

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

                              'canAdd' => false,

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

                                  'priority_label' => \App\Language::translate($row['projectpriority'] ?? '', 'Project'),

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

                              $project['planned_duration'] = $project['estimated_work_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

                      public function getAllData($viewName = null)

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

                              'canAdd' => false,

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

                      /**

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

                       * @param int|string $id

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

                              'cantWriteOnParent' => false,

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

                              $projectName = $queryGenerator->getModuleField('projectname')->getDisplayValue($row['projectname'], $row['id'], false, true);

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

                                  'module' => 'Project',

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

                                  'canAdd' => false,

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

                              ];

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

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

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

                      }

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

                       *

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

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

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

                                  'label' => $projectName,

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

                                  'url' => 'index.php?module=Project&view=Detail&record=' . $row['id'],

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

                                  'canWrite' => false,

                  Line exceeds 120 characters; contains 225 characters
                  Open

                              $project['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $project['no'] . '" href="' . $project['url'] . '" target="_blank" rel="noreferrer noopener">' . $project['no'] . '</a>';

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

                                  $project['dependentOn'] = [$project['parentId']];

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

                          if (!empty($childrenIds)) {

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

                          unset($queryGenerator, $query, $dataReader, $project);

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

                          unset($projects, $projectIds, $milestones, $ganttTasks);

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

                          return $response;

                  Line exceeds 120 characters; contains 148 characters
                  Open

                                  'priority' => $queryGenerator->getModuleField('projectpriority')->getDisplayValue($row['projectpriority'], $row['id'], false, true),

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

                                  'estimated_work_time' => $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true),

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

                              $project['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $project['no'] . '" href="' . $project['url'] . '" target="_blank" rel="noreferrer noopener">' . $project['no'] . '</a>';

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

                              if (empty($project['end_date']) && !empty($row['targetenddate'])) {

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

                       * Get all projects from the system.

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

                       */

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

                      public function getById($id)

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

                              'canWrite' => false,

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

                                  'base' => [

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

                                      'border' => $project['color']

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

                          $this->getStatuses();

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

                      }

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

                              'activeStatuses' => $this->activeStatuses,

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

                                  'priority' => $queryGenerator->getModuleField('projectpriority')->getDisplayValue($row['projectpriority'], $row['id'], false, true),

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

                          $dataReader->close();

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

                      /**

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

                       *

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

                              'statuses' => $this->statuses,

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

                          return $response;

                  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 - projects,milestones,tasks

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

                                  if ($project['id'] === $id) {

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

                          $ganttTasks = $this->getGanttTasks($projectIds);

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

                              'statusColors' => $this->statusColors,

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

                                  'type' => 'project',

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

                                  'description' => $queryGenerator->getModuleField('description')->getDisplayValue($row['description'], $row['id'], false, true),

                  Line exceeds 120 characters; contains 132 characters
                  Open

                                  'no' => $queryGenerator->getModuleField('project_no')->getDisplayValue($row['project_no'], $row['id'], false, true),

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

                                  $project['start_date'] = date('Y-m-d', strtotime($row['startdate']));

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

                              $project['end_date'] = $row['actualenddate'] ?: $row['targetenddate'] ?: '';

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

                              $projects = array_merge($projects, $this->getProject($childrenIds, $viewName));

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

                          }

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

                          unset($projectIds, $milestones, $ganttTasks, $projects, $queryGenerator, $rootProjectIds, $projectIdsRows);

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

                       *

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

                          $this->prepareRecords();

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

                          }

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

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

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

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

                  Line exceeds 120 characters; contains 167 characters
                  Open

                                  'estimated_work_time' => $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true),

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

                                  'status' => 'STATUS_ACTIVE',

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

                                  'cantWriteOnParent' => false,

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

                                  'normalized_status' => $queryGenerator->getModuleField('projectstatus')->getDisplayValue($row['projectstatus'], $row['id'], false, true),

                  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

                              $this->tasksById[$row['id']] = $project;

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

                              'canDelete' => false,

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

                       * Get project data to display in view as gantt.

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

                          $title = '';

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

                              }

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

                          $milestones = $this->getGanttMilestones($projectIds);

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

                          $response = [

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

                              'statuses' => $this->statuses,

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

                          ];

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

                          $milestones = [];

                  Line exceeds 120 characters; contains 157 characters
                  Open

                              $milestoneName = $queryGenerator->getModuleField('projectmilestonename')->getDisplayValue($row['projectmilestonename'], $row['id'], false, true);

                  Line exceeds 120 characters; contains 134 characters
                  Open

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),

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

                                  $milestone['start_date'] = date('Y-m-d', strtotime($pmDate));

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

                                  ]

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

                                  'priority_label' => \App\Language::translate($row['projecttaskpriority'] ?? '', 'ProjectTask'),

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

                                  'no' => $queryGenerator->getModuleField('projecttask_no')->getDisplayValue($row['projecttask_no'], $row['id'], false, true),

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

                       * Get project milestones.

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

                                  'open' => true,

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

                                  'normalized_status' => $queryGenerator->getModuleField('projectmilestone_status')->getDisplayValue($row['projectmilestone_status'], $row['id'], false, true),

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

                                  'no' => $queryGenerator->getModuleField('projectmilestone_no')->getDisplayValue($row['projectmilestone_no'], $row['id'], false, true),

                  Line exceeds 120 characters; contains 207 characters
                  Open

                              $milestone['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $milestone['no'] . '" href="' . $milestone['url'] . '" target="_blank">' . $milestone['no'] . '</a>';

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

                                      'border' => $milestone['color']

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

                                  'canAdd' => false,

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

                                  'progress' => (int) $row['projecttaskprogress'],

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

                                  'start_date' => date('Y-m-d', strtotime($row['startdate'])),

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

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

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

                              $task['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $task['no'] . '" href="' . $task['url'] . '" target="_blank">' . $task['no'] . '</a>';

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

                                      $task['parentId'] = $parentId;

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

                              $milestone = [

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

                                  'estimated_work_time' => $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true),

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

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

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

                                  $milestone['duration'] = 24 * 60 * 60 * 1000;

                  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

                                  'status' => 'STATUS_ACTIVE',

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

                      public function getGanttMilestones($projectIds)

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

                                  'startIsMilestone' => true,

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

                                  $milestone['end_date'] = date('Y-m-d', $endDate);

                  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 task[]

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

                              $task = [

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

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),

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

                                  'target_end_date' => $row['targetenddate'],

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

                                  'open' => true,

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

                                  ]

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

                              $endDate = date('Y-m-d', strtotime('+1 day', strtotime($task['end_date'])));

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

                          unset($dataReader, $queryGenerator, $taskTime, $endDate);

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

                          $queryGenerator = new App\QueryGenerator('ProjectMilestone');

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

                                  'name' => $milestoneName,

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

                                  'canDelete' => false,

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

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),

                  Line exceeds 120 characters; contains 343 characters
                  Open

                                  'color' => ($row['projectmilestone_status'] && isset($this->statusColors['ProjectMilestone']['projectmilestone_status'][$row['projectmilestone_status']])) ? $this->statusColors['ProjectMilestone']['projectmilestone_status'][$row['projectmilestone_status']] : App\Colors::getRandomColor('projectmilestone_status_' . $row['id']),

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

                                      'fill' => $milestone['color'],

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

                              $milestones[] = $milestone;

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

                          }

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

                          $queryGenerator = new App\QueryGenerator('ProjectTask');

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

                          $ganttTasks = [];

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

                                  'url' => 'index.php?module=ProjectTask&view=Detail&record=' . $row['id'],

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

                              $task['duration'] = $this->calculateDuration($task['start_date'], $endDate);

                  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

                                  'priority' => $queryGenerator->getModuleField('projectmilestone_priority')->getDisplayValue($row['projectmilestone_priority'], $row['id'], false, true),

                  Line exceeds 120 characters; contains 174 characters
                  Open

                                  'priority_label' => $queryGenerator->getModuleField('projectmilestone_priority')->getDisplayValue($row['projectmilestone_priority'], $row['id'], false, true),

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

                                  'canWrite' => false,

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

                              if (empty($milestone['parentId'])) {

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

                              if ($pmDate = $row['projectmilestonedate']) {

                  Line exceeds 120 characters; contains 160 characters
                  Open

                                  $milestone['v'] = $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true);

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

                              $milestone['planned_duration'] = $milestone['estimated_work_time'];

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

                       * Get project tasks.

                  Line exceeds 120 characters; contains 290 characters
                  Open

                          $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);

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

                              ['vtiger_projecttask.projectmilestoneid' => $projectIds]

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

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

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

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

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

                                  'start' => date('Y-m-d H:i:s', strtotime($row['startdate'])),

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

                                  'module' => 'ProjectTask',

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

                              if (empty($task['parentId'])) {

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

                              unset($task['color']);

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

                              $task['planned_duration'] = $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true);

                  Line exceeds 120 characters; contains 166 characters
                  Open

                              $task['planned_duration'] = $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true);

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

                       *

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

                                  'parentId' => !empty($row['parentid']) ? $row['parentid'] : $row['projectid'],

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

                                  $milestone['dependentOn'] = [$milestone['parentId']];

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

                      public function getGanttTasks($projectIds)

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

                          $taskTime = 0;

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

                                  'label' => $taskName,

                  Line exceeds 120 characters; contains 134 characters
                  Open

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),

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

                                  'assigned_user_name' => \App\Fields\Owner::getUserLabel($row['assigned_user_id']),

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

                                      $task['dependentOn'] = [$parentId];

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

                       */

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

                              $row['parentid'] = (int) $row['parentid'];

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

                                  'module' => 'ProjectMilestone',

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

                              $milestone['style'] = [

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

                       *

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

                       * @param int|int[] $projectIds

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

                                  'canWrite' => false,

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

                                  'cantWriteOnParent' => false,

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

                                  'priority' => $queryGenerator->getModuleField('projecttaskpriority')->getDisplayValue($row['projecttaskpriority'], $row['id'], false, true),

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

                                  'color' => ($row['projecttaskstatus'] && isset($this->statusColors['ProjectTask']['projecttaskstatus'][$row['projecttaskstatus']])) ? $this->statusColors['ProjectTask']['projecttaskstatus'][$row['projecttaskstatus']] : App\Colors::getRandomColor('projecttaskstatus_' . $row['id']),

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

                                  'base' => [

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

                          }

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

                      }

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

                       * @param int|int[] $projectIds

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

                              $row['projectid'] = (int) $row['projectid'];

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

                                  'label' => $milestoneName,

                  Line exceeds 120 characters; contains 168 characters
                  Open

                                  'status_label' => $queryGenerator->getModuleField('projectmilestone_status')->getDisplayValue($row['projectmilestone_status'], $row['id'], false, true),

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

                                  'color' => ($row['projectmilestone_status'] && isset($this->statusColors['ProjectMilestone']['projectmilestone_status'][$row['projectmilestone_status']])) ? $this->statusColors['ProjectMilestone']['projectmilestone_status'][$row['projectmilestone_status']] : App\Colors::getRandomColor('projectmilestone_status_' . $row['id']),

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

                                  'base' => [

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

                              unset($milestone['color']);

                  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

                                  'canDelete' => false,

                  Line exceeds 120 characters; contains 161 characters
                  Open

                                  'normalized_status' => $queryGenerator->getModuleField('projecttaskstatus')->getDisplayValue($row['projecttaskstatus'], $row['id'], false, true),

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

                                  'type' => 'task',

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

                                  }

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

                      {

                  Line exceeds 120 characters; contains 279 characters
                  Open

                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);

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

                                  'cantWriteOnParent' => false,

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

                                  $milestone['start'] = date('Y-m-d H:i:s', strtotime($pmDate));

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

                          $dataReader->close();

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

                      {

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

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

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

                                  $parentId = (int) ($row['projectmilestoneid'] ?? $row['projectid']);

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

                              $ganttTasks[] = $task;

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

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

                  Line exceeds 120 characters; contains 150 characters
                  Open

                                  'no' => $queryGenerator->getModuleField('projectmilestone_no')->getDisplayValue($row['projectmilestone_no'], $row['id'], false, true),

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

                                  $milestone['end'] = $endDate;

                  Line exceeds 120 characters; contains 297 characters
                  Open

                                  'color' => ($row['projecttaskstatus'] && isset($this->statusColors['ProjectTask']['projecttaskstatus'][$row['projecttaskstatus']])) ? $this->statusColors['ProjectTask']['projecttaskstatus'][$row['projecttaskstatus']] : App\Colors::getRandomColor('projecttaskstatus_' . $row['id']),

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

                      }

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

                       *

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

                          $queryGenerator->addNativeCondition(['vtiger_projectmilestone.projectid' => $projectIds]);

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

                                  'url' => 'index.php?module=ProjectMilestone&view=Detail&record=' . $row['id'],

                  Line exceeds 120 characters; contains 173 characters
                  Open

                                  'normalized_status' => $queryGenerator->getModuleField('projectmilestone_status')->getDisplayValue($row['projectmilestone_status'], $row['id'], false, true),

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

                                  'status_label' => $queryGenerator->getModuleField('projectmilestone_status')->getDisplayValue($row['projectmilestone_status'], $row['id'], false, true),

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

                                  'status' => 'STATUS_ACTIVE',

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

                                  $milestone['v'] = $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true);

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

                              }

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

                          unset($dataReader, $queryGenerator);

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

                          return $milestones;

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

                                  'normalized_status' => $queryGenerator->getModuleField('projecttaskstatus')->getDisplayValue($row['projecttaskstatus'], $row['id'], false, true),

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

                          $queryGenerator->setFields(['id', 'parentid', 'projectid', 'projectmilestonename', 'projectmilestonedate', 'projectmilestone_no', 'projectmilestone_progress', 'projectmilestone_priority', 'sum_time', 'estimated_work_time', 'projectmilestone_status', 'assigned_user_id']);

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

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

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

                                  'progress' => (int) $row['projectmilestone_progress'],

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

                                  'priority_label' => $queryGenerator->getModuleField('projectmilestone_priority')->getDisplayValue($row['projectmilestone_priority'], $row['id'], false, true),

                  Line exceeds 120 characters; contains 167 characters
                  Open

                                  'estimated_work_time' => $queryGenerator->getModuleField('estimated_work_time')->getDisplayValue($row['estimated_work_time'], $row['id'], false, true),

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

                              $milestone['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $milestone['no'] . '" href="' . $milestone['url'] . '" target="_blank">' . $milestone['no'] . '</a>';

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

                                  $endDate = strtotime(date('Y-m-d', strtotime($pmDate)) . ' +1 days');

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

                              ['vtiger_projecttask.projectid' => $projectIds],

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

                                  'name' => $taskName,

                  Line exceeds 120 characters; contains 187 characters
                  Open

                              $task['number'] = '<a class="showReferenceTooltip js-popover-tooltip--record" title="' . $task['no'] . '" href="' . $task['url'] . '" target="_blank">' . $task['no'] . '</a>';

                  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

                              $milestoneName = $queryGenerator->getModuleField('projectmilestonename')->getDisplayValue($row['projectmilestonename'], $row['id'], false, true);

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

                              ];

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

                       *

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

                              'or',

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

                              $taskName = $queryGenerator->getModuleField('projecttaskname')->getDisplayValue($row['projecttaskname'], $row['id'], false, true);

                  Line exceeds 120 characters; contains 142 characters
                  Open

                              $taskName = $queryGenerator->getModuleField('projecttaskname')->getDisplayValue($row['projecttaskname'], $row['id'], false, true);

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

                                  'parentId' => (int) ($row['parentid'] ?? 0),

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

                                  'status_label' => App\Language::translate($row['projecttaskstatus'], 'ProjectTask'),

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

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

                          return $ganttTasks;

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

                      /**

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

                                  'type' => 'milestone',

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

                                  unset($milestone['parentId']);

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

                              }

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

                              ];

                  Line exceeds 120 characters; contains 156 characters
                  Open

                                  'priority' => $queryGenerator->getModuleField('projecttaskpriority')->getDisplayValue($row['projecttaskpriority'], $row['id'], false, true),

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

                              ];

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

                                      'border' => $task['color']

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

                              $taskTime += $row['estimated_work_time'];

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

                       * @return milestone[]

                  Line exceeds 120 characters; contains 168 characters
                  Open

                                  'priority' => $queryGenerator->getModuleField('projectmilestone_priority')->getDisplayValue($row['projectmilestone_priority'], $row['id'], false, true),

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

                                  'sum_time' => $queryGenerator->getModuleField('sum_time')->getDisplayValue($row['sum_time'], $row['id'], false, true),

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

                                  'canAdd' => false,

                  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

                          $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);

                  Line exceeds 120 characters; contains 140 characters
                  Open

                                  'no' => $queryGenerator->getModuleField('projecttask_no')->getDisplayValue($row['projecttask_no'], $row['id'], false, true),

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

                                  'end_date' => $row['enddate'] ?: $row['targetenddate'],

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

                              }

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

                              $task['style'] = [

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

                                      'fill' => $task['color'],

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

                  class Project_Gantt_Model

                  There are no issues that match your filters.

                  Category
                  Status