YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
F
3 days
Test Coverage
F
5%

getDashboardId accesses the super-global variable $_SESSION.
Open

    public static function getDashboardId(App\Request $request)
    {
        $dashboardId = false;
        if (!$request->isEmpty('dashboardId', true)) {
            $dashboardId = $request->getInteger('dashboardId');
Severity: Minor
Found in modules/Vtiger/models/Widget.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getDashboardId accesses the super-global variable $_SESSION.
Open

    public static function getDashboardId(App\Request $request)
    {
        $dashboardId = false;
        if (!$request->isEmpty('dashboardId', true)) {
            $dashboardId = $request->getInteger('dashboardId');
Severity: Minor
Found in modules/Vtiger/models/Widget.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

File Widget.php has 479 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 modules/Vtiger/models/Widget.php - About 7 hrs to fix

    Vtiger_Widget_Model has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Vtiger_Widget_Model extends \App\Base
    {
        /** @var array Default labels */
        const DEFAULT_LABELS = [
            'Activities' => 'LBL_ACTIVITIES',
    Severity: Minor
    Found in modules/Vtiger/models/Widget.php - About 4 hrs to fix

      Method getFieldInstanceByName has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getFieldInstanceByName($name)
          {
              $moduleName = 'Settings:WidgetsManagement';
              $field = $this->getEditFields()[$name] ?? null;
              if (!$field) {
      Severity: Major
      Found in modules/Vtiger/models/Widget.php - About 3 hrs to fix

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

        class Vtiger_Widget_Model extends \App\Base
        {
            /** @var array Default labels */
            const DEFAULT_LABELS = [
                'Activities' => 'LBL_ACTIVITIES',
        Severity: Minor
        Found in modules/Vtiger/models/Widget.php by phpmd

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

            public function getFieldInstanceByName($name)
            {
                $moduleName = 'Settings:WidgetsManagement';
                $field = $this->getEditFields()[$name] ?? null;
                if (!$field) {
        Severity: Minor
        Found in modules/Vtiger/models/Widget.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 setDataFromRequest has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function setDataFromRequest(App\Request $request)
            {
                foreach ($this->getEditFields() as $fieldName => $fieldInfo) {
                    if ($request->has($fieldName) && !isset($this->customFields[$fieldName])) {
                        $value = $request->getByType($fieldName, $fieldInfo['purifyType']);
        Severity: Minor
        Found in modules/Vtiger/models/Widget.php - About 1 hr to fix

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

              public function setDataFromRequest(App\Request $request)
              {
                  foreach ($this->getEditFields() as $fieldName => $fieldInfo) {
                      if ($request->has($fieldName) && !isset($this->customFields[$fieldName])) {
                          $value = $request->getByType($fieldName, $fieldInfo['purifyType']);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 processWidget has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function processWidget(Vtiger_Link_Model $widgetLink, Vtiger_Record_Model $recordModel)
              {
                  if (preg_match('/^block:\\/\\/(.*)/', $widgetLink->get('linkurl') ?? '', $matches)) {
                      [$widgetControllerClass, $widgetControllerClassFile] = explode(':', $matches[1]);
                      if (!class_exists($widgetControllerClass)) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php - About 45 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public static function updateWidgetPosition($position, $linkId, $widgetId, $userId)
              {
                  $currentPosition = [];
                  if (!$linkId && !$widgetId) {
                      return;
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php - About 25 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function setDataFromRequest(App\Request $request)
              {
                  foreach ($this->getEditFields() as $fieldName => $fieldInfo) {
                      if ($request->has($fieldName) && !isset($this->customFields[$fieldName])) {
                          $value = $request->getByType($fieldName, $fieldInfo['purifyType']);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 getFieldInstanceByName() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
          Open

              public function getFieldInstanceByName($name)
              {
                  $moduleName = 'Settings:WidgetsManagement';
                  $field = $this->getEditFields()[$name] ?? null;
                  if (!$field) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 class Vtiger_Widget_Model has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13.
          Open

          class Vtiger_Widget_Model extends \App\Base
          {
              /** @var array Default labels */
              const DEFAULT_LABELS = [
                  'Activities' => 'LBL_ACTIVITIES',
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '629', column '22').
          Open

                  $dataReader = (new \App\Db\Query())->select(['id', 'position', 'size'])->from('vtiger_module_dashboard_widgets')->where([
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '163', column '15').
          Open

                  $row = (new \App\Db\Query())->from('vtiger_module_dashboard_widgets')
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '238', column '20').
          Open

                  $lastSize = (new \App\Db\Query())->select(['size'])->from('vtiger_module_dashboard_widgets')->where($where)->scalar();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '334', column '22').
          Open

                  $templateId = (new App\Db\Query())->select(['templateid'])->from('vtiger_module_dashboard_widgets')->where(['id' => $id])->scalar();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '181', column '15').
          Open

                  $row = (new \App\Db\Query())->from('vtiger_module_dashboard_widgets')
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '210', column '29').
          Open

                  $lastSavedPosition = (new \App\Db\Query())->select(['position'])->from('vtiger_module_dashboard_widgets')->where($where)->scalar();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '388', column '33').
          Open

                  $widgetsManagementModel = new Settings_WidgetsManagement_Module_Model();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 '191', column '15').
          Open

                  $row = (new \App\Db\Query())->from('vtiger_module_dashboard')
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'App\Session' in method 'getHeight'.
          Open

                      if (isset($size[App\Session::get('fingerprint')], $size[App\Session::get('fingerprint')]['height'])) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getPosition'.
          Open

                      $positionData = Json::decode(App\Purifier::decodeHtml($positionData));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                              $params['picklistValues'][$key] = \App\Language::translate($label, $moduleName);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                              $params['picklistValues'][$key] = \App\Language::translate($label, $moduleName);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'setDataFromRequest'.
          Open

                                  $owners = $this->get('owners') ? Json::decode($this->get('owners')) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getPosition'.
          Open

                      $positionData = Json::decode(App\Purifier::decodeHtml($positionData));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'updateWidgetPosition'.
          Open

                  $currentPosition[App\Session::get('fingerprint')] = $position;
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'updateWidgetSize'.
          Open

                      ->update('vtiger_module_dashboard_widgets', ['size' => Json::encode($currentSize)], $where)
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getFieldInstanceByName'.
          Open

                          $value = $this->get('owners') ? Json::decode($this->get('owners')) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                              $params['picklistValues'][$key] = \App\Language::translate($label, $moduleName);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'getWidth'.
          Open

                          $defaultSize = (int) $size[App\Session::get('fingerprint')]['width'];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getHeight'.
          Open

                      $size = Json::decode(App\Purifier::decodeHtml($size));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Deprecated' in method 'processWidget'.
          Open

                          \vtlib\Deprecated::checkFileAccessForInclusion($widgetControllerClassFile);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      $links[] = Vtiger_Link_Model::getInstanceFromValues([
                          'linklabel' => 'LBL_EDIT',
                          'linkclass' => 'btn btn-success btn-xs js-edit-widget',
                          'linkicon' => 'yfi yfi-full-editing-view',
                          'linkdata' => ['url' => "index.php?parent=Settings&module=WidgetsManagement&view=EditWidget&linkId={$this->get('linkid')}&blockId={$this->get('blockid')}&widgetId={$this->getId()}"],
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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_Field_Model' in method 'getFieldInstanceByName'.
          Open

                  return \Vtiger_Field_Model::init($moduleName, $params, $name);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      'userid' => \App\User::getCurrentUserId(),
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'updateWidgetSize'.
          Open

                  $currentSize = \App\Json::isEmpty($lastSize) ? [] : Json::decode($lastSize);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'setDataFromRequest'.
          Open

                                  $this->set('owners', Json::encode($owners));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function isViewable(): bool
              {
                  $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                  $params = vtlib\Functions::getQueryParams($this->get('linkurl'));
                  $moduleName = $params['module'];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          IfStatementAssignment

          Since: 2.7.0

          Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($foo = 'bar') { // possible typo
                      // ...
                  }
                  if ($baz = 0) { // always false
                      // ...
                  }
              }
          }

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

          Avoid using static access to class '\vtlib\Link' in method 'getInstanceFromValues'.
          Open

          }
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'getPosition'.
          Open

                      if (!empty($positionData[App\Session::get('fingerprint')])) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getName'.
          Open

                      $linkUrl = App\Purifier::decodeHtml($this->getUrl());
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'setDataFromRequest'.
          Open

                                  $owners = $this->get('owners') ? Json::decode($this->get('owners')) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getDataValue'.
          Open

                  $values = $this->get('data') ? Json::decode($this->get('data')) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'isViewable'.
          Open

                  $params = vtlib\Functions::getQueryParams($this->get('linkurl'));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function getPosition(int $position, string $coordinate)
              {
                  if ($positionData = $this->get('position')) {
                      $positionData = Json::decode(App\Purifier::decodeHtml($positionData));
                      if (!empty($positionData[App\Session::get('fingerprint')])) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          IfStatementAssignment

          Since: 2.7.0

          Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($foo = 'bar') { // possible typo
                      // ...
                  }
                  if ($baz = 0) { // always false
                      // ...
                  }
              }
          }

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

          Avoid using static access to class '\App\Json' in method 'updateWidgetPosition'.
          Open

                      $currentPosition = JSON::decode($lastSavedPosition);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  return \App\Language::translate($this->getTitle(), $output['module'], null, true, 'Dashboard');
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'updateWidgetSize'.
          Open

                  $currentSize = \App\Json::isEmpty($lastSize) ? [] : Json::decode($lastSize);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'updateWidgetSize'.
          Open

                  $currentSize[App\Session::get('fingerprint')] = $size;
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'remove'.
          Open

                  $db = App\Db::getInstance();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'getWidth'.
          Open

                      if (isset($size[App\Session::get('fingerprint')], $size[App\Session::get('fingerprint')]['width'])) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getHeight'.
          Open

                      $size = Json::decode(App\Purifier::decodeHtml($size));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getUrl'.
          Open

                  $url = App\Purifier::decodeHtml($this->get('linkurl')) . '&linkid=' . $this->get('linkid');
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'updateWidgetPosition'.
          Open

                      ->update('vtiger_module_dashboard_widgets', ['position' => Json::encode($currentPosition)], $where)
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'save'.
          Open

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

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Users_Privileges_Model' in method 'isViewable'.
          Open

                  $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'getPosition'.
          Open

                          $position = (int) $positionData[App\Session::get('fingerprint')][$coordinate];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getFieldInstanceByName'.
          Open

                          $owners = $this->get('owners') ? Json::decode($this->get('owners')) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'clearDeviceConf'.
          Open

                      $position = $position ? Json::decode($position) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getWidth'.
          Open

                      $size = Json::decode(App\Purifier::decodeHtml($size));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'updateWidgetPosition'.
          Open

                  if ($lastSavedPosition && !JSON::isEmpty($lastSavedPosition)) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      $links[] = Vtiger_Link_Model::getInstanceFromValues([
                          'linklabel' => 'LBL_DELETE',
                          'linkclass' => 'btn-danger btn-xs js-delete-widget',
                          'linkicon' => 'fas fa-trash-alt',
                          'linkdata' => ['id' => $this->getId()],
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'setDataFromRequest'.
          Open

                                  $this->set('size', Json::encode($size));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 {
                      $params['blockid'] = $this->get('blockid');
                      $params['linkid'] = $this->get('linkid');
                      $result = $db->createCommand()->insert($tableName, $params)->execute();
                      $this->set('id', $db->getLastInsertID("{$tableName}_id_seq"));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'getWidth'.
          Open

                      if (isset($size[App\Session::get('fingerprint')], $size[App\Session::get('fingerprint')]['width'])) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'getHeight'.
          Open

                      if (isset($size[App\Session::get('fingerprint')], $size[App\Session::get('fingerprint')]['height'])) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'setDataFromRequest'.
          Open

                                  $size = $this->get('size') ? Json::decode($this->get('size')) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'clearDeviceConf'.
          Open

                      $createCommand->update('vtiger_module_dashboard_widgets', ['position' => Json::encode($position), 'size' => Json::encode($size)], ['id' => $id])->execute();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getWidth'.
          Open

                      $size = Json::decode(App\Purifier::decodeHtml($size));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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_WidgetsManagement_Module_Model' in method 'getDashboardId'.
          Open

                      $dashboardId = Settings_WidgetsManagement_Module_Model::getDefaultDashboard();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'clearDeviceConf'.
          Open

                      $size = $size ? Json::decode($size) : [];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'getHeight'.
          Open

                          $defaultSize = (int) $size[App\Session::get('fingerprint')]['height'];
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'getDeleteUrl'.
          Open

                  $url = 'index.php?module=' . App\Module::getModuleName($this->get('module')) . '&action=Widget&mode=remove&linkid=' . $this->get('linkid');
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'setDataFromRequest'.
          Open

                                  $this->set('owners', Json::encode($owners));
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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\Session' in method 'clearDeviceConf'.
          Open

                  $fingerPrint = App\Session::get('fingerprint');
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 'clearDeviceConf'.
          Open

                      $createCommand->update('vtiger_module_dashboard_widgets', ['position' => Json::encode($position), 'size' => Json::encode($size)], ['id' => $id])->execute();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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

          syntax error, unexpected ')'
          Open

                  ], )->createCommand()->query();
          Severity: Critical
          Found in modules/Vtiger/models/Widget.php by phan

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

              public function getHeight()
              {
                  $defaultSize = 4;
                  $size = $this->get('size');
                  if ($size) {
          Severity: Major
          Found in modules/Vtiger/models/Widget.php and 1 other location - About 2 hrs to fix
          modules/Vtiger/models/Widget.php on lines 36..49

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

          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

              public function getWidth()
              {
                  $defaultSize = 4;
                  $size = $this->get('size');
                  if ($size) {
          Severity: Major
          Found in modules/Vtiger/models/Widget.php and 1 other location - About 2 hrs to fix
          modules/Vtiger/models/Widget.php on lines 51..64

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

          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

                      case 'width':
                          $params['uitype'] = 16;
                          $params['typeofdata'] = 'V~M';
                          $params['maximumlength'] = '2';
                          $params['picklistValues'] = [3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12];
          Severity: Major
          Found in modules/Vtiger/models/Widget.php and 1 other location - About 1 hr to fix
          modules/Vtiger/models/Widget.php on lines 441..447

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

          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

                      case 'height':
                          $params['uitype'] = 16;
                          $params['typeofdata'] = 'V~M';
                          $params['maximumlength'] = '2';
                          $params['picklistValues'] = [3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12];
          Severity: Major
          Found in modules/Vtiger/models/Widget.php and 1 other location - About 1 hr to fix
          modules/Vtiger/models/Widget.php on lines 434..440

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

          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 excessively long variable names like $widgetControllerClass. Keep variable name length under 20.
          Open

                      [$widgetControllerClass, $widgetControllerClassFile] = explode(':', $matches[1]);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          LongVariable

          Since: 0.2

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

          Example

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

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

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

                  $sourceModulePermission = true;
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          LongVariable

          Since: 0.2

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

          Example

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

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

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

                  $widgetsManagementModel = new Settings_WidgetsManagement_Module_Model();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          LongVariable

          Since: 0.2

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

          Example

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

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

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

                          $widgetControllerInstance = new $widgetControllerClass();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          LongVariable

          Since: 0.2

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

          Example

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

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

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

                      [$widgetControllerClass, $widgetControllerClassFile] = explode(':', $matches[1]);
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          LongVariable

          Since: 0.2

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

          Example

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

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

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

          class Vtiger_Widget_Model extends \App\Base

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

              public static function removeWidgetFromList($id)
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 modules/Vtiger/models/Widget.php by phpmd

          ShortVariable

          Since: 0.2

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

          Example

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

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

          The class Vtiger_Widget_Model is not named in CamelCase.
          Open

          class Vtiger_Widget_Model extends \App\Base
          {
              /** @var array Default labels */
              const DEFAULT_LABELS = [
                  'Activities' => 'LBL_ACTIVITIES',
          Severity: Minor
          Found in modules/Vtiger/models/Widget.php by phpmd

          CamelCaseClassName

          Since: 0.2

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

          Example

          class class_name {
          }

          Source

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

                  $db = App\Db::getInstance();
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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

                  while (['id' => $id,'position' => $position,'size' => $size] = $dataReader->read()) {
          Severity: Minor
          Found in modules/Vtiger/models/Widget.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 DEFAULT body must start on the line following the statement
          Open

                      default: break;

          Terminating statement must be on a line by itself
          Open

                      default: break;

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

                  }

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

              /**

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

                  return $url . '&widgetid=' . $widgetid . '&active=' . $this->get('active');

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

               * Function to get the translated title.

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

               * Get ID.

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

                      }

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

               *

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

                  $queryParams = parse_url($this->get('linkurl'), PHP_URL_QUERY);

          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

                  $className = '';

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

              {

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

              {

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

               *

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

               */

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

                      if (!empty($positionData[$coordinate])) {

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

                          $position = (int) ($positionData[$coordinate]);

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

              }

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

                      $className = $valueMap['handler_class'];

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

              public function getWidth()

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

                  return $defaultSize;

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

                      $positionData = Json::decode(App\Purifier::decodeHtml($positionData));

          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 getName()

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

                      $widgetName = $matches[1];

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

                  } elseif (!empty($valueMap['linkid'])) {

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

              ];

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

                  $size = $this->get('size');

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

                  if ($size) {

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

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

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

               * @param string $coordinate

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

              {

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

                  'DetailView' => 'LBL_RECORD_DETAILS',

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

               */

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

                      } elseif (!empty($size['width'])) {

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

                  $defaultSize = 4;

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

              public function getPosition(int $position, string $coordinate)

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

                      preg_match('/name=[a-zA-Z]+/', $linkUrl, $matches);

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

               * @return \Vtiger_Widget_Model instance

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

                  if (!empty($valueMap['handler_class'])) {

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

              /** @var array Default labels */

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

                  'GeneralInfo' => 'LBL_RECORD_SUMMARY',

          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 int

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

                      if (!empty($positionData[App\Session::get('fingerprint')])) {

          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 url of the widget.

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

                      $title = $this->get('linklabel');

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

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

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

                  return $defaultSize;

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

               * @param int    $defaultPosition

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

                  $widgetid = $this->has('widgetid') ? $this->get('widgetid') : $this->get('id');

          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

                          $defaultSize = (int) $size['width'];

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

              public function getHeight()

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

                          $defaultSize = (int) $size[App\Session::get('fingerprint')]['height'];

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

                  if ($positionData = $this->get('position')) {

          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 Title of the widget.

          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 \App\Language::translate($this->getTitle(), $output['module'], null, true, 'Dashboard');

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

                  $widgetName = $this->get('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 static function getInstanceFromValues($valueMap)

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

                  'Activities' => 'LBL_ACTIVITIES',

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

                  return (int) $this->get('id');

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

                  $size = $this->get('size');

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

                  return $position;

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

                  $url = App\Purifier::decodeHtml($this->get('linkurl')) . '&linkid=' . $this->get('linkid');

          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

                  parse_str($queryParams, $output);

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

              {

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

                      $linkUrl = App\Purifier::decodeHtml($this->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

                      if (isset($size[App\Session::get('fingerprint')], $size[App\Session::get('fingerprint')]['width'])) {

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

                          $defaultSize = (int) $size[App\Session::get('fingerprint')]['width'];

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

                      } elseif (!empty($size['height'])) {

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

               * @param int    $position

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

               * @throws \App\Exceptions\AppException

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

                  $title = $this->get('title');

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

                      $this->set('name', $widgetName);

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

                      $size = Json::decode(App\Purifier::decodeHtml($size));

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

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

              {

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

               *

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

               * @return int

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

              public function getId(): int

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

                  $defaultSize = 4;

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

                      if (isset($size[App\Session::get('fingerprint')], $size[App\Session::get('fingerprint')]['height'])) {

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

                          $position = (int) $positionData[App\Session::get('fingerprint')][$coordinate];

          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

              /**

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

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

              public function getTranslatedTitle(): 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

                  }

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

              const DEFAULT_LABELS = [

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

                      $size = Json::decode(App\Purifier::decodeHtml($size));

          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

                          $defaultSize = (int) ($size['height']);

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

               * Function to get the position of the widget.

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

              public function getTitle()

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

                  if (empty($widgetName)) {

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

                      $matches = explode('=', $matches[0]);

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

              }

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

              }

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

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

                  $currentSize = \App\Json::isEmpty($lastSize) ? [] : Json::decode($lastSize);

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

               * Function to show a widget from the Users Dashboard.

          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 remove the widget from the Users Dashboard.

          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 ('delete' == $action) {

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

                      $db->createCommand()->update('vtiger_module_dashboard_widgets', ['active' => 0], ['id' => $this->get('id')])

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

                  if ($widgetid) {

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

              /**

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

               * Process the UI Widget requested.

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

               * @param Vtiger_Record_Model $recordModel

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

               */

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

                      [$widgetControllerClass, $widgetControllerClassFile] = explode(':', $matches[1]);

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

               */

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

                  $row = (new \App\Db\Query())->from('vtiger_module_dashboard_widgets')

          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

                  $db = App\Db::getInstance();

          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

                      ->one();

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

                      $where = ['userid' => $userId, 'id' => $widgetId];

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

               */

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

                  } elseif ($widgetId) {

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

                      ->update('vtiger_module_dashboard_widgets', ['size' => Json::encode($currentSize)], $where)

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

                          ->execute();

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

              public function remove($action = 'hide')

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

                      $db->createCommand()->delete('vtiger_module_dashboard_widgets', ['id' => $this->get('id'), 'blockid' => $this->get('blockid')])

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

          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 updateWidgetPosition($position, $linkId, $widgetId, $userId)

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

              public static function updateWidgetSize($size, $linkId, $widgetId, $userId)

          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->set('active', 0);

          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

                      ->where(['linktype' => 'DASHBOARDWIDGET', 'vtiger_links.linkid' => $linkId, 'userid' => $userId])

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

              public static function getInstanceWithTemplateId(int $widgetId)

          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 (preg_match('/^block:\\/\\/(.*)/', $widgetLink->get('linkurl') ?? '', $matches)) {

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

                      $className = \vtlib\Link::getLinkData($valueMap['linkid'])['handler_class'] ?? null;

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

                  return $row ? static::getInstanceFromValues($row) : new static();

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

              }

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

                  $currentPosition = [];

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

                  if ($linkId) {

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

                  if (!$linkId && !$widgetId) {

          Line exceeds 120 characters; contains 126 characters
          Open

                  $lastSize = (new \App\Db\Query())->select(['size'])->from('vtiger_module_dashboard_widgets')->where($where)->scalar();

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

                  $currentSize[App\Session::get('fingerprint')] = $size;

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

                  if (0 == $this->get('active')) {

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

                  $widgetid = $this->has('widgetid') ? $this->get('widgetid') : $this->get('id');

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

               * Get widget instance by id.

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

                  return $row ? static::getInstanceFromValues($row) : new static();

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

                  if (!$linkId && !$widgetId) {

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

                  if ($linkId) {

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

                      ->execute();

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

                      App\Db::getInstance()->createCommand()

          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 isDefault(): bool

          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

                      ->innerJoin('vtiger_links', 'vtiger_links.linkid = vtiger_module_dashboard_widgets.linkid')

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

               * @param int $userId

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

                      ->update('vtiger_module_dashboard_widgets', ['position' => Json::encode($currentPosition)], $where)

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

               * Update widget size.

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

                          ->execute();

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

              public function getDeleteUrl()

          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

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

              }

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

                      $where = ['userid' => $userId, 'linkid' => $linkId];

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

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

              {

          Line exceeds 120 characters; contains 139 characters
          Open

                      $db->createCommand()->delete('vtiger_module_dashboard_widgets', ['id' => $this->get('id'), 'blockid' => $this->get('blockid')])

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

              }

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

                  $instance = $className ? new $className() : new static();

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

              public static function getInstance($linkId, $userId)

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

                  return $row ? static::getInstanceFromValues($row) : new static();

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

                      ->innerJoin('vtiger_links', 'vtiger_links.linkid = vtiger_module_dashboard_widgets.linkid')

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

                  $lastSavedPosition = (new \App\Db\Query())->select(['position'])->from('vtiger_module_dashboard_widgets')->where($where)->scalar();

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

                  }

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

              /**

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

               *

          Line exceeds 120 characters; contains 147 characters
          Open

                  $url = 'index.php?module=' . App\Module::getModuleName($this->get('module')) . '&action=Widget&mode=remove&linkid=' . $this->get('linkid');

          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

                      ->innerJoin('vtiger_links', 'vtiger_links.linkid = vtiger_module_dashboard.linkid')

          Line exceeds 120 characters; contains 139 characters
          Open

                  $lastSavedPosition = (new \App\Db\Query())->select(['position'])->from('vtiger_module_dashboard_widgets')->where($where)->scalar();

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

               * @param int    $linkId

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

                      return;

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

                  \App\Db::getInstance()->createCommand()

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

              public function show()

          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 processWidget(Vtiger_Link_Model $widgetLink, Vtiger_Record_Model $recordModel)

          Line exceeds 120 characters; contains 126 characters
          Open

                      ->where(['linktype' => 'DASHBOARDWIDGET', 'vtiger_module_dashboard_widgets.id' => $widgetId, 'userid' => $userId])

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

               * @param string $size

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

                  $lastSize = (new \App\Db\Query())->select(['size'])->from('vtiger_module_dashboard_widgets')->where($where)->scalar();

          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->set('id', $this->get('widgetid'));

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

               * Function returns URL that will remove a widget for a User.

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

               *

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

               * @param Vtiger_Link_Model   $widgetLink

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

               *

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

                      ->where(['linktype' => 'DASHBOARDWIDGET', 'vtiger_module_dashboard_widgets.id' => $widgetId, 'userid' => $userId])

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

                  $row = (new \App\Db\Query())->from('vtiger_module_dashboard')

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

                      ->where(['linktype' => 'DASHBOARDWIDGET', 'vtiger_module_dashboard.id' => $widgetId])

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

                      $currentPosition = JSON::decode($lastSavedPosition);

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

                  \App\Db::getInstance()->createCommand()

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

               * @param int    $widgetId

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

              {

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

                      $where = ['userid' => $userId, 'id' => $widgetId];

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

                  $currentPosition[App\Session::get('fingerprint')] = $position;

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

                  $url = 'index.php?module=' . App\Module::getModuleName($this->get('module')) . '&action=Widget&mode=remove&linkid=' . $this->get('linkid');

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

               * Function to check the Widget is Default widget or not.

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

                  return 1 == $this->get('isdefault');

          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 \self

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

              public static function getInstanceWithWidgetId($widgetId, $userId)

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

              {

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

                      return;

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

                      $where = ['userid' => $userId, 'linkid' => $linkId];

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

                  if ($lastSavedPosition && !JSON::isEmpty($lastSavedPosition)) {

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

              }

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

                  } elseif ('hide' == $action) {

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

                  $instance->setData($valueMap);

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

                  $row = (new \App\Db\Query())->from('vtiger_module_dashboard_widgets')

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

                      ->one();

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

               *

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

                      ->one();

          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

                  } elseif ($widgetId) {

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

                      ->execute();

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

              }

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

               *

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

                  }

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

                          ->update('vtiger_module_dashboard_widgets', ['active' => 1], ['id' => $this->get('widgetid')])

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

                          ->execute();

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

                      $url .= '&widgetid=' . $widgetid;

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

                  }

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

                          \vtlib\Deprecated::checkFileAccessForInclusion($widgetControllerClassFile);

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

                  }

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

              /**

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

               * Remove widget from list in dashboard. Removing is possible only for widgets from filters.

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

              public static function removeWidgetFromList($id)

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

                      ]);

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

                          $params['maximumlength'] = '100';

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

                          $params['uitype'] = 16;

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

                          $params['uitype'] = 7;

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

                  $templateId = (new App\Db\Query())->select(['templateid'])->from('vtiger_module_dashboard_widgets')->where(['id' => $id])->scalar();

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

               * Function to get the Quick Links in settings view.

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

               * @return array List of Vtiger_Link_Model instances

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

                          'linklabel' => 'LBL_DELETE',

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

                          $params['uitype'] = 1;

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

                          $params['fieldvalue'] = $this->get('limit') ?: 10;

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

                          $value = $this->get('owners') ? Json::decode($this->get('owners')) : [];

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

                      if (!class_exists($widgetControllerClass)) {

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

                      }

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

               *

          Line exceeds 120 characters; contains 198 characters
          Open

                          'linkdata' => ['url' => "index.php?parent=Settings&module=WidgetsManagement&view=EditWidget&linkId={$this->get('linkid')}&blockId={$this->get('blockid')}&widgetId={$this->getId()}"],

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

                      $links[] = Vtiger_Link_Model::getInstanceFromValues([

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

                  }

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

                      $fields['limit'] = ['label' => 'LBL_NUMBER_OF_RECORDS_DISPLAYED', 'purifyType' => \App\Purifier::INTEGER];

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

                  if (\in_array($this->get('linklabel'), $widgetsManagementModel->getWidgetsWithDate())) {

          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_Field_Model

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

              public function getFieldInstanceByName($name)

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

                          $params['typeofdata'] = 'C~O';

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

                      case 'limit':

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

                          $params['typeofdata'] = 'I~M';

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

                          $widgetControllerInstance = new $widgetControllerClass();

          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 (\App\User::getCurrentUserModel()->isAdmin()) {

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

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

                  $params = [

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

                      case 'isdefault':

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

                          break;

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

                          include_once $widgetControllerClassFile;

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

                          if ($widgetInstance) {

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

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

                  if (\in_array($this->get('linklabel'), $widgetsManagementModel->getWidgetsWithFilterUsers())) {

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

                      $fields['default_owner'] = ['label' => 'LBL_DEFAULT_FILTER', 'purifyType' => \App\Purifier::STANDARD];

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

                  if (!$field) {

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

                      return null;

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

                      case 'cache':

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

                          $params['fieldvalue'] = $this->getHeight();

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

                          break;

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

                          $params['maximumlength'] = '100';

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

                          'linkdata' => ['url' => "index.php?parent=Settings&module=WidgetsManagement&view=EditWidget&linkId={$this->get('linkid')}&blockId={$this->get('blockid')}&widgetId={$this->getId()}"],

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

              /** @var array Fields for edit */

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

              public $editFields = [

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

                  'isdefault' => ['label' => 'LBL_MANDATORY_WIDGET', 'purifyType' => \App\Purifier::BOOL],

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

               * @return array

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

              {

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

               *

          Line exceeds 120 characters; contains 131 characters
          Open

                          $params['picklistValues'] = [3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12];

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

                          $params['typeofdata'] = 'V~M';

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

                          $params['fieldvalue'] = $value['default'] ?? 'mine';

          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

                          $params['typeofdata'] = empty($field['required']) ? 'V~O' : 'V~M';

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

                      case 'width':

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

                          $params['typeofdata'] = 'V~M';

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

                          $params['uitype'] = 16;

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

                          'linkicon' => 'yfi yfi-full-editing-view',

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

                      ]);

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

                      $fields['owners_all'] = ['label' => 'LBL_FILTERS_AVAILABLE', 'purifyType' => \App\Purifier::STANDARD];

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

                  $moduleName = 'Settings:WidgetsManagement';

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

                      'label' => $field['label'],

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

                          $params['uitype'] = 56;

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

                          $params['maximumlength'] = '2';

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

                          $params['maximumlength'] = '2';

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

                  $dbCommand->delete('vtiger_module_dashboard_widgets', ['id' => $id])->execute();

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

              }

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

               *

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

               */

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

                  'cache' => ['label' => 'LBL_CACHE_WIDGET', 'purifyType' => \App\Purifier::BOOL],

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

                  'height' => ['label' => 'LBL_HEIGHT', 'purifyType' => \App\Purifier::INTEGER],

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

               *

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

                      'tooltip' => $field['tooltip'] ?? '',

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

                          $params['fieldvalue'] = $this->getWidth();

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

                          'linkclass' => 'btn btn-success btn-xs js-edit-widget',

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

              ];

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

              /**

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

                  $widgetsManagementModel = new Settings_WidgetsManagement_Module_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

                  }

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

               * Gets field instance by name.

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

               * @param string $name

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

                          $params['fieldvalue'] = $this->get($name) ?: '';

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

                          break;

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

                          $params['picklistValues'] = [3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12];

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

                      case 'owners_all':

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

                      if (class_exists($widgetControllerClass)) {

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

              public function getEditFields(): array

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

                  $field = $this->getEditFields()[$name] ?? null;

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

                  ];

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

                          $params['fieldvalue'] = (int) $this->get($name);

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

                          break;

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

                      case 'title':

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

                          $params['maximumlength'] = '127';

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

               * @param int $id

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

                  }

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

                  $links = [];

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

                          'linkclass' => 'btn-danger btn-xs js-delete-widget',

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

                          'linkicon' => 'fas fa-trash-alt',

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

              }

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

              /** @var array Custom fields for edit */

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

                  'width' => ['label' => 'LBL_WIDTH', 'purifyType' => \App\Purifier::INTEGER],

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

                  switch ($name) {

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

                          $params['uitype'] = 16;

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

                      case 'default_owner':

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

                          $picklistValue = ['mine' => 'LBL_MINE', 'all' => 'LBL_ALL'];

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

                          'linklabel' => 'LBL_EDIT',

          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

                  $fields = [];

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

                      $fields['default_date'] = ['label' => 'LBL_DEFAULT_DATE', 'purifyType' => \App\Purifier::STANDARD];

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

                  return $this->editFields + $fields + $this->customFields;

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

                          foreach ($picklistValue as $key => $label) {

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

                          break;

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

                          $widgetInstance = $widgetControllerInstance->getWidget($widgetLink);

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

              }

          Line exceeds 120 characters; contains 140 characters
          Open

                  $templateId = (new App\Db\Query())->select(['templateid'])->from('vtiger_module_dashboard_widgets')->where(['id' => $id])->scalar();

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

                  if ($templateId) {

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

               * Gets fields for edit view.

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

              /**

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

                          $params['picklistValues'] = [3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12];

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

                              return $widgetInstance->process($recordModel);

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

               */

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

                  $dbCommand = \App\Db::getInstance()->createCommand();

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

                      $dbCommand->delete('vtiger_module_dashboard', ['id' => $templateId])->execute();

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

              public function getSettingsLinks()

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

                      $links[] = Vtiger_Link_Model::getInstanceFromValues([

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

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

                      case 'height':

          Line exceeds 120 characters; contains 131 characters
          Open

                          $params['picklistValues'] = [3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12];

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

                              $params['picklistValues'][$key] = \App\Language::translate($label, $moduleName);

          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 (\App\User::getCurrentUserModel()->isAdmin()) {

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

                  if (\in_array($this->get('linklabel'), $widgetsManagementModel->getWidgetsWithLimit())) {

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

                          break;

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

                          $params['typeofdata'] = 'V~M';

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

                          }

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

                          $params['typeofdata'] = 'V~M';

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

                          foreach ($picklistValue as $key => $label) {

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

                          $picklistValue = [

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

                  foreach ($this->getEditFields() as $fieldName => $fieldInfo) {

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

                                  break;

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

              /**

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

               *

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

                      $result = $db->createCommand()->insert($tableName, $params)->execute();

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

               */

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

                  $values = $this->get('data') ? Json::decode($this->get('data')) : [];

          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

                          $value = $fieldModel->getDBValue($value);

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

                                  $this->set('size', Json::encode($size));

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

                  $params = array_intersect_key($this->getData(), array_flip(['title', 'data', 'size', 'limit', 'isdefault', 'owners', 'cache', 'date', 'filterid']));

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

                          $db->createCommand()->delete('vtiger_module_dashboard_widgets', ['templateid' => $this->getId()])->execute();

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

              public function getDataValue(string $name)

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

                              'users' => 'LBL_USERS',

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

                      default: break;

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

              public function setDataFromRequest(App\Request $request)

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

                                  $size[$fieldName] = $value;

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

                                  $owners = $this->get('owners') ? Json::decode($this->get('owners')) : [];

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

                      $this->set('blockid', $request->getInteger('blockId'));

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

               *

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

                          $params['uitype'] = 33;

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

                          foreach ($picklistValue as $key => $label) {

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

                  }

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

                      if ($request->has($fieldName) && !isset($this->customFields[$fieldName])) {

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

               */

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

                      $this->set('id', $db->getLastInsertID("{$tableName}_id_seq"));

          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

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

                  $dashboardId = false;

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

                              'year' => 'PLL_CURRENT_YEAR',

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

                              case 'default_date':

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

                                  $this->set($fieldName, $value);

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

                      ->delete('vtiger_module_dashboard', ['vtiger_module_dashboard.id' => $this->getId()])

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

               * @param string $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

                      $dashboardId = $_SESSION['DashBoard'][$request->getModule()]['LastDashBoardId'];

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

                              $params['picklistValues'][$key] = \App\Language::translate($label, $moduleName);

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

                          break;

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

                          switch ($fieldName) {

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

                                  $size = $this->get('size') ? Json::decode($this->get('size')) : [];

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

                                  $owners = $this->get('owners') ? Json::decode($this->get('owners')) : [];

          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 int

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

                  return $dashboardId;

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

                          $params['typeofdata'] = 'V~M';

          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

                  } else {

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

                      $params['linkid'] = $this->get('linkid');

          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

                  $request->set('dashboardId', $dashboardId);

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

                              'all' => 'LBL_ALL',

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

               * Gets value from data column.

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

                      $dashboardId = $request->getInteger('dashboardId');

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

                          $params['maximumlength'] = '100';

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

                          $picklistValue = [

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

                          $value = $owners['available'] ?? ['mine'];

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

                  return \Vtiger_Field_Model::init($moduleName, $params, $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

                              case 'owners_all':

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

                                  $value = $value ? explode(' |##| ', $value) : [];

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

               * Function to save.

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

                  if ($this->getId()) {

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

                      if ($result) {

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

                  return (bool) $result;

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

               * Remove widget template.

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

              public function delete(): bool

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

              {

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

                      ->execute();

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

                  if (!$request->isEmpty('dashboardId', true)) {

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

                              $params['picklistValues'][$key] = \App\Language::translate($label, $moduleName);

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

                          $params['fieldvalue'] = $this->get('date');

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

                                  $this->set('owners', Json::encode($owners));

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

                                  break;

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

                              default:

          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

                      $result = $db->createCommand()->update($tableName, $params, ['id' => $this->getId()])->execute();

          Line exceeds 120 characters; contains 125 characters
          Open

                          $db->createCommand()->delete('vtiger_module_dashboard_widgets', ['templateid' => $this->getId()])->execute();

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

              /**

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

               * @param \App\Request $request

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

              }

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

                              'day' => 'PLL_CURRENT_DAY',

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

                              'week' => 'PLL_CURRENT_WEEK',

          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

                                  break;

          Line exceeds 120 characters; contains 156 characters
          Open

                  $params = array_intersect_key($this->getData(), array_flip(['title', 'data', 'size', 'limit', 'isdefault', 'owners', 'cache', 'date', 'filterid']));

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

                      }

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

               *

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

               * @return mixed

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

               * Sets data from request.

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

                  return $values[$name] ?? null;

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

                          $fieldModel->validate($value, true);

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

                          break;

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

                              case 'height':

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

                                  $owners['default'] = $value;

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

               * @param App\Request $request

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

                                  $this->set('date', $value);

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

                          $value = $request->getByType($fieldName, $fieldInfo['purifyType']);

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

                                  $this->set('owners', Json::encode($owners));

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

                  if (!$this->getId() && !$request->isEmpty('blockId')) {

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

                  $tableName = 'vtiger_module_dashboard';

          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) \App\Db::getInstance()->createCommand()

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

              {

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

               * Get dashboard id.

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

                  } elseif (isset($_SESSION['DashBoard'][$request->getModule()]['LastDashBoardId'])) {

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

                      $dashboardId = Settings_WidgetsManagement_Module_Model::getDefaultDashboard();

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

                              'groups' => 'LBL_GROUPS',

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

                      case 'default_date':

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

              }

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

                                  break;

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

                      }

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

                          }

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

                          $owners = $this->get('owners') ? Json::decode($this->get('owners')) : [];

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

                          $params['uitype'] = 16;

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

                              'month' => 'PLL_CURRENT_MONTH',

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

              /**

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

                                  break;

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

                  }

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

              public function save(): bool

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

                      $params['blockid'] = $this->get('blockid');

          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 getDashboardId(App\Request $request)

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

                  if (!$dashboardId) {

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

                              'mine' => 'LBL_MINE',

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

                          $params['fieldvalue'] = implode(' |##| ', $value);

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

                          $fieldModel = $this->getFieldInstanceByName($fieldName)->getUITypeModel();

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

                              case 'width':

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

                              case 'default_owner':

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

                                  $owners['available'] = $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

                  $db = App\Db::getInstance();

          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 isDeletable(): bool

          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 widget is viewable.

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

                      ['like', 'position', "\"$fingerPrint\""],

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

              public static function clearDeviceConf(int $dashboardId): void

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

                  while (['id' => $id,'position' => $position,'size' => $size] = $dataReader->read()) {

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

              /**

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

               */

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

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

               * Check if the widget is removable.

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

                  return !$this->get('isdefault');

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

              {

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

                      $size = $size ? Json::decode($size) : [];

          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

                      'dashboardid' => $dashboardId,

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

                  $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

                  $sourceModulePermission = true;

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

                  return 'ModTracker' === $moduleName || ($sourceModulePermission && $userPrivModel->hasModulePermission($moduleName));

          Line exceeds 120 characters; contains 129 characters
          Open

                  $dataReader = (new \App\Db\Query())->select(['id', 'position', 'size'])->from('vtiger_module_dashboard_widgets')->where([

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

                      $position = $position ? Json::decode($position) : [];

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

                      if (isset($size[$fingerPrint])) {

          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 (($name = $params['name'] ?? '') && \in_array($name, ['CalendarActivities', 'OverdueActivities'])) {

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

              }

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

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

          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

                      'userid' => \App\User::getCurrentUserId(),

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

                      ['like', 'size', "\"$fingerPrint\""],

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

                      if (isset($position[$fingerPrint])) {

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

                  $moduleName = $params['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

              public function isCreatable(): bool

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

               * @return void

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

                  ])->andWhere([

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

                          unset($size[$fingerPrint]);

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

               * @return bool

          Line exceeds 120 characters; contains 125 characters
          Open

                  return 'ModTracker' === $moduleName || ($sourceModulePermission && $userPrivModel->hasModulePermission($moduleName));

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

               * Clear configuration of widgets for this device.

          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 isViewable(): bool

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

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

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

                      $sourceModulePermission = $userPrivModel->hasModulePermission('Calendar');

          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

                  $fingerPrint = App\Session::get('fingerprint');

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

                  $dataReader = (new \App\Db\Query())->select(['id', 'position', 'size'])->from('vtiger_module_dashboard_widgets')->where([

          Line exceeds 120 characters; contains 168 characters
          Open

                      $createCommand->update('vtiger_module_dashboard_widgets', ['position' => Json::encode($position), 'size' => Json::encode($size)], ['id' => $id])->execute();

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

                      'or',

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

               *

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

                          unset($position[$fingerPrint]);

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

                      $createCommand->update('vtiger_module_dashboard_widgets', ['position' => Json::encode($position), 'size' => Json::encode($size)], ['id' => $id])->execute();

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

                  }

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

              {

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

              }

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

               */

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

                  ], )->createCommand()->query();

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

               * Check if the widget is creatable.

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

               */

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

          class Vtiger_Widget_Model extends \App\Base

          Closing brace must be on a line by itself
          Open

                      default: break;

          Expected 0 spaces before closing bracket; 1 found
          Open

                  ])->andWhere([

          There are no issues that match your filters.

          Category
          Status