YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/views/Import.php

Summary

Maintainability
D
1 day
Test Coverage
F
0%

The class Vtiger_Import_View has 14 public methods. Consider refactoring Vtiger_Import_View to keep number of public methods under 10.
Open

class Vtiger_Import_View extends Vtiger_Index_View
{
    use \App\Controller\ExposeMethod;

    public function __construct()
Severity: Minor
Found in modules/Vtiger/views/Import.php by phpmd

TooManyPublicMethods

Since: 0.1

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

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

Example

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

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

class Vtiger_Import_View extends Vtiger_Index_View
{
    use \App\Controller\ExposeMethod;

    public function __construct()
Severity: Minor
Found in modules/Vtiger/views/Import.php by phpmd

Method uploadAndParse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function uploadAndParse(App\Request $request)
    {
        if (Import_Utils_Helper::validateFileUpload($request)) {
            $user = App\User::getCurrentUserModel();
            $fileReader = Import_Module_Model::getFileReader($request, $user);
Severity: Major
Found in modules/Vtiger/views/Import.php - About 2 hrs to fix

    Function uploadAndParse has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        public function uploadAndParse(App\Request $request)
        {
            if (Import_Utils_Helper::validateFileUpload($request)) {
                $user = App\User::getCurrentUserModel();
                $fileReader = Import_Module_Model::getFileReader($request, $user);
    Severity: Minor
    Found in modules/Vtiger/views/Import.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    File Import.php has 253 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/views/Import.php - About 2 hrs to fix

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

          public function checkImportStatus(App\Request $request)
          {
              $moduleName = $request->getModule();
              $user = \App\User::getCurrentUserModel();
              // Check if import on the module is locked
      Severity: Minor
      Found in modules/Vtiger/views/Import.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

      Consider simplifying this complex logical expression.
      Open

              if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Import') || !$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'CreateView') || (
                  $relationId && (
                      !($relationModel = Vtiger_Relation_Model::getInstanceById($relationId))
                      || !$relationModel->isAddActionSupported()
                      || $relationModel->getRelationModuleName() !== $request->getModule()
      Severity: Critical
      Found in modules/Vtiger/views/Import.php - About 1 hr to fix

        Method checkImportStatus has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function checkImportStatus(App\Request $request)
            {
                $moduleName = $request->getModule();
                $user = \App\User::getCurrentUserModel();
                // Check if import on the module is locked
        Severity: Minor
        Found in modules/Vtiger/views/Import.php - About 1 hr to fix

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

              public function process(App\Request $request)
              {
                  if ($request->isEmpty('mode')) {
                      if (!$this->checkImportStatus($request)) {
                          $this->importBasicStep($request);
          Severity: Minor
          Found in modules/Vtiger/views/Import.php - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function undoRecords(string $moduleName)
              {
                  $dbTableName = Import_Module_Model::getDbTableName(App\User::getCurrentUserModel());
                  $dataReader = (new \App\Db\Query())->select(['recordid'])
                      ->from($dbTableName)
          Severity: Minor
          Found in modules/Vtiger/views/Import.php - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function uploadAndParse(App\Request $request)
              {
                  if (Import_Utils_Helper::validateFileUpload($request)) {
                      $user = App\User::getCurrentUserModel();
                      $fileReader = Import_Module_Model::getFileReader($request, $user);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 checkPermission() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
          Open

              public function checkPermission(App\Request $request)
              {
                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                  $relationId = $request->getInteger('relationId');
                  if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Import') || !$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'CreateView') || (
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 checkImportStatus() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
          Open

              public function checkImportStatus(App\Request $request)
              {
                  $moduleName = $request->getModule();
                  $user = \App\User::getCurrentUserModel();
                  // Check if import on the module is locked
          Severity: Minor
          Found in modules/Vtiger/views/Import.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

          Reduce the number of returns of this function 4, down to the maximum allowed 3.
          Open

              public function checkImportStatus(App\Request $request)
          Severity: Major
          Found in modules/Vtiger/views/Import.php by sonar-php

          Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

          Noncompliant Code Example

          With the default threshold of 3:

          function myFunction(){ // Noncompliant as there are 4 return statements
            if (condition1) {
              return true;
            } else {
              if (condition2) {
                return false;
              } else {
                return true;
              }
            }
            return false;
          }
          

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

              public function uploadAndParse(App\Request $request)
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

          See

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

              public function checkImportStatus(App\Request $request)
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

          See

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

          class Vtiger_Import_View extends Vtiger_Index_View
          {
              use \App\Controller\ExposeMethod;
          
              public function __construct()
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '227', column '22').
          Open

                  $dataReader = (new \App\Db\Query())->select(['recordid'])
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '250', column '21').
          Open

                  $importList = new Import_List_View();
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '51', column '14').
          Open

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '271', column '32').
          Open

                      $importDataController = new Import_Data_Action($importInfo, \App\User::getUserModel($importInfo['user_id']));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '292', column '29').
          Open

                          $importController = new Import_Main_View($request, $user);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '288', column '15').
          Open

                          throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '207', column '17').
          Open

                  $viewer = new Vtiger_Viewer();
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '214', column '14').
          Open

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'importBasicStep'.
          Open

                  $viewer->assign('SUPPORTED_FILE_TYPES_TEXT', Import_Module_Model::getSupportedFileExtensionsDescription($moduleName));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Main_View' in method 'import'.
          Open

                  Import_Main_View::import($request, App\User::getCurrentUserModel());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'importBasicStep'.
          Open

                  $viewer->assign('SUPPORTED_FILE_TYPES', Import_Module_Model::getSupportedFileExtensions($moduleName));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'uploadAndParse'.
          Open

                              $mandatoryFields[$fieldName] = \App\Language::translate($fieldModel->getFieldLabel(), $moduleName);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'uploadAndParse'.
          Open

                      $fileReader = Import_Module_Model::getFileReader($request, $user);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Utils_Helper' in method 'uploadAndParse'.
          Open

                      $viewer->assign('GROUPS_LIST', Import_Utils_Helper::getAssignedToGroupList($moduleName));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '47', column '10').
          Open

              public function checkPermission(App\Request $request)
              {
                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                  $relationId = $request->getInteger('relationId');
                  if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Import') || !$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'CreateView') || (
          Severity: Minor
          Found in modules/Vtiger/views/Import.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

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

                      } else {
                          $viewer->assign('MERGE_FIELDS', \App\Json::encode($request->getArray('merge_fields', 'Alnum')));
                      }
          Severity: Minor
          Found in modules/Vtiger/views/Import.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\Json' in method 'uploadAndParse'.
          Open

                          $viewer->assign('MERGE_FIELDS', \App\Json::encode($request->getArray('merge_fields', 'Alnum')));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'cancelImport'.
          Open

                  $user = App\User::getCurrentUserModel();
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'importBasicStep'.
          Open

                  $viewer->assign('SUPPORTED_FILE_ENCODING', Import_Module_Model::getSupportedFileEncoding());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'importBasicStep'.
          Open

                  $viewer->assign('SUPPORTED_DELIMITERS', Import_Module_Model::getSupportedDelimiters());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Map_Model' in method 'uploadAndParse'.
          Open

                      $viewer->assign('SAVED_MAPS', Import_Map_Model::getAllByModule($moduleName));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'undoImport'.
          Open

                  $user = App\User::getCurrentUserModel();
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $mode = $request->getMode();
                      // Added to check the status of import
                      if ('continueImport' === $mode || 'uploadAndParse' === $mode || 'importBasicStep' === $mode) {
                          $this->checkImportStatus($request);
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phpmd

          ElseExpression

          Since: 1.4.0

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

          Example

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

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

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

                      $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                          $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'clearCorruptedData'.
          Open

                  Import_Module_Model::clearUserImportInfo(\App\User::getCurrentUserModel());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Utils_Helper' in method 'checkImportStatus'.
          Open

                          Import_Utils_Helper::showImportLockedError($lockInfo);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'checkImportStatus'.
          Open

                  if (Import_Module_Model::isUserImportBlocked($user)) {
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'clearCorruptedData'.
          Open

                  Import_Module_Model::clearUserImportInfo(\App\User::getCurrentUserModel());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Queue_Action' in method 'checkImportStatus'.
          Open

                      $importInfo = Import_Queue_Action::getUserCurrentImportInfo($user);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'importBasicStep'.
          Open

                  $viewer->assign('AUTO_MERGE_TYPES', Import_Module_Model::getAutoMergeTypes());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Utils_Helper' in method 'uploadAndParse'.
          Open

                  if (Import_Utils_Helper::validateFileUpload($request)) {
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'undoRecords'.
          Open

                  $dbTableName = Import_Module_Model::getDbTableName(App\User::getCurrentUserModel());
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class 'Vtiger_Relation_Model' in method 'checkPermission'.
          Open

                          !($relationModel = Vtiger_Relation_Model::getInstanceById($relationId))
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Queue_Action' in method 'cancelImport'.
          Open

                  $importInfo = Import_Queue_Action::getImportInfoById($importId);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'uploadAndParse'.
          Open

                      $viewer->assign('ENCODED_MANDATORY_FIELDS', \App\Json::encode($mandatoryFields));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Main_View' in method 'deleteMap'.
          Open

                  Import_Main_View::deleteMap($request);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 '44', column '7').
          Open

              public function checkPermission(App\Request $request)
              {
                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                  $relationId = $request->getInteger('relationId');
                  if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Import') || !$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'CreateView') || (
          Severity: Minor
          Found in modules/Vtiger/views/Import.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\Config' in method 'importBasicStep'.
          Open

                  $viewer->assign('IMPORT_UPLOAD_SIZE', \App\Config::getMaxUploadSize());
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Config' in method 'importBasicStep'.
          Open

                  $viewer->assign('IMPORT_UPLOAD_SIZE_MB', \App\Config::getMaxUploadSize(true, true));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'uploadAndParse'.
          Open

                      $user = App\User::getCurrentUserModel();
          Severity: Minor
          Found in modules/Vtiger/views/Import.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_Inventory_Model' in method 'uploadAndParse'.
          Open

                          $inventoryModel = Vtiger_Inventory_Model::getInstance($moduleName);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Utils_Helper' in method 'uploadAndParse'.
          Open

                      $viewer->assign('USERS_LIST', Import_Utils_Helper::getAssignedToUserList($moduleName));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'import'.
          Open

                  Import_Main_View::import($request, App\User::getCurrentUserModel());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 checkImportStatus uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          $importInfo = Import_Queue_Action::getImportInfoById($lockInfo['importid']);
                          $lockOwner = $user;
                          if ($user->getId() !== $lockedBy) {
                              $lockOwner = \App\User::getUserModel($lockInfo['userid']);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Main_View' in method 'checkImportStatus'.
          Open

                          Import_Main_View::showImportStatus($importInfo, $lockOwner);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'checkPermission'.
          Open

                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'importBasicStep'.
          Open

                  $viewer->assign('XML_IMPORT_TPL', Import_Module_Model::getListTplForXmlType($moduleName));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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\Record' in method 'undoRecords'.
          Open

                      if (App\Record::isExists($recordId)) {
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'cancelImport'.
          Open

                      $importDataController = new Import_Data_Action($importInfo, \App\User::getUserModel($importInfo['user_id']));
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'checkImportStatus'.
          Open

                              $lockOwner = \App\User::getUserModel($lockInfo['userid']);
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                          || !($recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('src_record')))
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'undoRecords'.
          Open

                  $dbTableName = Import_Module_Model::getDbTableName(App\User::getCurrentUserModel());
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Main_View' in method 'cancelImport'.
          Open

                      Import_Main_View::showResult($importInfo, $importStatusCount);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Lock_Action' in method 'checkImportStatus'.
          Open

                  $lockInfo = Import_Lock_Action::isLockedForModule($moduleName);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Queue_Action' in method 'checkImportStatus'.
          Open

                          $importInfo = Import_Queue_Action::getImportInfoById($lockInfo['importid']);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Utils_Helper' in method 'checkImportStatus'.
          Open

                      Import_Utils_Helper::showImportTableBlockedError($moduleName);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'checkImportStatus'.
          Open

                  $user = \App\User::getCurrentUserModel();
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Module_Model' in method 'checkImportStatus'.
          Open

                      Import_Module_Model::clearUserImportInfo($user);
          Severity: Minor
          Found in modules/Vtiger/views/Import.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 'Import_Main_View' in method 'checkImportStatus'.
          Open

                          Import_Main_View::showImportStatus($importInfo, $user);
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                          || !($recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('src_record')))
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                  $this->exposeMethod('continueImport');
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                  $relationId = $request->getInteger('relationId');
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

          Define a constant instead of duplicating this literal "Import" 9 times.
          Open

                  if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Import') || !$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'CreateView') || (
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

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

                  $viewer->assign('FOR_MODULE', $moduleName);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by sonar-php

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

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

          Noncompliant Code Example

          With the default threshold of 3:

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

          Compliant Solution

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

          Exceptions

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

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('XML_IMPORT_TPL', Import_Module_Model::getListTplForXmlType($moduleName));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                  Import_Module_Model::clearUserImportInfo(\App\User::getCurrentUserModel());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('AVAILABLE_BLOCKS', $importModule->getFieldsByBlocks());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('FOR_MODULE_MODEL', $importModule->getImportModuleModel());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to deprecated function \Vtiger_Field_Model::getFieldLabel() defined at /code/modules/Vtiger/models/Field.php:215
          Open

                              $mandatoryFields[$fieldName] = \App\Language::translate($fieldModel->getFieldLabel(), $moduleName);
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                              $lockOwner = \App\User::getUserModel($lockInfo['userid']);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('ERROR_MESSAGE', $request->getByType('error_message', 'Text'));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('MODULE', 'Import');
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Module_Model::setImportModule
          Open

                      $importModule = Vtiger_Module_Model::getInstance('Import')
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('TOTAL_RECORDS', $noOfRecords);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                          $viewer->assign('INVENTORY_BLOCKS', $inventoryFieldsBlock);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('USERS_LIST', Import_Utils_Helper::getAssignedToUserList($moduleName));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                  $dbTableName = Import_Module_Model::getDbTableName(App\User::getCurrentUserModel());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                      $user = App\User::getCurrentUserModel();
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                          $viewer->assign('MERGE_FIELDS', \App\Json::encode($request->getArray('merge_fields', 'Alnum')));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('ENCODED_MANDATORY_FIELDS', \App\Json::encode($mandatoryFields));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('DELETED_RECORDS_COUNT', $noOfRecordsDeleted);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('FOR_MODULE', $moduleName);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                          $viewer->assign('INVENTORY', true);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Module_Model::setImportModule
          Open

                  $importModule = Vtiger_Module_Model::getInstance('Import')->setImportModule($moduleName);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                  $user = App\User::getCurrentUserModel();
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('MODULE', 'Import');
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('MODULE_MODEL', $importModule);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('FOR_MODULE', $moduleName);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('ROW_1_DATA', ($rowData && $rowData['LBL_STANDARD_FIELDS']) ? $rowData : ['LBL_STANDARD_FIELDS' => $rowData]);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('SAVED_MAPS', Import_Map_Model::getAllByModule($moduleName));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('CREATE_RECORDS_BY_MODEL', \in_array($request->getByType('type', 1), ['xml', 'zip']));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

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

                  $dataReader = (new \App\Db\Query())->select(['recordid'])
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Argument 1 (moduleName) is string but \Import_Module_Model::getListTplForXmlType() takes \type defined at /code/modules/Import/models/Module.php:140
          Open

                  $viewer->assign('XML_IMPORT_TPL', Import_Module_Model::getListTplForXmlType($moduleName));
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                          $viewer->assign('MERGE_FIELDS', '');
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                  $user = App\User::getCurrentUserModel();
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('SUPPORTED_FILE_ENCODING', Import_Module_Model::getSupportedFileEncoding());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('IMPORT_UPLOAD_SIZE_MB', \App\Config::getMaxUploadSize(true, true));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('MODULE_MODEL', $importModule);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('DATE_FORMAT', $user->getDetail('date_format'));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('USER_INPUT', $request);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('SUPPORTED_DELIMITERS', Import_Module_Model::getSupportedDelimiters());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('FOR_MODULE', $moduleName);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('GROUPS_LIST', Import_Utils_Helper::getAssignedToGroupList($moduleName));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                  Import_Main_View::import($request, App\User::getCurrentUserModel());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('MODULE_NAME', 'Import');
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Argument 1 (state) is 'Trash' but \Vtiger_Record_Model::changeState() takes \type defined at /code/modules/Vtiger/models/Record.php:1784
          Open

                              $recordModel->changeState('Trash');
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                  $user = \App\User::getCurrentUserModel();
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('SUPPORTED_FILE_TYPES', Import_Module_Model::getSupportedFileExtensions($moduleName));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('AUTO_MERGE_TYPES', Import_Module_Model::getAutoMergeTypes());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('HAS_HEADER', $hasHeader);
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                      $viewer->assign('AVAILABLE_BLOCKS', $importModule->getFieldsByBlocks());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to method getUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
          Open

                      $importDataController = new Import_Data_Action($importInfo, \App\User::getUserModel($importInfo['user_id']));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Saw unextractable annotation for comment '* @return <array> - List of Vtiger_JsScript_Model instances'</array>
          Open

               * @return <Array> - List of Vtiger_JsScript_Model instances
          Severity: Info
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('SUPPORTED_FILE_TYPES_TEXT', Import_Module_Model::getSupportedFileExtensionsDescription($moduleName));
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

          Call to undeclared method \Vtiger_Viewer::assign
          Open

                  $viewer->assign('IMPORT_UPLOAD_SIZE', \App\Config::getMaxUploadSize());
          Severity: Critical
          Found in modules/Vtiger/views/Import.php by phan

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

              public function __construct()
              {
                  parent::__construct();
                  $this->exposeMethod('continueImport');
                  $this->exposeMethod('uploadAndParse');
          Severity: Major
          Found in modules/Vtiger/views/Import.php and 1 other location - About 1 hr to fix
          modules/Vtiger/actions/RelationAjax.php on lines 19..32

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

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

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

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

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

          Refactorings

          Further Reading

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

          class Vtiger_Import_View extends Vtiger_Index_View

          The class Vtiger_Import_View is not named in CamelCase.
          Open

          class Vtiger_Import_View extends Vtiger_Index_View
          {
              use \App\Controller\ExposeMethod;
          
              public function __construct()
          Severity: Minor
          Found in modules/Vtiger/views/Import.php by phpmd

          CamelCaseClassName

          Since: 0.2

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

          Example

          class class_name {
          }

          Source

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

              {

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

                      $relationId && (

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

                          || !$relationModel->isAddActionSupported()

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

               *

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

                  $jsFileNames = [

          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->exposeMethod('uploadAndParse');

          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->isEmpty('mode')) {

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

                  return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts($jsFileNames));

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

                  $viewer->assign('XML_IMPORT_TPL', Import_Module_Model::getListTplForXmlType($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

                          || !$recordModel->isViewable()

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

              public function process(App\Request $request)

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

               * Function to get the list of Script models to be included.

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

               */

          Line exceeds 120 characters; contains 187 characters
          Open

                  if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Import') || !$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'CreateView') || (

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

                          || $relationModel->getParentModuleModel()->getName() !== $recordModel->getModuleName()

          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 ('continueImport' === $mode || 'uploadAndParse' === $mode || 'importBasicStep' === $mode) {

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

               *

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

                  $importModule->set('src_record', $request->getInteger('src_record'));

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

                  $viewer->assign('MODULE', 'Import');

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

                  $viewer->assign('FOR_MODULE_MODEL', $importModule->getImportModuleModel());

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

                  parent::__construct();

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

              public function checkPermission(App\Request $request)

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

                          || $relationModel->getRelationModuleName() !== $request->getModule()

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

              }

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

              use \App\Controller\ExposeMethod;

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

              public function __construct()

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

               * @throws \App\Exceptions\NoPermitted

          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

                      }

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

               */

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

                  $viewer->assign('SUPPORTED_FILE_TYPES_TEXT', Import_Module_Model::getSupportedFileExtensionsDescription($moduleName));

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

                  $this->exposeMethod('lastImportedRecords');

          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

              public function getFooterScripts(App\Request $request)

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

                  $importModule->set('relationId', $request->getInteger('relationId'));

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

                  $viewer->assign('FOR_MODULE', $moduleName);

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

                  $viewer->assign('ERROR_MESSAGE', $request->getByType('error_message', 'Text'));

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

                          !($relationModel = Vtiger_Relation_Model::getInstanceById($relationId))

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

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

               * Process.

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

               *

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

                  }

          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

                  $viewer->assign('SUPPORTED_FILE_TYPES', Import_Module_Model::getSupportedFileExtensions($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

                  $importModule = Vtiger_Module_Model::getInstance('Import')->setImportModule($moduleName);

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

                  $this->exposeMethod('continueImport');

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

               * Function to check permission.

          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

                  if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Import') || !$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'CreateView') || (

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

              {

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

                      if (!$this->checkImportStatus($request)) {

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

                          $this->importBasicStep($request);

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

                      // Added to check the status of import

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

                          $this->checkImportStatus($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

                  $this->exposeMethod('checkImportStatus');

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

                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

                      ))) {

          Line exceeds 120 characters; contains 126 characters
          Open

                  $viewer->assign('SUPPORTED_FILE_TYPES_TEXT', Import_Module_Model::getSupportedFileExtensionsDescription($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

              public function importBasicStep(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

                  $moduleName = $request->getModule();

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

                  $viewer->assign('SUPPORTED_DELIMITERS', Import_Module_Model::getSupportedDelimiters());

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

                  $this->exposeMethod('undoImport');

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

                  $this->exposeMethod('cancelImport');

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

               *

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

               * @return <Array> - List of Vtiger_JsScript_Model instances

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

                  $this->exposeMethod('import');

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

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

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

              }

          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

                  $viewer->assign('AVAILABLE_BLOCKS', $importModule->getFieldsByBlocks());

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

                  $this->exposeMethod('importBasicStep');

          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->invokeExposedMethod($mode, $request);

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

                      'modules.Import.resources.Import',

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

              /**

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

                  $viewer->assign('AUTO_MERGE_TYPES', Import_Module_Model::getAutoMergeTypes());

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

                  $this->exposeMethod('deleteMap');

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

                  $this->exposeMethod('clearCorruptedData');

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

              /**

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

                          || !($recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('src_record')))

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

                      $mode = $request->getMode();

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

                  ];

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

               * First step to import records.

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

                  $viewer = $this->getViewer($request);

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

                  $viewer->assign('SUPPORTED_FILE_ENCODING', Import_Module_Model::getSupportedFileEncoding());

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

                      if (null === $fileReader) {

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

                          $this->importBasicStep($request);

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

                      $viewer->assign('ROW_1_DATA', ($rowData && $rowData['LBL_STANDARD_FIELDS']) ? $rowData : ['LBL_STANDARD_FIELDS' => $rowData]);

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

                          $blocksName = ['LBL_HEADLINE', 'LBL_BASIC_VERSE', 'LBL_ADDITIONAL_VERSE'];

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

                      }

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

                  if (!$user->isAdmin() && $user->getId() !== $ownerId) {

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

                  $viewer->assign('FOR_MODULE', $moduleName);

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

                  $viewer->assign('TOTAL_RECORDS', $noOfRecords);

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

                      ++$noOfRecords;

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

                  $viewer->assign('IMPORT_UPLOAD_SIZE_MB', \App\Config::getMaxUploadSize(true, true));

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

                      $viewer = $this->getViewer($request);

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

                      if (!$autoMerge) {

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

                      $moduleName = $request->getModule();

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

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

                  $user = App\User::getCurrentUserModel();

          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

                  Import_Main_View::deleteMap($request);

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

                      $user = App\User::getCurrentUserModel();

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

                      } else {

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

                      }

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

                      $viewer->assign('GROUPS_LIST', Import_Utils_Helper::getAssignedToGroupList($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

                      ->from($dbTableName)

          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 [$noOfRecords, $noOfRecordsDeleted];

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

              {

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

                  if (null !== $importInfo && ($importInfo['user_id'] === $user->getId() || $user->isAdmin())) {

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

                      $viewer->assign('HAS_HEADER', $hasHeader);

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

                          }

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

                  }

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

              }

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

                      $viewer->assign('MODULE', 'Import');

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

                          }

          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

              public function undoImport(App\Request $request)

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

                  $viewer->assign('MODULE_NAME', 'Import');

          Line exceeds 120 characters; contains 121 characters
          Open

                      ->where(['and', ['temp_status' => Import_Data_Action::IMPORT_RECORD_CREATED], ['not', ['recordid' => 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

                  $importList = new Import_List_View();

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

                  $this->importBasicStep($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

                      $fileReader = Import_Module_Model::getFileReader($request, $user);

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

                          $viewer->assign('MERGE_FIELDS', \App\Json::encode($request->getArray('merge_fields', 'Alnum')));

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

                      $moduleModel = Vtiger_Module_Model::getInstance($moduleName);

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

                          ->set('relationId', $request->getInteger('relationId'));

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

                          } elseif ($recordModel->privilegeToDelete()) {

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

                              $recordModel->delete();

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

                      }

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

                      $viewer->assign('DATE_FORMAT', $user->getDetail('date_format'));

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

                      $importModule = Vtiger_Module_Model::getInstance('Import')

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

                      $viewer->assign('MODULE_MODEL', $importModule);

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

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

                  Import_Module_Model::clearUserImportInfo(\App\User::getCurrentUserModel());

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

              public function cancelImport(App\Request $request)

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

                  $user = App\User::getCurrentUserModel();

          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

                      foreach ($moduleModel->getMandatoryFieldModels() as $fieldName => $fieldModel) {

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

                          $viewer->assign('INVENTORY', true);

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

                      $viewer->assign('AVAILABLE_BLOCKS', $importModule->getFieldsByBlocks());

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

                  $viewer->assign('DELETED_RECORDS_COUNT', $noOfRecordsDeleted);

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

              }

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

                  $importId = $request->getInteger('import_id');

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

                  $viewer->assign('MODULE_MODEL', $importModule);

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

                          $viewer->assign('MERGE_FIELDS', '');

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

                      $viewer->assign('ENCODED_MANDATORY_FIELDS', \App\Json::encode($mandatoryFields));

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

                      $viewer->assign('USERS_LIST', Import_Utils_Helper::getAssignedToUserList($moduleName));

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

                  Import_Main_View::import($request, App\User::getCurrentUserModel());

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

                          if ($recordModel->privilegeToMoveToTrash()) {

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

                              $recordModel->changeState('Trash');

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

                      if (null !== $importInfo) {

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

                  return false;

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

                  return $viewer->view('ImportBasicStep.tpl', 'Import');

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

               *

          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;

          Line exceeds 120 characters; contains 138 characters
          Open

                      $viewer->assign('ROW_1_DATA', ($rowData && $rowData['LBL_STANDARD_FIELDS']) ? $rowData : ['LBL_STANDARD_FIELDS' => $rowData]);

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

                      $viewer->assign('USER_INPUT', $request);

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

                      if ($moduleModel->isInventory()) {

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

                          foreach ($inventoryFields as $key => $data) {

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

                          ->set('src_record', $request->getInteger('src_record'))

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

                      $viewer->assign('SAVED_MAPS', Import_Map_Model::getAllByModule($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

                  $moduleName = $request->getModule();

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

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

              {

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

              {

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

                  $importInfo = Import_Queue_Action::getImportInfoById($importId);

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

                      $importDataController = new Import_Data_Action($importInfo, \App\User::getUserModel($importInfo['user_id']));

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

                  $viewer->assign('IMPORT_UPLOAD_SIZE', \App\Config::getMaxUploadSize());

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

                  if (Import_Utils_Helper::validateFileUpload($request)) {

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

                      $hasHeader = $fileReader->hasHeader();

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

                      $rowData = $fileReader->getFirstRowData($hasHeader);

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

               * Continue import.

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

                  $viewer->view('ImportUndoResult.tpl', 'Import');

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

                  $dbTableName = Import_Module_Model::getDbTableName(App\User::getCurrentUserModel());

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

                  $importList->process($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

              {

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

                          $request->set('merge_type', 0);

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

                      $viewer->assign('FOR_MODULE', $moduleName);

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

                  $this->importBasicStep($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

                      $viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');

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

                  [$noOfRecords, $noOfRecordsDeleted] = $this->undoRecords($moduleName);

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

                  while ($recordId = $dataReader->readColumn(0)) {

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

                      $lockedBy = $lockInfo['userid'];

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

                          Import_Utils_Helper::showImportLockedError($lockInfo);

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

                          $importInfo = Import_Queue_Action::getImportInfoById($lockInfo['importid']);

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

                      Import_Utils_Helper::showImportTableBlockedError($moduleName);

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

              public function uploadAndParse(App\Request $request)

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

                          if ($fieldModel->isEditable()) {

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

                              $mandatoryFields[$fieldName] = \App\Language::translate($fieldModel->getFieldLabel(), $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

               * @param \App\Request $request

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

                  $dataReader = (new \App\Db\Query())->select(['recordid'])

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

                      if (App\Record::isExists($recordId)) {

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

              public function lastImportedRecords(App\Request $request)

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

                  $lockInfo = Import_Lock_Action::isLockedForModule($moduleName);

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

                          $importController = new Import_Main_View($request, $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

                      $mandatoryFields = [];

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

                          $inventoryModel = Vtiger_Inventory_Model::getInstance($moduleName);

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

                          $inventoryFieldsBlock = [];

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

                          $viewer->assign('INVENTORY_BLOCKS', $inventoryFieldsBlock);

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

                      return $viewer->view('ImportAdvanced.tpl', 'Import');

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

                  $this->checkImportStatus($request);

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

                      $viewer->view('Exceptions/ExceptionError.tpl', 'Vtiger');

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

                  }

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

                          $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);

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

                              ++$noOfRecordsDeleted;

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

                      $mode = $request->isEmpty('mode') ? '' : $request->getMode();

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

                          Import_Main_View::showImportStatus($importInfo, $lockOwner);

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

                          return true;

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

               * Function verifies, validates and uploads data for import.

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

                      $autoMerge = $request->getBoolean('auto_merge');

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

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

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

               */

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

              public function continueImport(App\Request $request)

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

                  $ownerId = $request->getInteger('foruser');

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

                      ->where(['and', ['temp_status' => Import_Data_Action::IMPORT_RECORD_CREATED], ['not', ['recordid' => null]]])

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

                  $noOfRecords = $noOfRecordsDeleted = 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

              public function deleteMap(App\Request $request)

          Line exceeds 120 characters; contains 121 characters
          Open

                      $importDataController = new Import_Data_Action($importInfo, \App\User::getUserModel($importInfo['user_id']));

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

                          }

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

              /**

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

                      }

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

                          $inventoryFields = $inventoryModel->getFieldsByBlocks();

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

                              $inventoryFieldsBlock[$blocksName[$key]] = $data;

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

                      $viewer->assign('CREATE_RECORDS_BY_MODEL', \in_array($request->getByType('type', 1), ['xml', 'zip']));

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

              {

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

                  $viewer = new Vtiger_Viewer();

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

              public function undoRecords(string $moduleName)

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

                              ++$noOfRecordsDeleted;

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

              }

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

              }

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

                      $importDataController->finishImport();

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

                      } else {

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

              {

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

                  // Check if import on the module is locked

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

                          Import_Main_View::showImportStatus($importInfo, $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

                              $lockOwner = \App\User::getUserModel($lockInfo['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

                  }

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

                      return true;

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

                  if (Import_Module_Model::isUserImportBlocked($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

                      $importStatusCount = $importDataController->getImportStatusCount();

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

              public function checkImportStatus(App\Request $request)

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

                  $user = \App\User::getCurrentUserModel();

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

                  if ($lockInfo) {

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

                          $importController->triggerImport(true);

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

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

                      if ('continueImport' === $mode && $user->getId() === $lockedBy) {

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

                          if ($user->getId() !== $lockedBy) {

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

                      Import_Module_Model::clearUserImportInfo($user);

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

                          throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

                      }

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

                      Import_Main_View::showResult($importInfo, $importStatusCount);

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

                      $importInfo = Import_Queue_Action::getUserCurrentImportInfo($user);

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

                      return true;

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

                  if ('continueImport' !== $request->getMode()) {

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

                  }

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

                  $moduleName = $request->getModule();

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

                      if ($user->getId() !== $lockedBy && !$user->isAdmin()) {

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

              }

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

          class Vtiger_Import_View extends Vtiger_Index_View

          There are no issues that match your filters.

          Category
          Status