YetiForceCompany/YetiForceCRM

View on GitHub
vtlib/Vtiger/PackageUpdate.php

Summary

Maintainability
F
3 days
Test Coverage
F
0%

File PackageUpdate.php has 400 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/* +**********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.php - About 5 hrs to fix

    Function update has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        public function update($moduleInstance, $zipfile, $overwrite = true)
        {
            $module = $this->getModuleNameFromZip($zipfile);
            if (null !== $module) {
                $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
    Severity: Minor
    Found in vtlib/Vtiger/PackageUpdate.php - About 4 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

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

    class PackageUpdate extends PackageImport
    {
        public $_migrationinfo = false;
        public $listFields = [];
        public $listBlocks = [];
    Severity: Minor
    Found in vtlib/Vtiger/PackageUpdate.php by phpmd

    The class PackageUpdate has 21 public methods. Consider refactoring PackageUpdate to keep number of public methods under 10.
    Open

    class PackageUpdate extends PackageImport
    {
        public $_migrationinfo = false;
        public $listFields = [];
        public $listBlocks = [];
    Severity: Minor
    Found in vtlib/Vtiger/PackageUpdate.php by phpmd

    TooManyPublicMethods

    Since: 0.1

    A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

    By default it ignores methods starting with 'get' or 'set'.

    Example

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

    Method updateField has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
        {
            // strval used because in $fieldnode there is a SimpleXMLElement object
            $fieldInstance->name = (string) ($fieldnode->fieldname);
            $fieldInstance->label = (string) ($fieldnode->fieldlabel);
    Severity: Major
    Found in vtlib/Vtiger/PackageUpdate.php - About 2 hrs to fix

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

          public function handleMigration($modulenode, $moduleInstance)
          {
              $this->parseMigration($modulenode);
              $cur_version = $moduleInstance->version;
              foreach ($this->_migrations as $migversion => $migrationnode) {
      Severity: Minor
      Found in vtlib/Vtiger/PackageUpdate.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 updateField has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
          {
              // strval used because in $fieldnode there is a SimpleXMLElement object
              $fieldInstance->name = (string) ($fieldnode->fieldname);
              $fieldInstance->label = (string) ($fieldnode->fieldlabel);
      Severity: Minor
      Found in vtlib/Vtiger/PackageUpdate.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

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

      class PackageUpdate extends PackageImport
      {
          public $_migrationinfo = false;
          public $listFields = [];
          public $listBlocks = [];
      Severity: Minor
      Found in vtlib/Vtiger/PackageUpdate.php - About 2 hrs to fix

        Function updateBlocks has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            public function updateBlocks($modulenode, $moduleInstance)
            {
                if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
                    return;
                }
        Severity: Minor
        Found in vtlib/Vtiger/PackageUpdate.php - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            public function updateCronTasks($modulenode)
            {
                if (empty($modulenode->crons) || empty($modulenode->crons->cron)) {
                    return;
                }
        Severity: Minor
        Found in vtlib/Vtiger/PackageUpdate.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 update has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function update($moduleInstance, $zipfile, $overwrite = true)
            {
                $module = $this->getModuleNameFromZip($zipfile);
                if (null !== $module) {
                    $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
        Severity: Minor
        Found in vtlib/Vtiger/PackageUpdate.php - About 1 hr to fix

          Method updateBlocks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateBlocks($modulenode, $moduleInstance)
              {
                  if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
                      return;
                  }
          Severity: Minor
          Found in vtlib/Vtiger/PackageUpdate.php - About 1 hr to fix

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

                public function parseMigration($modulenode)
                {
                    if (empty($this->_migrations)) {
                        $this->_migrations = [];
                        if (!empty($modulenode->migrations)
            Severity: Minor
            Found in vtlib/Vtiger/PackageUpdate.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 updateRelatedlist has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updateRelatedlist($modulenode, $moduleInstance, $relatedlistnode)
                {
                    $relModuleInstance = Module::getInstance((string) $relatedlistnode->relatedmodule);
                    $label = $relatedlistnode->label;
                    $actions = false;
            Severity: Minor
            Found in vtlib/Vtiger/PackageUpdate.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 updateInRelatedlist has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updateInRelatedlist($modulenode, $moduleInstance, $inRelatedListNode)
                {
                    $inRelModuleInstance = Module::getInstance((string) $inRelatedListNode->inrelatedmodule);
                    $label = $inRelatedListNode->label;
                    $actions = false;
            Severity: Minor
            Found in vtlib/Vtiger/PackageUpdate.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

            Method updateField has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
            Severity: Minor
            Found in vtlib/Vtiger/PackageUpdate.php - About 35 mins to fix

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

                  public function updateRelatedLists($modulenode, $moduleInstance)
                  {
                      $moduleInstance->unsetAllRelatedList();
                      if (!empty($modulenode->relatedlists) && !empty($modulenode->relatedlists->relatedlist)) {
                          foreach ($modulenode->relatedlists->relatedlist as $relatedlistnode) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 initUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function initUpdate($moduleInstance, $zipfile, $overwrite)
                  {
                      $module = $this->getModuleNameFromZip($zipfile);
                      if (!$moduleInstance || $moduleInstance->name != $module) {
                          \App\Log::trace('Module name mismatch!', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function updateFields($blocknode, $blockInstance, $moduleInstance)
                  {
                      if (empty($blocknode->fields) || empty($blocknode->fields->field)) {
                          return;
                      }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php - About 25 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function updateCustomViews has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function updateCustomViews($modulenode, $moduleInstance)
                  {
                      if (empty($modulenode->customviews) || empty($modulenode->customviews->customview)) {
                          return;
                      }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php - About 25 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              The method updateField() has an NPath complexity of 2048. The configured NPath complexity threshold is 200.
              Open

                  public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
                  {
                      // strval used because in $fieldnode there is a SimpleXMLElement object
                      $fieldInstance->name = (string) ($fieldnode->fieldname);
                      $fieldInstance->label = (string) ($fieldnode->fieldlabel);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateField() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
              Open

                  public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
                  {
                      // strval used because in $fieldnode there is a SimpleXMLElement object
                      $fieldInstance->name = (string) ($fieldnode->fieldname);
                      $fieldInstance->label = (string) ($fieldnode->fieldlabel);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 update() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
              Open

                  public function update($moduleInstance, $zipfile, $overwrite = true)
                  {
                      $module = $this->getModuleNameFromZip($zipfile);
                      if (null !== $module) {
                          $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateBlocks() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
              Open

                  public function updateBlocks($modulenode, $moduleInstance)
                  {
                      if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
                          return;
                      }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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

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

              class PackageUpdate extends PackageImport
              Severity: Major
              Found in vtlib/Vtiger/PackageUpdate.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 29 to the 15 allowed.
              Open

                  public function update($moduleInstance, $zipfile, $overwrite = true)
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.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

                  public function handleMigration($modulenode, $moduleInstance)
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.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 19 to the 15 allowed.
              Open

                  public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by sonar-php

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

              See

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

              class PackageUpdate extends PackageImport
              {
                  public $_migrationinfo = false;
                  public $listFields = [];
                  public $listBlocks = [];
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              CouplingBetweenObjects

              Since: 1.1.0

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

              Example

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

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

              The method update has a boolean flag argument $overwrite, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public function update($moduleInstance, $zipfile, $overwrite = true)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

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

              Avoid using static access to class 'vtlib\Module' in method 'updateModule'.
              Open

                      Module::fireEvent($moduleInstance->name, Module::EVENT_MODULE_PREUPDATE);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\Vtiger_Viewer' in method 'initUpdate'.
              Open

                              $zip->unzipFile("$module.png", 'layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png");
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 update uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              if (!$moduleInstance || $moduleInstance->name != $module) {
                                  \App\Log::error('Module name mismatch!', __METHOD__);
              
                                  return false;
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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\Log' in method 'handleMigration'.
              Open

                              \App\Log::trace("Migrating to $migversion ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Module' in method 'updateModule'.
              Open

                      Module::fireEvent($moduleInstance->name, Module::EVENT_MODULE_POSTUPDATE);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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\Zip' in method 'initUpdate'.
              Open

                          $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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\Zip' in method 'update'.
              Open

                          $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                                  \App\Log::error('Module name mismatch!', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $fieldInstance->columntype = null;
                      }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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

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

                                      } else {
                                          // Supress any SQL query failures
                                          \App\Log::trace("SQL: $tablesql ... ", __METHOD__);
                                          \App\Db::getInstance()->createCommand($tablesql)->execute();
                                          \App\Log::trace('DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Block' in method 'updateBlocks'.
              Open

                      $listBlockBeforeUpdate = Block::getAllForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Module' in method 'updateRelatedlist'.
              Open

                      $relModuleInstance = Module::getInstance((string) $relatedlistnode->relatedmodule);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                          \App\Log::trace('Module name mismatch!', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                                          \App\Log::trace("SQL: $tablesql ... ", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Utils' in method 'handleMigration'.
              Open

                                      if (Utils::isDestructiveSql($tablesql)) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Field' in method 'updateBlocks'.
              Open

                          $listFieldBeforeUpdate = Field::getAllForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateCronTasks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $cronTask->status = Cron::$STATUS_ENABLED;
                          }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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

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

                      } else {
                          $blockInstance->display_status = null;
                      }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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\Log' in method 'handleMigration'.
              Open

                                          \App\Log::trace("SQL: $tablesql ... SKIPPED", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Cron' in method 'updateCronTasks'.
              Open

                          Cron::register("$importCronTask->name", "$importCronTask->handler", "$importCronTask->frequency", "$modulenode->name", "$importCronTask->status", "$importCronTask->sequence", "$importCronTask->description");
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Module' in method 'update'.
              Open

                                          $moduleInstance = Module::getInstance($moduleInfo['name']);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateBlocks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $this->updateBlock($modulenode, $moduleInstance, $blocknode, $blockInstance);
                          }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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\Log' in method 'handleMigration'.
              Open

                                          \App\Log::trace('DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Block' in method 'updateBlocks'.
              Open

                          $blockInstance = Block::getInstance((string) $blocknode->blocklabel, $moduleInstance->id);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateCustomViews uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $this->updateCustomView($modulenode, $moduleInstance, $customviewnode, $filterInstance);
                          }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Filter' in method 'updateCustomViews'.
              Open

                          $filterInstance = Filter::getInstance($customviewnode->viewname, $moduleInstance->id);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $moduleInstance->entityfieldname = $fieldInstance->name;
                          }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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\EventHandler' in method 'updateEvents'.
              Open

                          \App\EventHandler::registerHandler($eventNode->eventName, $eventNode->className, $eventNode->includeModules, $eventNode->excludeModules, $eventNode->priority, $eventNode->isActive, $moduleId);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Cron' in method 'updateCronTasks'.
              Open

                      $cronTasks = Cron::listAllInstancesByModule($modulenode->name);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Cron' in method 'updateCronTasks'.
              Open

                              $importCronTask->sequence = Cron::nextSequence();
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Link' in method 'updateCustomLinks'.
              Open

                      Link::deleteAll($moduleInstance->id);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Cron' in method 'updateCronTasks'.
              Open

                                  Cron::deregister($importCronTask->name);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                              \App\Log::trace("Migrating to $migversion ... STARTED", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Module' in method 'updateInRelatedlist'.
              Open

                      $inRelModuleInstance = Module::getInstance((string) $inRelatedListNode->inrelatedmodule);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateFields uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $this->updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance);
                          }
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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\Module' in method 'updateEvents'.
              Open

                      $moduleId = \App\Module::getModuleId($moduleInstance->name);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 'vtlib\Field' in method 'updateFields'.
              Open

                          $fieldInstance = Field::getInstance((string) $fieldnode->fieldname, $moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 unused parameters such as '$overwrite'.
              Open

                  public function initUpdate($moduleInstance, $zipfile, $overwrite)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$moduleInstance'.
              Open

                  public function updateSharingAccess($modulenode, $moduleInstance)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$modulenode'.
              Open

                  public function updateInRelatedlist($modulenode, $moduleInstance, $inRelatedListNode)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$actionnode'.
              Open

                  public function updateAction($modulenode, $moduleInstance, $actionnode)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$moduleInstance'.
              Open

                  public function updateAction($modulenode, $moduleInstance, $actionnode)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$moduleInstance'.
              Open

                  public function updateBlock($modulenode, $moduleInstance, $blocknode, $blockInstance)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$modulenode'.
              Open

                  public function updateBlock($modulenode, $moduleInstance, $blocknode, $blockInstance)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$modulenode'.
              Open

                  public function updateAction($modulenode, $moduleInstance, $actionnode)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$blocknode'.
              Open

                  public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

              Avoid unused parameters such as '$modulenode'.
              Open

                  public function updateRelatedlist($modulenode, $moduleInstance, $relatedlistnode)
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

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

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

                   * @param Module Instance of the module to update
              Severity: Info
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Class \vtlib\Field was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties)
              Open

                          foreach ($listFieldBeforeUpdate as $fieldInstance) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Call to undeclared method \vtlib\PackageUpdate::getHandlerClass
              Open

                              if ($cronTask->getName() == $importCronTask->name && $importCronTask->handler == $cronTask->getHandlerClass()) {
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->_migrations
              Open

                      foreach ($this->_migrations as $migversion => $migrationnode) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                                          \App\Log::trace('DONE', __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Argument 3 (frequency) is string but \vtlib\Cron::register() takes int defined at /code/vtlib/Vtiger/Cron.php:398
              Open

                          Cron::register("$importCronTask->name", "$importCronTask->handler", "$importCronTask->frequency", "$modulenode->name", "$importCronTask->status", "$importCronTask->sequence", "$importCronTask->description");
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Class \vtlib\Block was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties)
              Open

                      foreach ($listBlockBeforeUpdate as $blockInstance) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                                          \App\Db::getInstance()->createCommand($tablesql)->execute();
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_eventhandlers', ['owner_id' => $moduleId])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                          \App\Log::trace('Module name mismatch!', __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                                          \App\Log::trace("SQL: $tablesql ... ", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->status
              Open

                              $cronTask->status = Cron::$STATUS_DISABLED;
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->_migrations
              Open

                                  $this->_migrations["$migrationversion"] = $migrationnode;
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                                          \App\Log::trace("SQL: $tablesql ... SKIPPED", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->_migrations
              Open

                          if (\count($this->_migrations) > 1) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->_migrations
              Open

                          $this->_migrations = [];
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Call to undeclared method \vtlib\PackageUpdate::getName
              Open

                              if ($cronTask->getName() == $importCronTask->name && $importCronTask->handler == $cronTask->getHandlerClass()) {
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Argument 5 (status) is string but \vtlib\Cron::register() takes int defined at /code/vtlib/Vtiger/Cron.php:398
              Open

                          Cron::register("$importCronTask->name", "$importCronTask->handler", "$importCronTask->frequency", "$modulenode->name", "$importCronTask->status", "$importCronTask->sequence", "$importCronTask->description");
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Saw possibly unextractable annotation for a fragment of comment '* @param string Zip file name': after string, did not see an element name (will guess based on comment order)
              Open

                   * @param string Zip file name
              Severity: Info
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Saw possibly unextractable annotation for a fragment of comment '* @param bool True for overwriting existing module': after bool, did not see an element name (will guess based on comment order)
              Open

                   * @param bool True for overwriting existing module
              Severity: Info
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                              \App\Log::trace("Migrating to $migversion ... STARTED", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Call with 4 arg(s) to \vtlib\Module::unsetRelatedList() which only takes 3 arg(s) defined at /code/vtlib/Vtiger/Module.php:136
              Open

                          $inRelModuleInstance->unsetRelatedList($moduleInstance, "$label", "$inRelatedListNode->function", $inRelatedListNode->field_name);
              Severity: Info
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                                  \App\Log::error('Module name mismatch!', __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->_migrations
              Open

                      if (empty($this->_migrations)) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                              \App\Log::trace("Migrating to $migversion ... DONE", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Argument 6 (sequence) is string but \vtlib\Cron::register() takes int defined at /code/vtlib/Vtiger/Cron.php:398
              Open

                          Cron::register("$importCronTask->name", "$importCronTask->handler", "$importCronTask->frequency", "$modulenode->name", "$importCronTask->status", "$importCronTask->sequence", "$importCronTask->description");
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->_migrations
              Open

                              uksort($this->_migrations, 'version_compare');
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

              Reference to undeclared property \vtlib\PackageUpdate->status
              Open

                              $cronTask->status = Cron::$STATUS_ENABLED;
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phan

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

                      $listBlockBeforeUpdate = Block::getAllForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

                          $listFieldBeforeUpdate = Field::getAllForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

              The property $_migrationinfo is not named in camelCase.
              Open

              class PackageUpdate extends PackageImport
              {
                  public $_migrationinfo = false;
                  public $listFields = [];
                  public $listBlocks = [];
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              CamelCasePropertyName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name attributes.

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              Property name "$_migrationinfo" should not be prefixed with an underscore to indicate visibility
              Open

                  public $_migrationinfo = false;

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

                   * Initialize Update.

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

                          if (empty($this->_modulexml)) {

              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 mixed $zipfile

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

                              'updates' => 'cache/updates',

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

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

                   * @param mixed $overwrite

              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 (null !== $module) {

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

                                  foreach ($moduleInfos as $moduleInfo) {

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

                                      if ($moduleInfo['install_sequence'] == $sequence) {

              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

                   * Update Module.

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

                   * Parse migration information from manifest.

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

                  public function parseMigration($modulenode)

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

                              && !empty($modulenode->migrations->migration)) {

              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->listBlocks[] = (string) ($blocknode->blocklabel);

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

                          $this->updateFields($blocknode, $blockInstance, $moduleInstance);

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

                      if (isset($blocknode->sequence, $blocknode->display_status)) {

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

                      if (empty($blocknode->fields) || empty($blocknode->fields->field)) {

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

                              $this->updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance);

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

                   * @param mixed $blockInstance

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

                      $fieldInstance->typeofdata = (string) ($fieldnode->typeofdata);

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

                      }

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

                          $picklistvalues = [];

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

                   * @param mixed $moduleInstance

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

                  public function update($moduleInstance, $zipfile, $overwrite = true)

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

                          $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);

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

                              }

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

                                  }

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

                              }

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

                      $this->updateActions($this->_modulexml, $moduleInstance);

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

                      foreach ($listBlockBeforeUpdate as $blockInstance) {

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

                   * @param mixed $modulenode

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

                          $blockInstance->visible = (string) ($blocknode->visible);

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

                   * Update Fields of the module.

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

                   * @param mixed $blockInstance

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

                          }

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

                      $fieldInstance->defaultvalue = (string) ($fieldnode->defaultvalue);

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

                      $fieldInstance->quickcreate = (string) ($fieldnode->quickcreate);

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

                      if (!empty($fieldnode->fieldparams)) {

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

                          $moduleInstance->entityidfield = (string) ($fieldnode->entityidentifier->entityidfield);

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

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

                          $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);

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

                          if ($zip->statName("$module.png")) {

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

                   * Update Module from zip file.

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

                          // If data is not yet available

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

                              $this->__parseManifestFile($zip);

              Line exceeds 120 characters; contains 125 characters
              Open

                                          $this->update($moduleInstance, $this->getTemporaryFilePath($moduleInfo['filepath']), $overwrite);

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

                      $cur_version = $moduleInstance->version;

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

                              $this->updateBlock($modulenode, $moduleInstance, $blocknode, $blockInstance);

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

                          $blockInstance->increateview = (string) ($blocknode->create_view);

              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

                          $fieldInstance->fieldparams = (string) ($fieldnode->fieldparams);

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

                      if (!empty($fieldnode->relatedmodules) && !empty($fieldnode->relatedmodules->relatedmodule)) {

              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

                          \App\Log::trace('Module name mismatch!', __METHOD__);

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

                              $zip->unzipFile("$module.png", 'layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png");

              Line exceeds 120 characters; contains 130 characters
              Open

                              $zip->unzipFile("$module.png", 'layouts/' . \Vtiger_Viewer::getDefaultLayoutName() . "/skins/images/$module.png");

              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->updateEvents($this->_modulexml, $moduleInstance);

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

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

                   * Handle migration of the module.

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

                      foreach ($this->_migrations as $migversion => $migrationnode) {

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

                                          \App\Log::trace("SQL: $tablesql ... ", __METHOD__);

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

                   */

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

                              $blockInstance = $this->importBlock($modulenode, $moduleInstance, $blocknode);

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

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

                  public function updateBlock($modulenode, $moduleInstance, $blocknode, $blockInstance)

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

                          $blockInstance->islist = (string) ($blocknode->islist);

              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

                      $fieldInstance->maximumlength = (string) ($fieldnode->maximumlength);

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

                      if (!empty($fieldnode->helpinfo)) {

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

                              $moduleInstance->entityfieldname = (string) ($fieldnode->entityidentifier->fieldname);

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

                      // Check related modules associated with this field

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

                      $module = $this->getModuleNameFromZip($zipfile);

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

                              $this->__parseManifestFile($zip);

              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 ($installSequenceArray as $sequence) {

              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

                                  $migrationattrs = $migrationnode->attributes();

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

                          // Sort the migration details based on version

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

                                          \App\Log::trace("SQL: $tablesql ... SKIPPED", __METHOD__);

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

                   * Update Tables of the module.

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

                   *

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

                   *

              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($fieldInstance->name, $this->listFields))) {

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

                   * @param mixed $moduleInstance

              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

                      $fieldInstance->uitype = (string) ($fieldnode->uitype);

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

                      $fieldInstance->info_type = (string) ($fieldnode->info_type);

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

                      if (isset($fieldnode->columntype)) {

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

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

                          if (isset($fieldnode->entityidentifier->fieldname) && !empty($fieldnode->entityidentifier->fieldname)) {

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

                          foreach ($fieldnode->picklistvalues->picklistvalue as $picklistvaluenode) {

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

                          return false;

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

                          ]);

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

                      $module = $this->getModuleNameFromZip($zipfile);

              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->handleMigration($this->_modulexml, $moduleInstance);

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

                      $this->updateRelatedLists($this->_modulexml, $moduleInstance);

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

                      $this->updateCronTasks($this->_modulexml);

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

                   * @param mixed $modulenode

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

                                          // Supress any SQL query failures

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

                      $this->importTables($modulenode);

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

                          return;

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

                      // Deleting removed blocks

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

                          if (!(\in_array($blockInstance->label, $this->listBlocks))) {

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

                      $fieldInstance->name = (string) ($fieldnode->fieldname);

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

                      $fieldInstance->generatedtype = (string) ($fieldnode->generatedtype);

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

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

                      if (null !== $module) {

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

                          $zip->unzip([

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

                                          $moduleInstance = Module::getInstance($moduleInfo['name']);

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

                      $tablabel = $this->_modulexml->label;

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

                      Module::fireEvent($moduleInstance->name, Module::EVENT_MODULE_PREUPDATE);

              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($modulenode->migrations)

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

                          if (\count($this->_migrations) > 1) {

              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 mixed $blocknode

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

                  {

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

                          $fieldInstance->columntype = (string) ($fieldnode->columntype);

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

                          if (true === $moduleBundle) {

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

                                      $moduleInfo = (array) $moduleInfo;

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

                                          $this->update($moduleInstance, $this->getTemporaryFilePath($moduleInfo['filepath']), $overwrite);

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

                              foreach ($modulenode->migrations->migration as $migrationnode) {

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

                          if (version_compare($cur_version, $migversion, '<')) {

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

                              if (!empty($migrationnode->tables) && !empty($migrationnode->tables->table)) {

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

                                          \App\Log::trace('DONE', __METHOD__);

              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 mixed $moduleInstance

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

                          $blockInstance->display_status = null;

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

                      return $blockInstance;

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

                   *

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

                   */

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

                          return;

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

                      $fieldInstance->table = (string) ($fieldnode->tablename);

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

                      $fieldInstance->column = (string) ($fieldnode->columnname);

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

                   * @param mixed $zipfile

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

                      $fieldInstance->displaytype = (string) ($fieldnode->displaytype);

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

                                  foreach ($buildModuleArray as $moduleInfo) {

              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->initUpdate($moduleInstance, $zipfile, $overwrite);

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

                              $this->updateModule($moduleInstance);

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

                   */

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

                          $moduleInstance->setEntityIdentifier($fieldInstance);

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

                      $tabversion = $this->_modulexml->version;

              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

                              \App\Log::trace("Migrating to $migversion ... DONE", __METHOD__);

              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 updateTables($modulenode)

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

                          if (!$blockInstance) {

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

                              $blockInstance->delete();

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

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

                          if (!$fieldInstance) {

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

                   * @param mixed $fieldnode

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

                   * @param mixed $fieldInstance

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

                      $fieldInstance->readonly = (string) ($fieldnode->readonly);

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

                      $fieldInstance->sequence = (string) ($fieldnode->sequence);

              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

                      // Check picklist values associated with field if any.

              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 Zip file name

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

                              foreach ($moduleList as $moduleInfos) {

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

                              // Call module update function

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

                   * @param mixed $moduleInstance

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

                      $this->updateSharingAccess($this->_modulexml, $moduleInstance);

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

                                  $migrationversion = $migrationattrs['version'];

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

                          // Perform migration only for higher version than current

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

                                      if (Utils::isDestructiveSql($tablesql)) {

              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

                      $listBlockBeforeUpdate = Block::getAllForModule($moduleInstance);

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

                      // Deleting removed fields

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

                          foreach ($listFieldBeforeUpdate as $fieldInstance) {

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

                          $blockInstance->showtitle = (string) ($blocknode->show_title);

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

                      $blockInstance->save();

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

                          $fieldInstance = Field::getInstance((string) $fieldnode->fieldname, $moduleInstance);

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

                          $this->__AddModuleFieldToCache($moduleInstance, $fieldInstance->name, $fieldInstance);

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

                      $fieldInstance->label = (string) ($fieldnode->fieldlabel);

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

                      $fieldInstance->presence = (string) ($fieldnode->presence);

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

                      $fieldInstance->fieldparams = (string) ($fieldnode->fieldparams);

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

                   * @param bool True for overwriting existing module

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

                   * @param mixed $overwrite

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

                          if (empty($this->_modulexml)) {

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

                              $moduleList = (array) $this->_modulexml->modulelist;

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

                              $zip->unzip($this->getTemporaryFilePath());

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

                                  return false;

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

                      $this->updateCustomViews($this->_modulexml, $moduleInstance);

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

                      $moduleInstance->__updateVersion($tabversion);

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

                                  $this->_migrations["$migrationversion"] = $migrationnode;

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

                              uksort($this->_migrations, 'version_compare');

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

                                  $fieldInstance->delete();

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

                  }

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

                   * Update Block of the module.

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

                   * @param mixed $moduleInstance

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

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

                          $fieldInstance->setMassEditable($fieldnode->masseditable);

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

                      $fieldInstance->save();

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

                          $moduleInstance->entityidcolumn = (string) ($fieldnode->entityidentifier->entityidcolumn);

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

                          $fieldInstance->setPicklistValues($picklistvalues);

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

                          foreach ($fieldnode->relatedmodules->relatedmodule as $relatedmodulenode) {

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

                   * @param Module Instance of the module to update

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

                          $installSequenceArray = $buildModuleArray = [];

              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 updateModule($moduleInstance)

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

                      $moduleInstance->save();

              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

                      foreach ($modulenode->blocks->block as $blocknode) {

              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

                              $fieldInstance = $this->importField($blocknode, $blockInstance, $moduleInstance, $fieldnode);

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

                  public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)

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

                          $fieldInstance->setHelpInfo($fieldnode->helpinfo);

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

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

                          }

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

                          $moduleBundle = (bool) $this->_modulexml->modulebundle;

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

                              if (!$moduleInstance || $moduleInstance->name != $module) {

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

                      $this->updateBlocks($this->_modulexml, $moduleInstance);

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

                      Module::fireEvent($moduleInstance->name, Module::EVENT_MODULE_POSTUPDATE);

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

                   * @param mixed $moduleInstance

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

                  public function handleMigration($modulenode, $moduleInstance)

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

                      $this->parseMigration($modulenode);

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

                                      $tablesql = "$tablenode->sql"; // Convert to string

              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

                          $listFieldBeforeUpdate = Field::getAllForModule($moduleInstance);

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

                              }

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

                      $blockInstance->label = (string) ($blocknode->blocklabel);

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

                          $blockInstance->sequence = (string) ($blocknode->sequence);

              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 function initUpdate($moduleInstance, $zipfile, $overwrite)

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

                   * Update Field of the module.

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

                          }

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

                      } else {

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

                                      $installSequenceArray[] = $moduleInfo['install_sequence'];

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

                      $fieldInstance->block = $blockInstance;

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

                      if (empty($this->_migrations)) {

              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

                          $relatedmodules = [];

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

                   * @param mixed $modulenode

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

                  public function updateBlocks($modulenode, $moduleInstance)

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

                   * @param mixed $blockInstance

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

                          $blockInstance->indetailview = (string) ($blocknode->detail_view);

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

                  public function updateFields($blocknode, $blockInstance, $moduleInstance)

              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->listFields[] = (string) ($fieldnode->fieldname);

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

                      }

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

                      // strval used because in $fieldnode there is a SimpleXMLElement object

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

                      // Check if new parameters are defined

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

                      // Set the field as entity identifier if marked.

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

                      if (!empty($fieldnode->picklistvalues) && !empty($fieldnode->picklistvalues->picklistvalue)) {

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

                              $picklistvalues[] = $picklistvaluenode;

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

                  public $_migrationinfo = false;

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

                   * @param mixed $moduleInstance

              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

                                      $buildModuleArray[] = $moduleInfo;

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

                                  }

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

                              sort($installSequenceArray);

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

                                  \App\Log::error('Module name mismatch!', __METHOD__);

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

                      $moduleInstance->label = $tablabel;

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

                      $this->updateCustomLinks($this->_modulexml, $moduleInstance);

              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

                              \App\Log::trace("Migrating to $migversion ... STARTED", __METHOD__);

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

                                  foreach ($migrationnode->tables->table as $tablenode) {

              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

                                          \App\Db::getInstance()->createCommand($tablesql)->execute();

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

                  }

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

                   * @param mixed $modulenode

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

                          }

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

                          $fieldInstance->setSummaryField($fieldnode->summaryfield);

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

                              $moduleInstance->entityfieldname = $fieldInstance->name;

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

                      if (!$moduleInstance || $moduleInstance->name != $module) {

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

                          // If data is not yet available

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

                      $this->updateTables($this->_modulexml);

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

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

                                      // Skip SQL which are destructive

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

                              }

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

                          }

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

                   * Update Blocks of the module.

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

                      if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {

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

                          $blockInstance = Block::getInstance((string) $blocknode->blocklabel, $moduleInstance->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

                   *

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

                          $blockInstance->ineditview = (string) ($blocknode->edit_view);

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

                          $blockInstance->display_status = (string) ($blocknode->display_status);

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

                          $blockInstance->iscustom = (string) ($blocknode->iscustom);

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

                   * @param mixed $blocknode

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

                      foreach ($blocknode->fields->field as $fieldnode) {

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

                   * @param mixed $blocknode

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

                      $fieldInstance->quicksequence = (string) ($fieldnode->quickcreatesequence);

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

                          $fieldInstance->columntype = null;

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

                   * @param mixed $modulenode

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

                   * @param mixed $moduleInstance

              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->updateCustomView($modulenode, $moduleInstance, $customviewnode, $filterInstance);

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

              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;

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

                      $relModuleInstance = Module::getInstance((string) $relatedlistnode->relatedmodule);

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_eventhandlers', ['owner_id' => $moduleId])->execute();

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

                              if ($cronTask->getName() == $importCronTask->name && $importCronTask->handler == $cronTask->getHandlerClass()) {

              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

                   * Update related lists of the module.

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

                      if (!empty($modulenode->relatedlists) && !empty($modulenode->relatedlists->relatedlist)) {

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

                          }

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

                      $label = $relatedlistnode->label;

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

              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($modulenode->customlinks) || empty($modulenode->customlinks->customlink)) {

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

                      $this->importCustomLinks($modulenode, $moduleInstance);

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

                  public function updateCustomViews($modulenode, $moduleInstance)

              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->updateInRelatedlist($modulenode, $moduleInstance, $inRelatedListNode);

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

                   * @param mixed $relatedlistnode

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

                          $actions = [];

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

                          foreach ($inRelatedListNode->fields->field as $fieldNode) {

              Line exceeds 120 characters; contains 161 characters
              Open

                          $inRelModuleInstance->setRelatedList($moduleInstance, "$label", $actions, "$inRelatedListNode->function", "$inRelatedListNode->field_name", $fields);

              Line exceeds 120 characters; contains 128 characters
              Open

                              if ($cronTask->getName() == $importCronTask->name && $importCronTask->handler == $cronTask->getHandlerClass()) {

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

                          }

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

                          $fieldInstance->setRelatedModules($relatedmodules);

              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

                   * @param mixed $customviewnode

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

                      $this->importCustomView($modulenode, $moduleInstance, $customviewnode);

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

                  public function updateSharingAccess($modulenode, $moduleInstance)

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

                          \App\EventHandler::registerHandler($eventNode->eventName, $eventNode->className, $eventNode->includeModules, $eventNode->excludeModules, $eventNode->priority, $eventNode->isActive, $moduleId);

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

                   * @param mixed $moduleInstance

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

                          return;

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

                   */

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

                   * Import related list of the module.

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

                      $inRelModuleInstance = Module::getInstance((string) $inRelatedListNode->inrelatedmodule);

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

                          $actions = [];

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

                              $fields[] = "$fieldNode";

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

                      return $inRelModuleInstance;

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

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

                  /**

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

                   * Update Sharing Access of the module.

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

                  /**

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

                   * @param mixed $modulenode

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

                   * @param mixed $moduleInstance

              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->updateAction($modulenode, $moduleInstance, $actionnode);

              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

                          $inRelModuleInstance->unsetRelatedList($moduleInstance, "$label", "$inRelatedListNode->function", $inRelatedListNode->field_name);

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

                  }

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

                          return;

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

                          }

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

                          Cron::register("$importCronTask->name", "$importCronTask->handler", "$importCronTask->frequency", "$modulenode->name", "$importCronTask->status", "$importCronTask->sequence", "$importCronTask->description");

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

                      }

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

                   * @param mixed $moduleInstance

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

                   * Update actions of the module.

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

                      if (empty($modulenode->actions) || empty($modulenode->actions->action)) {

              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 ($modulenode->relatedlists->relatedlist as $relatedlistnode) {

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

                  public function updateInRelatedlist($modulenode, $moduleInstance, $inRelatedListNode)

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

                  {

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

                                  Cron::deregister($importCronTask->name);

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

                  }

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

                  }

              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 updateRelatedLists($modulenode, $moduleInstance)

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

                          foreach ($modulenode->inrelatedlists->inrelatedlist as $inRelatedListNode) {

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

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

                      }

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

                   * Import Custom views of the module.

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

                   *

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

                          return;

              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

                      $filterInstance->delete();

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

                      foreach ($modulenode->actions->action as $actionnode) {

              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 ($modulenode->crons->cron as $importCronTask) {

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

                          if (empty($importCronTask->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

                  {

              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

                              $actions[] = "$actionnode";

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

                              $relatedmodules[] = $relatedmodulenode;

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

                          $moduleInstance->unsetRelatedList($relModuleInstance, "$label", "$relatedlistnode->function");

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

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

                              $actions[] = "$actionnode";

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

                   * @param mixed $modulenode

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

                          }

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

                   */

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

                   *

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

                      if (empty($modulenode->eventHandlers) || empty($modulenode->eventHandlers->event)) {

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

                  }

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

                   * @param mixed $moduleInstance

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

                   * @param mixed $modulenode

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

                              $this->updateRelatedlist($modulenode, $moduleInstance, $relatedlistnode);

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

                   * @param mixed $moduleInstance

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

                      $actions = false;

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

                      if (!empty($relatedlistnode->fields)) {

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

                          $moduleInstance->setRelatedList($relModuleInstance, "$label", $actions, "$relatedlistnode->function", "$relatedlistnode->field_name", $fields);

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

                  {

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

                      Link::deleteAll($moduleInstance->id);

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

                  public function updateCronTasks($modulenode)

              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 ($modulenode->customviews->customview as $customviewnode) {

              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 updateRelatedlist($modulenode, $moduleInstance, $relatedlistnode)

              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 function updateActions($modulenode, $moduleInstance)

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

                      $fields = [];

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

                      }

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

                      $fields = [];

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

                      if (!empty($inRelatedListNode->fields)) {

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

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

                              $importCronTask->sequence = Cron::nextSequence();

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

                      return $fieldInstance;

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

                   */

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

                   * Update Custom View of the module.

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

                   * @param mixed $moduleInstance

              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($modulenode->inrelatedlists) && !empty($modulenode->inrelatedlists->inrelatedlist)) {

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

                      if ($relModuleInstance) {

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

                      $label = $inRelatedListNode->label;

              Line exceeds 120 characters; contains 142 characters
              Open

                          $inRelModuleInstance->unsetRelatedList($moduleInstance, "$label", "$inRelatedListNode->function", $inRelatedListNode->field_name);

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

                          return;

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

                      }

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

                      if (empty($modulenode->crons) || empty($modulenode->crons->cron)) {

              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 ($cronTasks as $cronTask) {

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

                              $cronTask->status = Cron::$STATUS_DISABLED;

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

                   * @param mixed $filterInstance

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

                          return;

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

                      }

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

                      $moduleId = \App\Module::getModuleId($moduleInstance->name);

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

                      foreach ($modulenode->eventHandlers->event as &$eventNode) {

              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($relatedlistnode->actions) && !empty($relatedlistnode->actions->action)) {

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

                          foreach ($relatedlistnode->fields->field as $fieldNode) {

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

                              $fields[] = "$fieldNode";

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

                      if (!empty($inRelatedListNode->actions) && !empty($inRelatedListNode->actions->action)) {

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

                          foreach ($inRelatedListNode->actions->action as $actionnode) {

              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

                          $filterInstance = Filter::getInstance($customviewnode->viewname, $moduleInstance->id);

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

                      if (empty($modulenode->customviews) || empty($modulenode->customviews->customview)) {

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

                              $this->importCustomView($modulenode, $moduleInstance, $customviewnode);

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

                  public function updateCustomView($modulenode, $moduleInstance, $customviewnode, $filterInstance)

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

                   */

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

                   * Update Events of the module.

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

                      }

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

                  public function updateEvents($modulenode, $moduleInstance)

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

                   * @param mixed $modulenode

              Line exceeds 120 characters; contains 204 characters
              Open

                          \App\EventHandler::registerHandler($eventNode->eventName, $eventNode->className, $eventNode->includeModules, $eventNode->excludeModules, $eventNode->priority, $eventNode->isActive, $moduleId);

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

                   * @param mixed $actionnode

              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 updateAction($modulenode, $moduleInstance, $actionnode)

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

                   * @param mixed $moduleInstance

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

                   * @param mixed $modulenode

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

                      $moduleInstance->unsetAllRelatedList();

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

                   * Update action of the module.

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

                      $actions = 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

                   * @param mixed $modulenode

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

                          $inRelModuleInstance->setRelatedList($moduleInstance, "$label", $actions, "$inRelatedListNode->function", "$inRelatedListNode->field_name", $fields);

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

                          foreach ($relatedlistnode->actions->action as $actionnode) {

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

                  public function updateCustomLinks($modulenode, $moduleInstance)

              Line exceeds 120 characters; contains 155 characters
              Open

                          $moduleInstance->setRelatedList($relModuleInstance, "$label", $actions, "$relatedlistnode->function", "$relatedlistnode->field_name", $fields);

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

                              $cronTask->status = Cron::$STATUS_ENABLED;

              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

                      $cronTasks = Cron::listAllInstancesByModule($modulenode->name);

              Line exceeds 120 characters; contains 219 characters
              Open

                          Cron::register("$importCronTask->name", "$importCronTask->handler", "$importCronTask->frequency", "$modulenode->name", "$importCronTask->status", "$importCronTask->sequence", "$importCronTask->description");

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

                              }

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

                      }

              The variable $cur_version is not named in camelCase.
              Open

                  public function handleMigration($modulenode, $moduleInstance)
                  {
                      $this->parseMigration($modulenode);
                      $cur_version = $moduleInstance->version;
                      foreach ($this->_migrations as $migversion => $migrationnode) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $cur_version is not named in camelCase.
              Open

                  public function handleMigration($modulenode, $moduleInstance)
                  {
                      $this->parseMigration($modulenode);
                      $cur_version = $moduleInstance->version;
                      foreach ($this->_migrations as $migversion => $migrationnode) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              There are no issues that match your filters.

              Category
              Status