YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/models/Link.php

Summary

Maintainability
D
1 day
Test Coverage
D
61%

Function convertToNativeLink has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function convertToNativeLink()
    {
        $url = $this->get('linkurl');
        if (empty($url)) {
            return $url;
Severity: Minor
Found in modules/Vtiger/models/Link.php - About 6 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

class Vtiger_Link_Model extends vtlib\Link
{
    // Class variable to store the child links
    protected $childlinks = [];

Severity: Minor
Found in modules/Vtiger/models/Link.php by phpmd

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

    public function convertToNativeLink()
    {
        $url = $this->get('linkurl');
        if (empty($url)) {
            return $url;
Severity: Major
Found in modules/Vtiger/models/Link.php - About 2 hrs to fix

    Vtiger_Link_Model has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Vtiger_Link_Model extends vtlib\Link
    {
        // Class variable to store the child links
        protected $childlinks = [];
    
    
    Severity: Minor
    Found in modules/Vtiger/models/Link.php - About 2 hrs to fix

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

          public static function getAllByType($tabid, $type = [], $parameters = false)
          {
              $links = Vtiger_Cache::get('links-' . $tabid, $type);
              if (!$links) {
                  $links = parent::getAllByType($tabid, $type, $parameters);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 getInstanceFromLinkObject has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getInstanceFromLinkObject(vtlib\Link $linkObj)
          {
              $objectProperties = get_object_vars($linkObj);
              $linkModel = new self();
      
      
      Severity: Minor
      Found in modules/Vtiger/models/Link.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

      The method convertToNativeLink() has an NPath complexity of 276640. The configured NPath complexity threshold is 200.
      Open

          public function convertToNativeLink()
          {
              $url = $this->get('linkurl');
              if (empty($url)) {
                  return $url;
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      NPathComplexity

      Since: 0.1

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

      Example

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

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

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

          public function convertToNativeLink()
          {
              $url = $this->get('linkurl');
              if (empty($url)) {
                  return $url;
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

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

          public static function getAllByType($tabid, $type = [], $parameters = false)
          {
              $links = Vtiger_Cache::get('links-' . $tabid, $type);
              if (!$links) {
                  $links = parent::getAllByType($tabid, $type, $parameters);
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

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

          public function convertToNativeLink()
      Severity: Critical
      Found in modules/Vtiger/models/Link.php by sonar-php

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

      See

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

      class Vtiger_Link_Model extends vtlib\Link
      Severity: Major
      Found in modules/Vtiger/models/Link.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 method getRelatedModuleName has a boolean flag argument $defaultModuleName, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function getRelatedModuleName($defaultModuleName = false)
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 getAllByType has a boolean flag argument $parameters, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function getAllByType($tabid, $type = [], $parameters = false)
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Layout' in method 'getInstanceFromLinkObject'.
      Open

                  $filePath1 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 getRelatedModuleName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $relatedModuleName = $this->relatedModuleName;
              }
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 'convertToNativeLink'.
      Open

                  $relatedModuleModel = Vtiger_Module_Model::getInstance($module);
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              $links = Vtiger_Cache::get('links-' . $tabid, $type);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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\Json' in method 'getInstanceFromLinkObject'.
      Open

                  $params = \App\Json::decode($objectProperties['params']);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 'getRelatedModuleName'.
      Open

                  $queryParams = vtlib\Functions::getQueryParams($this->get('linkurl'));
      Severity: Minor
      Found in modules/Vtiger/models/Link.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_Theme' in method 'getIconPath'.
      Open

              return Vtiger_Theme::getImagePath($this->getIcon());
      Severity: Minor
      Found in modules/Vtiger/models/Link.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_Relation_Model' in method 'convertToNativeLink'.
      Open

                  $relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  Vtiger_Cache::set('links-' . $tabid, $type, $links);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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\Privilege' in method 'getAllByType'.
      Open

                      if ((empty($type) || \in_array($linkType, $type)) && !(isset($queryParams['module']) && !\App\Privilege::isPermitted($queryParams['module']))) {
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  return \App\Purifier::encodeHtml($url);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 'convertToNativeLink'.
      Open

                  $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              return \App\Purifier::encodeHtml(implode('&', $parametersParts));
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 'getInstanceFromLinkObject'.
      Open

                  $filePath2 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 'getAllByType'.
      Open

                      $queryParams = vtlib\Functions::getQueryParams($linkObject->linkurl);
      Severity: Minor
      Found in modules/Vtiger/models/Link.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 "parent" 3 times.
      Open

                  if (0 === strcmp($key, 'parent')) {
      Severity: Critical
      Found in modules/Vtiger/models/Link.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  if (0 === strcmp($key, 'module') || 0 === strcmp($key, 'index.php?module')) {
      Severity: Critical
      Found in modules/Vtiger/models/Link.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 "params" 3 times.
      Open

              if (!empty($objectProperties['params'])) {
      Severity: Critical
      Found in modules/Vtiger/models/Link.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 "linkurl" 3 times.
      Open

              $url = $this->get('linkurl');
      Severity: Critical
      Found in modules/Vtiger/models/Link.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 "_layoutName_" 3 times.
      Open

              if (false !== strpos($linkModel->linkurl, '_layoutName_')) {
      Severity: Critical
      Found in modules/Vtiger/models/Link.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.

      Reference to undeclared property \Vtiger_Link_Model->relatedModuleName
      Open

                  $this->relatedModuleName = $parent ? "$parent:$module" : $module;
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

      Reference to undeclared property \Vtiger_Link_Model->relatedModuleName
      Open

              if (!empty($module) && !isset($this->relatedModuleName)) {
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

      Method \Vtiger_Link_Model::hasChild is declared to return bool but has no return value
      Open

          public function hasChild()
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

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

                  foreach ($linkObjects as $linkObject) {
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

      Reference to undeclared property \Vtiger_Link_Model->relatedModuleName (Did you mean $relatedModuleName)
      Open

              if (empty($this->relatedModuleName)) {
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

      Saw unextractable annotation for comment '* @return <class name>'</class>
      Open

           * @return <class name>
      Severity: Info
      Found in modules/Vtiger/models/Link.php by phan

      Reference to undeclared property \Vtiger_Link_Model->relatedModuleName (Did you mean $relatedModuleName)
      Open

                      $this->relatedModuleName = $relatedModuleName = isset($queryParams['parent']) ? $queryParams['parent'] . ':' . $queryParams['module'] : $queryParams['module'];
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

      Saw unextractable annotation for comment '* @param <object> $propertyValue'</object>
      Open

           * @param <Object> $propertyValue
      Severity: Info
      Found in modules/Vtiger/models/Link.php by phan

      Saw unextractable annotation for comment '* @return <string> - returns image path if icon exits'</string>
      Open

           * @return <String/Boolean> - returns image path if icon exits
      Severity: Info
      Found in modules/Vtiger/models/Link.php by phan

      Saw unextractable annotation for comment '* @return <class name>'</class>
      Open

           * @return <class name>
      Severity: Info
      Found in modules/Vtiger/models/Link.php by phan

      Saw unextractable annotation for comment '* @return <number>'</number>
      Open

           * @return <Number>
      Severity: Info
      Found in modules/Vtiger/models/Link.php by phan

      Reference to undeclared property \Vtiger_Link_Model->active
      Open

              return $this->active ?? true;
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

      Reference to undeclared property \Vtiger_Link_Model->relatedModuleName (Did you mean $relatedModuleName)
      Open

                  $relatedModuleName = $this->relatedModuleName;
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phan

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

      class Vtiger_Link_Model extends vtlib\Link

      The class Vtiger_Link_Model is not named in CamelCase.
      Open

      class Vtiger_Link_Model extends vtlib\Link
      {
          // Class variable to store the child links
          protected $childlinks = [];
      
      
      Severity: Minor
      Found in modules/Vtiger/models/Link.php by phpmd

      CamelCaseClassName

      Since: 0.2

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

      Example

      class class_name {
      }

      Source

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

          /**

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

          {

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

           */

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

           * Function to get the link url.

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

          {

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

          {

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

              return $this->linkicon;

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

           *

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

           * @param string $propertyName

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

          }

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

           * @return Vtiger_Link_Model instance

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

              return $this;

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

           * Function to check whether link is active.

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

           * Function to get the link type.

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

          {

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

           * @param <Object> $propertyValue

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

          {

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

           * @return string

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

          }

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

           * Function to get the link label.

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

           * Function to get the link header icon name.

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

          }

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

           * Function to check whether link has icon or not.

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

          public function isIconExists()

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

              $linkIcon = $this->getIcon();

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

              }

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

              return property_exists($this, $propertyName) ? $this->{$propertyName} : '';

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

          /**

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

              $this->{$propertyName} = $propertyValue;

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

           * @return bool

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

          public function getUrl()

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

          }

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

          /**

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

          }

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

           */

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

          {

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

           */

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

           */

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

          /**

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

           *

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

          public function getLabel()

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

           * @return string

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

          // Class variable to store the child links

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

           * @return mixed

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

           *

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

           */

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

           * @return bool true/false

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

          }

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

              return $this->linklabel;

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

           * @return string

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

          }

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

          public function get($propertyName)

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

          public function set($propertyName, $propertyValue)

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

           *

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

          /**

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

              return $this->icon;

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

              if (empty($linkIcon)) {

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

           */

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

           * @return string

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

           *

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

          public function getType()

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

           *

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

           * Function to get the value of a given property.

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

           *

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

          }

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

           */

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

          /**

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

           * Function to get the link icon name.

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

          protected $childlinks = [];

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

           * @throws Exception

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

           *

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

          /**

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

          public function isActive()

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

              return $this->linktype;

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

          /**

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

              return true;

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

              return $this->active ?? true;

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

          /**

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

          {

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

          }

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

           *

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

           */

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

           * @return string

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

                  return false;

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

           * @param string   $propertyName

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

          {

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

           *

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

          {

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

           *

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

           * Function to set the value of a given property.

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

              return $this->convertToNativeLink();

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

          public function getIcon()

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

           *

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

          public function getHeaderIcon()

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

           */

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

          /**

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

          }

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

           * Function to get the link id.

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

           * Function to Add link to the child link list.

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

                      //Indicating that it is an relation operation

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

                  if (0 === strcmp($key, 'sourceRecord')) {

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

                  }

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

              }

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

                      foreach ($fieldList as $fieldModel) {

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

           */

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

          public function getGrupClassName()

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

          /**

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

          public function getId()

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

          /**

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

          /**

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

           */

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

          }

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

          {

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

              $module = $parent = false;

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

                  if (0 === strcmp($key, 'return_module')) {

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

                  if (0 === strcmp($key, 'sourceModule')) {

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

                  $newUrlParts[] = $key;

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

                  $relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);

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

                  if ($relationModel && $relationModel->isDirectRelation()) {

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

           *

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

          {

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

          }

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

                  return true;

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

              if (!$this->isPageLoadLink()) {

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

                      continue;

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

                  $value = $urlParts[1];

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

                  if (0 === strcmp($key, 'action') && strpos($value, 'View')) {

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

                      $parent = $value;

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

                              $referenceList = $fieldModel->getReferenceList();

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

           * @return <String/Boolean> - returns image path if icon exits

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

           *                          else returns false;

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

           */

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

              if (!$this->isIconExists()) {

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

              }

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

          }

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

          public function getClassName()

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

          {

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

           * @result Vtiger_Link_Model - current Instance;

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

           */

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

          public function convertToNativeLink()

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

                  }

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

                  $key = $urlParts[0];

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

                  $newUrlParts = [];

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

                  $parametersParts[$index] = implode('=', $newUrlParts);

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

           */

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

              return $this->linkid;

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

           * @param Vtiger_Link_Model $link - link model

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

              return $this;

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

          {

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

          {

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

              $sourceModule = false;

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

                  }

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

          {

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

          public function getChildLinks()

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

          }

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

              //to append the reference field in one to many relation

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

          {

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

           *

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

                      $fieldList = $relatedModuleModel->getFields();

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

           * @return <class name>

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

          public function isPageLoadLink()

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

           * @return string

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

              $url = $this->get('linkurl');

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

                  return $url;

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

              $sourceRecord = false;

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

              $parametersParts = explode('&', $url);

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

                      $newUrlParts[] = $value;

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

                  }

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

          public function getIconPath()

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

           *

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

           *

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

          public function addChildLink(self $link)

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

          }

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

           *

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

           *

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

              //Check if the link is not javascript

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

           * Function to get the Class Name.

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

           * @return <Number>

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

           * Function to get all the child links.

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

          /**

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

                  if (0 === strcmp($key, 'parent')) {

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

                          if ($fieldModel->isReferenceField()) {

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

           * Function to retrieve the icon path for the link icon.

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

           * Function to get the grup Class Name.

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

           */

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

          }

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

              $this->childlinks[] = $link;

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

              //See if indexing is need depending only user selection

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

                      $module = $value;

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

                      $parametersParts[] = 'relationOperation=true';

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

                  if (0 === strcmp($key, 'return_id')) {

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

                  return false;

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

              return $this->get('linkclass') ?? '';

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

           *

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

          {

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

          {

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

              return $this->childlinks;

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

              (\count($this->childlinks) > 0) ? true : false;

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

              }

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

              }

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

                  if (false === strpos($keyValue, '=')) {

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

                      $value = str_replace('View', '', $value);

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

                  }

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

                      $sourceModule = $value;

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

                  $relatedModuleModel = Vtiger_Module_Model::getInstance($module);

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

          /**

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

           *

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

              return Vtiger_Theme::getImagePath($this->getIcon());

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

           */

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

           * @result <array> - list of Vtiger_Link_Model instances

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

          }

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

                  if (0 === strcmp($key, 'module') || 0 === strcmp($key, 'index.php?module')) {

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

                      $key = 'view';

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

                      $key = 'sourceRecord';

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

                  }

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

                  if (!empty($value) || 0 == $value) {

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

              if (!empty($module) && !empty($sourceModule) && !empty($sourceRecord) && empty($parent)) {

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

                  $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);

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

              $url = $this->get('linkurl');

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

              foreach ($parametersParts as $index => $keyValue) {

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

                  $urlParts = explode('=', $keyValue);

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

                  }

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

                      $sourceRecord = $value;

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

           * @return <class name>

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

          }

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

          public function setChildLink($links)

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

           * Function to check whether the link model has any child links.

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

           */

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

          public function hasChild()

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

              if (0 === strpos($url, 'index')) {

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

              }

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

          /**

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

           * Convert to native link.

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

                  //To convert single quotes and double quotes

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

                  return \App\Purifier::encodeHtml($url);

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

          /**

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

              return $this->get('linkgrupclass');

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

              $this->childlinks = $links;

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

          {

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

           * @return bool true/false

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

              return false;

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

              if (empty($url)) {

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

                  }

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

                      $key = 'sourceModule';

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

                  }

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

          {

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

          {

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

          public static function getAllByType($tabid, $type = [], $parameters = false)

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

              foreach ($links as $linkType => $linkObjects) {

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

                      }

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

              $relatedModuleName = $defaultModuleName;

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

          }

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

                      }

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

                  }

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

              }

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

              return \App\Purifier::encodeHtml(implode('&', $parametersParts));

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

           * @param vtlib\Link $linkObj

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

                  unset($objectProperties['params']);

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

              return $linkModel;

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

          }

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

           *

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

              return $linkModel;

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

          /**

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

              }

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

          /**

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

           * @param int        $tabid

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

              $links = Vtiger_Cache::get('links-' . $tabid, $type);

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

          public function getRelatedModuleName($defaultModuleName = false)

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

                      $this->relatedModuleName = $relatedModuleName = isset($queryParams['parent']) ? $queryParams['parent'] . ':' . $queryParams['module'] : $queryParams['module'];

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

              }

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

           *

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

                          $linkModel->{$properName} = $propertyValue;

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

                      $linkModel->linkurl = $filePath2;

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

                          $linkModels[$linkType][] = self::getInstanceFromLinkObject($linkObject);

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

                  }

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

           * @param mixed $defaultModuleName

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

          {

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

              if (!empty($module) && !isset($this->relatedModuleName)) {

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

           * @return Vtiger_Link_Model instance

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

           * @return Vtiger_Link_Model instance

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

              }

      Line exceeds 120 characters; contains 121 characters
      Open

                  } elseif (is_file(ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $filePath2)) {

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

           * Function to get all the Vtiger Link Models for a module of the given list of link types.

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

                  foreach ($type as $element) {

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

                  foreach ($linkObjects as $linkObject) {

      Line exceeds 120 characters; contains 175 characters
      Open

                      $this->relatedModuleName = $relatedModuleName = isset($queryParams['parent']) ? $queryParams['parent'] . ':' . $queryParams['module'] : $queryParams['module'];

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

                  $relatedModuleName = $this->relatedModuleName;

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

                          }

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

              $linkModel = new self();

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

                      $linkModel->{$property} = $value;

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

          public static function getInstanceFromLinkObject(vtlib\Link $linkObj)

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

              }

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

           */

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

                  Vtiger_Cache::set('links-' . $tabid, $type, $links);

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

              }

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

           * Function to get the relatedModuleName.

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

                  }

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

          /**

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

           */

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

              }

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

              $linkModel = new self();

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

                  }

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

                  }

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

           * @param string[]   $type

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

           *

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

              $linkModel->initialize($valueMap);

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

              foreach ($valueMap as $property => $value) {

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

           * Function to get the instance of Vtiger Link Model from a given vtlib\Link object.

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

                  } elseif (is_file(ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $filePath2)) {

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

           * @param bool|array $parameters

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

          {

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

           */

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

          }

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

                  $filePath1 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);

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

              }

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

              }

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

                      if ((empty($type) || \in_array($linkType, $type)) && !(isset($queryParams['module']) && !\App\Privilege::isPermitted($queryParams['module']))) {

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

                  $queryParams = vtlib\Functions::getQueryParams($this->get('linkurl'));

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

              if (!empty($objectProperties['params'])) {

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

              // added support for multilayout

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

                      $linkModel->linkurl = $filePath1;

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

                  }

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

          /**

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

           *

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

                                  $parametersParts[] = $fieldModel->get('name') . '=' . $sourceRecord;

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

              }

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

              //To convert single quotes and double quotes

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

           * Function to get the instance of Vtiger Link Model from the given array of key-value mapping.

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

              $objectProperties = get_object_vars($linkObj);

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

                  if (is_file(ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $filePath1)) {

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

           *

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

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

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

                  }

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

           */

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

           * @return Vtiger_Link_Model[] - List of Vtiger_Link_Model instances

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

                  $links = parent::getAllByType($tabid, $type, $parameters);

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

                      $linkModels[$element] = [];

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

           * @return string

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

                              if (\in_array($sourceModuleModel->get('name'), $referenceList)) {

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

                              }

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

                  $this->relatedModuleName = $parent ? "$parent:$module" : $module;

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

          }

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

           *

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

              // To set other properties for Link Model

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

           *

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

                  if (!empty($params)) {

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

              return $linkModels;

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

                  if (isset($queryParams['module'])) {

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

              return $relatedModuleName;

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

                  $params = \App\Json::decode($objectProperties['params']);

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

                      }

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

              foreach ($objectProperties as $properName => $propertyValue) {

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

              if (false !== strpos($linkModel->linkurl, '_layoutName_')) {

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

          }

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

              $linkModels = [];

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

              } else {

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

           * @param array $valueMap

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

                  $filePath2 = str_replace('_layoutName_', \App\Layout::getActiveLayout(), $linkModel->linkurl);

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

              if (!empty($type)) {

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

                      $queryParams = vtlib\Functions::getQueryParams($linkObject->linkurl);

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

          public static function getInstanceFromValues($valueMap)

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

                  if (!isset($linkModel->{$property})) {

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

                      foreach ($params as $properName => $propertyValue) {

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

                  $linkModel->{$properName} = $propertyValue;

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

           *

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

              if (!$links) {

      Line exceeds 120 characters; contains 160 characters
      Open

                      if ((empty($type) || \in_array($linkType, $type)) && !(isset($queryParams['module']) && !\App\Privilege::isPermitted($queryParams['module']))) {

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

      class Vtiger_Link_Model extends vtlib\Link

      There are no issues that match your filters.

      Category
      Status