YetiForceCompany/YetiForceCRM

View on GitHub
vtlib/Vtiger/ModuleBasic.php

Summary

Maintainability
D
2 days
Test Coverage
B
85%

File ModuleBasic.php has 396 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/ModuleBasic.php - About 5 hrs to fix

    ModuleBasic has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ModuleBasic
    {
        /** ID of this instance */
        public $id = false;
        public $name = false;
    Severity: Minor
    Found in vtlib/Vtiger/ModuleBasic.php - About 3 hrs to fix

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

      class ModuleBasic
      {
          /** ID of this instance */
          public $id = false;
          public $name = false;
      Severity: Minor
      Found in vtlib/Vtiger/ModuleBasic.php by phpmd

      The class ModuleBasic has 23 public methods. Consider refactoring ModuleBasic to keep number of public methods under 10.
      Open

      class ModuleBasic
      {
          /** ID of this instance */
          public $id = false;
          public $name = false;
      Severity: Minor
      Found in vtlib/Vtiger/ModuleBasic.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 __create has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __create()
          {
              \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
              $db = \App\Db::getInstance();
      
      
      Severity: Major
      Found in vtlib/Vtiger/ModuleBasic.php - About 2 hrs to fix

        The class ModuleBasic has 21 fields. Consider redesigning ModuleBasic to keep the number of fields under 15.
        Open

        class ModuleBasic
        {
            /** ID of this instance */
            public $id = false;
            public $name = false;
        Severity: Minor
        Found in vtlib/Vtiger/ModuleBasic.php by phpmd

        TooManyFields

        Since: 0.1

        Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

        Example

        class Person {
           protected $one;
           private $two;
           private $three;
           [... many more fields ...]
        }

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

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

            public function deleteModuleTables()
            {
                \App\Log::trace('Start', __METHOD__);
                $db = \App\Db::getInstance();
                $db->createCommand()->checkIntegrity(false)->execute();
        Severity: Minor
        Found in vtlib/Vtiger/ModuleBasic.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 __create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __create()
            {
                \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
                $db = \App\Db::getInstance();
        
        
        Severity: Minor
        Found in vtlib/Vtiger/ModuleBasic.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 delete has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function delete()
            {
                $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
                $focus = \CRMEntity::getInstance($this->name);
                if (isset($focus->table_name)) {
        Severity: Minor
        Found in vtlib/Vtiger/ModuleBasic.php - About 1 hr to fix

          The class ModuleBasic has 49 public methods and attributes. Consider reducing the number of public items to less than 45.
          Open

          class ModuleBasic
          {
              /** ID of this instance */
              public $id = false;
              public $name = false;
          Severity: Minor
          Found in vtlib/Vtiger/ModuleBasic.php by phpmd

          ExcessivePublicCount

          Since: 0.1

          A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

          Example

          public class Foo {
              public $value;
              public $something;
              public $var;
              // [... more more public attributes ...]
          
              public function doWork() {}
              public function doMoreWork() {}
              public function doWorkAgain() {}
              // [... more more public methods ...]
          }

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

          Method initTables has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function initTables($basetable = false, $basetableid = false)
              {
                  $this->basetable = $basetable;
                  $this->basetableid = $basetableid;
                  $db = \App\Db::getInstance();
          Severity: Minor
          Found in vtlib/Vtiger/ModuleBasic.php - About 1 hr to fix

            Method setEntityIdentifier has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function setEntityIdentifier(FieldBasic $fieldInstance)
                {
                    $db = \App\Db::getInstance();
            
                    if ($this->basetableid) {
            Severity: Minor
            Found in vtlib/Vtiger/ModuleBasic.php - About 1 hr to fix

              Function setEntityIdentifier has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function setEntityIdentifier(FieldBasic $fieldInstance)
                  {
                      $db = \App\Db::getInstance();
              
                      if ($this->basetableid) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 deleteIcons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function deleteIcons()
                  {
                      \App\Log::trace('Start', __METHOD__);
                      $iconSize = ['', 48, 64, 128];
                      $layouts = array_keys(\App\Layout::getAllLayouts());
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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

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

              class ModuleBasic
              Severity: Major
              Found in vtlib/Vtiger/ModuleBasic.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.

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

              class ModuleBasic
              {
                  /** ID of this instance */
                  public $id = false;
                  public $name = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              CouplingBetweenObjects

              Since: 1.1.0

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

              Example

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

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

              Missing class import via use statement (line '120', column '21').
              Open

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                  public function initTables($basetable = false, $basetableid = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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

              Missing class import via use statement (line '108', column '21').
              Open

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '443', column '21').
              Open

                      $relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                      $query = (new \App\Db\Query())->select(['crmid'])->from('vtiger_crmentity')->where(['setype' => $this->name]);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '253', column '19').
              Open

                      $importer = new \App\Db\Importers\Base();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Remove error control operator '@' on line 560.
              Open

                  public function deleteIcons()
                  {
                      \App\Log::trace('Start', __METHOD__);
                      $iconSize = ['', 48, 64, 128];
                      $layouts = array_keys(\App\Layout::getAllLayouts());
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ErrorControlOperator

              Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

              Example

              function foo($filePath) {
                  $file = @fopen($filPath); // hides exceptions
                  $key = @$array[$notExistingKey]; // assigns null to $key
              }

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

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

                  public function initTables($basetable = false, $basetableid = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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

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

                  public function getFields($blockInstance = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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

              Missing class import via use statement (line '288', column '21').
              Open

                          $isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Avoid using static access to class '\CRMEntity' in method 'delete'.
              Open

                      $focus = \CRMEntity::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'delete'.
              Open

                          Block::deleteForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 '__create'.
              Open

                      \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Module' in method '__create'.
              Open

                      \App\Module::createModuleMetaFile();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 '__delete'.
              Open

                      \App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Module' in method 'initialize'.
              Open

                          $entitydata = \App\Module::getEntityInfo($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Profile' in method '__create'.
              Open

                      Profile::initForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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::trace("Updating Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method 'delete'.
              Open

                      Access::deleteSharing($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Db' in method 'initTables'.
              Open

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method 'setDefaultSharing'.
              Open

                      Access::setDefaultSharing($this, $permission_text);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'unsetAllRelatedList'.
              Open

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Layout' in method 'deleteDir'.
              Open

                      foreach (\App\Layout::getAllLayouts() as $name => $label) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Functions' in method 'deleteDir'.
              Open

                          Functions::recurseDelete("layouts/$name/modules/Settings/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Layout' in method 'deleteIcons'.
              Open

                      $layouts = array_keys(\App\Layout::getAllLayouts());
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method 'disallowSharing'.
              Open

                      Access::allowSharing($this, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 getFields uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $fields = Field::getAllForModule($this);
                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                      $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 __create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $db->createCommand()->insert('vtiger_tab_info', [
                                  'tabid' => $this->id,
                                  'prefname' => 'vtiger_max_version',
                                  'prefvalue' => $this->maxversion,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 '__updateVersion'.
              Open

                      \App\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Filter' in method 'delete'.
              Open

                          Filter::deleteForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'getFields'.
              Open

                          $fields = Field::getAllForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Functions' in method 'deleteDir'.
              Open

                          Functions::recurseDelete("layouts/$name/modules/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 __create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $db->createCommand()->insert('vtiger_tab_info', [
                                  'tabid' => $this->id,
                                  'prefname' => 'vtiger_min_version',
                                  'prefvalue' => $this->minversion,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method 'delete'.
              Open

                          Access::deleteTools($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method 'disableTools'.
              Open

                          Access::updateTool($this, $tool, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'getFields'.
              Open

                          $fields = Field::getAllForBlock($blockInstance, $this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Relation' in method 'unsetAllRelatedList'.
              Open

                          \App\Relation::clearCacheByModule($this->name, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteFromCRMEntity'.
              Open

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Db' in method 'initTables'.
              Open

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'getLinksForExport'.
              Open

                      return Link::getAllForExport($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Functions' in method 'deleteDir'.
              Open

                      Functions::recurseDelete("config/Modules/{$moduleInstance->name}.php");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Functions' in method 'deleteDir'.
              Open

                      Functions::recurseDelete('modules/Settings/' . $moduleInstance->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Functions' in method 'deleteDir'.
              Open

                          Functions::recurseDelete("public_html/layouts/$name/modules/Settings/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Db' in method '__create'.
              Open

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method '__create'.
              Open

                          Access::initSharing($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $this->__create();
                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Cron' in method 'delete'.
              Open

                      Cron::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                      $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\Settings_Vtiger_Module_Model' in method 'delete'.
              Open

                      \Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'unsetAllRelatedList'.
              Open

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'unsetEntityIdentifier'.
              Open

                      \App\Log::trace('Unsetting entity identifier ... DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Functions' in method 'deleteDir'.
              Open

                      Functions::recurseDelete('modules/' . $moduleInstance->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteFromCRMEntity'.
              Open

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Db' in method 'deleteModuleTables'.
              Open

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'setEntityIdentifier'.
              Open

                              \App\Log::trace('Updating entity identifier ... DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Relation' in method 'unsetAllRelatedList'.
              Open

                              \App\Relation::clearCacheById((int) $id, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                          $recordModel = \Vtiger_Record_Model::getInstanceById($crmId, $this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Menu' in method 'delete'.
              Open

                      Menu::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Db' in method 'setEntityIdentifier'.
              Open

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method 'allowSharing'.
              Open

                      Access::allowSharing($this, true);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteIcons'.
              Open

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteIcons'.
              Open

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 '__create'.
              Open

                      \App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 '__delete'.
              Open

                      Module::fireEvent($this->name, Module::EVENT_MODULE_PREUNINSTALL);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Cache' in method 'delete'.
              Open

                      \App\Cache::clear();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteModuleTables'.
              Open

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteDir'.
              Open

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Language' in method 'delete'.
              Open

                      Language::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Module' in method 'delete'.
              Open

                      \App\Module::createModuleMetaFile();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Fields\Tree' in method 'delete'.
              Open

                      \App\Fields\Tree::deleteForModule($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'delete'.
              Open

                      Link::deleteAll($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'setEntityIdentifier'.
              Open

                              \App\Log::trace('Setting entity identifier ... DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\Settings_Workflows_Module_Model' in method 'delete'.
              Open

                      \Settings_Workflows_Module_Model::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteModuleTables'.
              Open

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

                          } else {
                              $db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
                              \App\Log::trace('Updating entity identifier ... DONE', __METHOD__);
                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Access' in method 'enableTools'.
              Open

                          Access::updateTool($this, $tool, true);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Relation' in method 'unsetAllRelatedList'.
              Open

                              \App\Relation::clearCacheByModule((string) \App\Module::getModuleName($tabId), false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Profile' in method 'delete'.
              Open

                      Profile::deleteForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Db' in method 'unsetAllRelatedList'.
              Open

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Module' in method 'unsetAllRelatedList'.
              Open

                              \App\Relation::clearCacheByModule((string) \App\Module::getModuleName($tabId), false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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\Functions' in method 'deleteDir'.
              Open

                          Functions::recurseDelete("public_html/layouts/$name/modules/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 'deleteDir'.
              Open

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                      $this->tabsequence = (int) $valuemap['tabsequence'];
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                              $this->basetable = $entitydata['tablename'];
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                              $this->basetableid = $entitydata['entityidfield'];
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                      $relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                          $isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                      \App\Log::trace('Start', __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                      $this->id = $db->getUniqueID('vtiger_tab', 'tabid', false);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

              Define a constant instead of duplicating this literal "tabid" 20 times.
              Open

                      $this->id = (int) $valuemap['tabid'];
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                      $this->version = $valuemap['version'];
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by sonar-php

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

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

              Noncompliant Code Example

              With the default threshold of 3:

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

              Compliant Solution

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

              Exceptions

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

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

                      foreach (\App\Layout::getAllLayouts() as $name => $label) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              UnusedLocalVariable

              Since: 0.2

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

              Example

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

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

              Assigning int to property but \vtlib\ModuleBasic->id is false
              Open

                      $this->id = $db->getUniqueID('vtiger_tab', 'tabid', false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (moduleId) is false but \App\Fields\Tree::deleteForModule() takes int defined at /code/app/Fields/Tree.php:169
              Open

                      \App\Fields\Tree::deleteForModule($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                              $db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                          Functions::recurseDelete("public_html/layouts/$name/modules/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning int to property but \vtlib\ModuleBasic->tabsequence is false
              Open

                      $this->tabsequence = (int) $valuemap['tabsequence'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                          $db->createCommand()->delete('vtiger_relatedlists_fields', ['relation_id' => $ids])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (mixed) is false but \Vtiger_Module_Model::getInstance() takes int|string defined at /code/modules/Vtiger/models/Module.php:197
              Open

                      $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                              $db->createCommand()->insert('vtiger_tab_info', [
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

                      $query = (new \App\Db\Query())->select(['crmid'])->from('vtiger_crmentity')->where(['setype' => $this->name]);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

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

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

                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                              $db->createCommand()->insert('vtiger_tab_info', [
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Reference to undeclared property \CRMEntity->table_name
              Open

                      if (isset($focus->table_name)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Reference to undeclared property \CRMEntity->table_name
              Open

                          $this->tableName = $focus->table_name;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning 'cf' to property but \vtlib\ModuleBasic->customtable is false
              Open

                          $this->customtable = $this->basetable . 'cf';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (tableName) is false but \App\Db::createTable() takes string defined at /code/app/Db.php:331
              Open

                      $db->createTable($this->basetable, [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

              Argument 1 (moduleName) is false but \App\Relation::clearCacheByModule() takes string defined at /code/app/Relation.php:129
              Open

                          \App\Relation::clearCacheByModule($this->name, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      Functions::recurseDelete('modules/Settings/' . $moduleInstance->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->insert('vtiger_tab', [
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      $db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_crmentityrel', ['or', ['module' => $this->name], ['relmodule' => $this->name]])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning int to property but \vtlib\ModuleBasic->id is false
              Open

                      $this->id = (int) $valuemap['tabid'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->delete('vtiger_relatedlists', ['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 2 (module) is false but \Vtiger_Record_Model::getInstanceById() takes string defined at /code/modules/Vtiger/models/Record.php:763
              Open

                          $recordModel = \Vtiger_Record_Model::getInstanceById($crmId, $this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (moduleName) is false but \App\Module::getEntityInfo() takes ?string defined at /code/app/Module.php:49
              Open

                          $entitydata = \App\Module::getEntityInfo($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      \App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (mixed) is false but \Vtiger_Module_Model::getInstance() takes int|string defined at /code/modules/Vtiger/models/Module.php:197
              Open

                      $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Default value for string $basetable can't be false
              Open

                  public function initTables($basetable = false, $basetableid = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      $db->createCommand()->addPrimaryKey("{$this->basetable}_pk", $this->basetable, $this->basetableid)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                                  $db->createCommand()->dropTable($tableName)->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->checkIntegrity(true)->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $dbCommand = \App\Db::getInstance()->createCommand();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      \App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_modentity_num', ['tabid' => $this->id])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      Functions::recurseDelete("config/Modules/{$moduleInstance->name}.php");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                              $fileName = ROOT_DIRECTORY . "/public_html/layouts/$name/images/{$this->name}{$value}.png";
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                          $this->customtable = $this->basetable . 'cf';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_group2modules', ['tabid' => $this->id])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                          Functions::recurseDelete("layouts/$name/modules/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->addForeignKey(
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

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

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      Functions::recurseDelete('modules/' . $moduleInstance->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (str) is false but \strtolower() takes string
              Open

                      $lcasemodname = strtolower($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Returning type false but getId() is declared to return int
              Open

                      return $this->id;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Parameter $blockInstance has undeclared type \vtlib\vtlib\Block (Did you mean class \vtlib\Block)
              Open

                  public function getFields($blockInstance = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

                      $relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                          $db->createCommand()->delete('a_#__relatedlists_inv_fields', ['relation_id' => $ids])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

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

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                      \App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (moduleName) is false but \Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule() takes \type defined at /code/modules/Settings/Vtiger/models/Module.php:162
              Open

                      \Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (tableName) is false but \App\Db::createTable() takes string defined at /code/app/Db.php:331
              Open

                      $db->createTable($this->customtable, [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                                  $db->createCommand()->dropTable($tableName)->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (tabid) is false but \vtlib\Link::deleteAll() takes int defined at /code/vtlib/Vtiger/Link.php:146
              Open

                      Link::deleteAll($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Default value for string $basetableid can't be false
              Open

                  public function initTables($basetable = false, $basetableid = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning string to property but \vtlib\ModuleBasic->basetable is false
              Open

                          $this->basetable = 'u_' . $db->getConfig('base')['tablePrefix'] . $lcasemodname;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->addForeignKey(
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_entityname', ['tabid' => $this->id])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                          Functions::recurseDelete("layouts/$name/modules/Settings/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                          Functions::recurseDelete("public_html/layouts/$name/modules/Settings/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->addPrimaryKey("{$this->basetable}_pk", $this->basetable, $this->basetableid)->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                              $db->createCommand()->insert('vtiger_entityname', [
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      $db->createCommand()->checkIntegrity(false)->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                      \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Argument 1 (module) is false but \CRMEntity::getInstance() takes string defined at /code/include/CRMEntity.php:61
              Open

                      $focus = \CRMEntity::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

                          $isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
              Severity: Critical
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning int to property but \vtlib\ModuleBasic->isentitytype is true
              Open

                      $this->isentitytype = (int) $valuemap['isentitytype'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning int to property but \vtlib\ModuleBasic->tabsequence is false
              Open

                          $this->tabsequence = $db->getUniqueID('vtiger_tab', 'tabsequence', false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning string to property but \vtlib\ModuleBasic->version is int
              Open

                      $this->version = $newVersion;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Assigning string to property but \vtlib\ModuleBasic->basetableid is false
              Open

                          $this->basetableid = $lcasemodname . 'id';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

              Default value for \vtlib\vtlib\Block $blockInstance can't be false
              Open

                  public function getFields($blockInstance = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phan

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

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

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

                      if ($this->minversion) {
                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
                          if ($isExists) {
                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
                          } else {
              Severity: Major
              Found in vtlib/Vtiger/ModuleBasic.php and 1 other location - About 2 hrs to fix
              vtlib/Vtiger/ModuleBasic.php on lines 119..130

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 134.

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

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

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

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

              Refactorings

              Further Reading

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

                      if ($this->maxversion) {
                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
                          if ($isExists) {
                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
                          } else {
              Severity: Major
              Found in vtlib/Vtiger/ModuleBasic.php and 1 other location - About 2 hrs to fix
              vtlib/Vtiger/ModuleBasic.php on lines 107..118

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 134.

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

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

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

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

              Refactorings

              Further Reading

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

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

                  public $id = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

              The parameter $permission_text is not named in camelCase.
              Open

                  public function setDefaultSharing($permission_text = 'Public_ReadWriteDelete')
                  {
                      Access::setDefaultSharing($this, $permission_text);
                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              CamelCaseParameterName

              Since: 0.2

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

              Example

              class ClassName {
                  public function doSomething($user_name) {
                  }
              }

              Source

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $presence = 0;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $tabsequence = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $entityidfield = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $basetableid = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $id = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $maxversion = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $ownedby = 0; // 0 - Sharing Access Enabled, 1 - Sharing Access Disabled
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $customized = 1;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $customtable = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /** ID of this instance */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $version = 0;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $parent = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->label = $valuemap['tablabel'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->id = $db->getUniqueID('vtiger_tab', 'tabid', false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->label = $this->name;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->minversion) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'prefvalue' => $this->maxversion,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              ])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $premium = 0;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'presence' => $this->presence,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          } else {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'prefname' => 'vtiger_max_version',
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->isentitytype) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->deleteFromCRMEntity();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->basetableid = $lcasemodname . 'id';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'tabid' => $this->id,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'modulename' => $this->name,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'entityidfield' => $this->entityidfield,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  const EVENT_MODULE_DISABLED = 'module.disabled';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  const EVENT_MODULE_POSTINSTALL = 'module.postinstall';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->ownedby = $valuemap['ownedby'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->isentitytype || 'Users' === $this->name) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Update this instance.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Link::deleteAll($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param string $basetableid Base table column (default modulenameid in lowercase)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      ]);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param FieldBasic $fieldInstance
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 262 characters
              Open

                              $db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $minversion = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $entitydata = \App\Module::getEntityInfo($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'tablabel' => $this->label,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function __delete()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $dbCommand = \App\Db::getInstance()->createCommand();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->id) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->isentitytype) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->deleteCRMEntityRel();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function initTables($basetable = false, $basetableid = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $importer = new \App\Db\Importers\Base();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          if (!$isExists) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  const EVENT_MODULE_PREUNINSTALL = 'module.preuninstall';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  const EVENT_MODULE_PREUPDATE = 'module.preupdate';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->presence = (int) $valuemap['presence'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->isentitytype = (int) $valuemap['isentitytype'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'tabsequence' => $this->tabsequence,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'customized' => $this->customized,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'tabid' => $this->id,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 148 characters
              Open

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Save this instance.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->__delete();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->deleteDir($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->addForeignKey(
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Set entity identifier field for this module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'tablename' => $fieldInstance->table,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $label = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'version' => $this->version,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $db->createCommand()->insert('vtiger_tab_info', [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $dbCommand->delete('a_#__settings_modules', ['name' => $this->name])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (!$this->basetableid) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->addForeignKey(
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      )->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Configure default sharing access for the module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function setDefaultSharing($permission_text = 'Public_ReadWriteDelete')
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $isentitytype = true; // Real module or an extension?
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $basetable = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $type = 0;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->version = $valuemap['version'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'premium' => $this->premium,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->maxversion) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Profile::initForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          if ($entitydata) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'name' => $this->name,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'type' => $this->type,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'tabid' => $this->id,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function __updateVersion($newVersion)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 133 characters
              Open

                      \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->__update();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function __update()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Module::fireEvent($this->name, Module::EVENT_MODULE_PREUNINSTALL);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->deleteIcons();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $dbCommand->delete('vtiger_tab', ['tabid' => $this->id])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->deleteModuleTables();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function delete()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createTable($this->basetable, [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (!$this->customtable) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $this->entityidfield = $this->basetableid;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'fieldname' => $fieldInstance->name,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'sequence' => $this->id,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              \App\Log::trace('Setting entity identifier ... DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $grouptable = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  const EVENT_MODULE_ENABLED = 'module.enabled';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->premium = (int) $valuemap['premium'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Create this module instance.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'isentitytype' => $this->isentitytype ? 1 : 0,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              ])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Update module version information.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Delete this instance.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Block::deleteForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Menu::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Profile::deleteForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createTable($this->customtable, [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 175 characters
              Open

                          substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          if (!$this->entityidcolumn) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              \App\Log::trace('Updating entity identifier ... DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param mixed $valuemap
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->id = (int) $valuemap['tabid'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (!$this->label) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'tabid' => $this->id,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'parent' => $this->parent,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          if ($isExists) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 171 characters
              Open

                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Module::createModuleMetaFile();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function save()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Fields\Tree::deleteForModule($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      // Initialize tablename and index column names
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->basetable = 'u_' . $db->getConfig('base')['tablePrefix'] . $lcasemodname;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->basetableid => $importer->integer(10),
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function setEntityIdentifier(FieldBasic $fieldInstance)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->entityidfield && $this->entityidcolumn) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $name = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $tableName;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Initialize this instance.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->tabsequence = (int) $valuemap['tabsequence'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Access::initSharing($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      } else {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Creates basetable, customtable, grouptable <br />
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $lcasemodname = strtolower($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 152 characters
              Open

                          $isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Access::setDefaultSharing($this, $permission_text);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public $entityidcolumn = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      ])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 148 characters
              Open

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $db->createCommand()->insert('vtiger_tab_info', [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Delete this instance.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      return $this->id;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Initialize table required for the module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          if (!$this->entityidfield) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function unsetEntityIdentifier()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_entityname', ['tabid' => $this->id])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 147 characters
              Open

                   * @param string $permission_text Permission text should be one of ['Public_ReadWriteDelete', 'Public_ReadOnly', 'Public_ReadWrite', 'Private']
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Access::allowSharing($this, true);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->parent = $valuemap['parent'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $this->basetable = $entitydata['tablename'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->tabsequence = $db->getUniqueID('vtiger_tab', 'tabsequence', false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param string $newVersion
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->version = $newVersion;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $focus = \CRMEntity::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (isset($focus->table_name)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->tableName = $focus->table_name;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Access::deleteSharing($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \Settings_Workflows_Module_Model::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->deleteGroup2Modules();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Module::createModuleMetaFile();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (!$this->basetable) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      )->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      ]);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->basetableid) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              ])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          } else {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param string $permission_text Permission text should be one of ['Public_ReadWriteDelete', 'Public_ReadOnly', 'Public_ReadWrite', 'Private']
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $this->basetableid = $entitydata['entityidfield'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          'ownedby' => $this->ownedby,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 171 characters
              Open

                              $db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'prefvalue' => $this->minversion,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          if ($isExists) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($this->isentitytype) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->unsetEntityIdentifier();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Access::deleteTools($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->deleteFromModentityNum();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Cache::clear();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * grouptable name is basetable + 'grouprel'<br />.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  const EVENT_MODULE_POSTUPDATE = 'module.postupdate';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function initialize($valuemap)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->name = $valuemap['name'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->type = (int) $valuemap['type'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (!$this->tabsequence) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->basetable = $basetable;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->basetableid = $basetableid;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->basetableid => $importer->integer(10),
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 162 characters
              Open

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $this->entityidcolumn = $this->basetableid;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $db->createCommand()->insert('vtiger_entityname', [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('Unsetting entity identifier ... DONE', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Filter::deleteForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * customtable name is basetable + 'cf'<br />
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param string $basetable   Base table name (default modulename in lowercase)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->customtable = $this->basetable . 'cf';
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'entityidcolumn' => $this->entityidcolumn,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'searchcolumn' => $fieldInstance->name,
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Allow module sharing control.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function allowSharing()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->customized = (int) $valuemap['customized'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function __create()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->insert('vtiger_tab', [
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  'prefname' => 'vtiger_min_version',
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          } else {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $this->__create();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $this->unsetAllRelatedList();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Language::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Cron::deleteForModule($moduleInstance);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->addPrimaryKey("{$this->basetable}_pk", $this->basetable, $this->basetableid)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 122 characters
              Open

                      $db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Unset entity identifier information.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      return $this;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @return $this
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function addFilter(Filter $filterInstance)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $fields = Field::getAllForBlock($blockInstance, $this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function disallowSharing()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      return $this->id;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Unset related list information that exists with other module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $db->createCommand()->delete('vtiger_relatedlists_fields', ['relation_id' => $ids])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              \App\Relation::clearCacheByModule((string) \App\Module::getModuleName($tabId), false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          \App\Relation::clearCacheByModule($this->name, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to remove rows in vtiger_group2modules table.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $query = (new \App\Db\Query())->select(['crmid'])->from('vtiger_crmentity')->where(['setype' => $this->name]);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Disallow module sharing control.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param Filter $filterInstance
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Get all the custom links related to this module for exporting.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Disable tools for this module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (\is_string($tools)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Add block to this module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_group2modules', ['tabid' => $this->id])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to remove rows in vtiger_crmentityrel.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_crmentityrel', ['or', ['module' => $this->name], ['relmodule' => $this->name]])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $dataReader = $query->createCommand()->query();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      while ($crmId = $dataReader->readColumn(0)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function enableTools($tools)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param Block $blockInstance
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param vtlib\Block $blockInstance - Instance of block to use to get fields, false to get all the block fields
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 213 characters
              Open

                      $relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              \App\Relation::clearCacheById((int) $id, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @return int
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->delete('vtiger_relatedlists', ['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (\is_string($tools)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $tools = [$tools];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($blockInstance) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function getLinksForExport()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function deleteGroup2Modules()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Access::updateTool($this, $tool, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $filterInstance->save($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function getId()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function unsetAllRelatedList()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $recordModel = \Vtiger_Record_Model::getInstanceById($crmId, $this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $tools = [0 => $tools];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to get the Module/Tab id.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function getFields($blockInstance = false)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      return Link::getAllForExport($this->id);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $db->createCommand()->delete('a_#__relatedlists_inv_fields', ['relation_id' => $ids])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 155 characters
              Open

                      \App\Db::getInstance()->createCommand()->delete('vtiger_crmentityrel', ['or', ['module' => $this->name], ['relmodule' => $this->name]])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param string|array $tools - String or Array with value ['Import', 'Export']
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @return $this
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          foreach ($ids as $id) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function deleteCRMEntityRel()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      foreach ($tools as $tool) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function addBlock(Block $blockInstance)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $fields = Field::getAllForModule($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function deleteFromCRMEntity()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to remove row in vtiger_modentity_num table.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function deleteFromModentityNum()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      return $this;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to remove rows in vtiger_crmentity, vtiger_crmentityrel.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Access::updateTool($this, $tool, true);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Get all the fields of the module or block.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      } else {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 135 characters
              Open

                      $db->createCommand()->delete('vtiger_relatedlists', ['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $recordModel->delete();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          foreach ($iconSize as $value) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param string|array $tools String or Array with value ['Import', 'Export']
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $ids = array_keys($relations);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if (!empty($this->tableName)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * @param ModuleBasic $moduleInstance
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Functions::recurseDelete("config/Modules/{$moduleInstance->name}.php");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Functions::recurseDelete("layouts/$name/modules/Settings/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      foreach ($layouts as $name) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Access::allowSharing($this, false);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Enable tools for this module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      foreach ($tools as $tool) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function disableTools($tools)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $blockInstance->save($this);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Add filter to this module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $fields = false;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      return $fields;
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($relations) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          foreach (array_unique($relations) as $tabId) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to remove tables created by a module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->checkIntegrity(true)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   *
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      foreach (\App\Layout::getAllLayouts() as $name => $label) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              if ($db->isTableExists($tableName)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Functions::recurseDelete("layouts/$name/modules/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Functions::recurseDelete("public_html/layouts/$name/modules/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          Functions::recurseDelete("public_html/layouts/$name/modules/Settings/{$moduleInstance->name}");
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function deleteIcons()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $iconSize = ['', 48, 64, 128];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          foreach ($tablesName as $tableName) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db->createCommand()->checkIntegrity(false)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  $db->createCommand()->dropTable($tableName)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $tablesName = [$this->tableName . 'cf', $this->tableName];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          foreach ($tablesName as $tableName) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  $db->createCommand()->dropTable($tableName)->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to remove files related to a module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function deleteModuleTables()
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Functions::recurseDelete('modules/Settings/' . $moduleInstance->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              if ($db->isTableExists($tableName)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   * Function to remove icons related to a module.
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $layouts = array_keys(\App\Layout::getAllLayouts());
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Db::getInstance()->createCommand()->delete('vtiger_modentity_num', ['tabid' => $this->id])->execute();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  public function deleteDir(self $moduleInstance)
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      Functions::recurseDelete('modules/' . $moduleInstance->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      $moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              if (file_exists($fileName)) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                                  @unlink($fileName);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          $tablesName = [$this->tableName . '_inventory', $this->tableName . '_invfield', $this->tableName . '_invmap'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                   */
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              Line exceeds 120 characters; contains 122 characters
              Open

                          $tablesName = [$this->tableName . '_inventory', $this->tableName . '_invfield', $this->tableName . '_invmap'];
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                          }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              $fileName = ROOT_DIRECTORY . "/public_html/layouts/$name/images/{$this->name}{$value}.png";
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('End', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                              }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  /**
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      if ($moduleInstance->isInventory()) {
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                      \App\Log::trace('Start', __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

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

                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpcodesniffer

              The variable $permission_text is not named in camelCase.
              Open

                  public function setDefaultSharing($permission_text = 'Public_ReadWriteDelete')
                  {
                      Access::setDefaultSharing($this, $permission_text);
                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.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 method __create is not named in camelCase.
              Open

                  public function __create()
                  {
                      \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
                      $db = \App\Db::getInstance();
              
              
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              CamelCaseMethodName

              Since: 0.2

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

              Example

              class ClassName {
                  public function get_name() {
                  }
              }

              Source

              The method __delete is not named in camelCase.
              Open

                  public function __delete()
                  {
                      Module::fireEvent($this->name, Module::EVENT_MODULE_PREUNINSTALL);
                      if ($this->isentitytype) {
                          $this->unsetEntityIdentifier();
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              CamelCaseMethodName

              Since: 0.2

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

              Example

              class ClassName {
                  public function get_name() {
                  }
              }

              Source

              The method __update is not named in camelCase.
              Open

                  public function __update()
                  {
                      \App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
                  }
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              CamelCaseMethodName

              Since: 0.2

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

              Example

              class ClassName {
                  public function get_name() {
                  }
              }

              Source

              The method __updateVersion is not named in camelCase.
              Open

                  public function __updateVersion($newVersion)
                  {
                      \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
                      $this->version = $newVersion;
                      \App\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
              Severity: Minor
              Found in vtlib/Vtiger/ModuleBasic.php by phpmd

              CamelCaseMethodName

              Since: 0.2

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

              Example

              class ClassName {
                  public function get_name() {
                  }
              }

              Source

              There are no issues that match your filters.

              Category
              Status