YetiForceCompany/YetiForceCRM

View on GitHub
modules/Import/helpers/Utils.php

Summary

Maintainability
B
5 hrs
Test Coverage
F
0%

validateFileUpload accesses the super-global variable $_FILES.
Open

    public static function validateFileUpload(App\Request $request)
    {
        $currentUser = \App\User::getCurrentUserModel();

        $uploadMaxSize = \App\Config::getMaxUploadSize();
Severity: Minor
Found in modules/Import/helpers/Utils.php by phpmd

Superglobals

Since: 0.2

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

Example

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

Source

validateFileUpload accesses the super-global variable $_FILES.
Open

    public static function validateFileUpload(App\Request $request)
    {
        $currentUser = \App\User::getCurrentUserModel();

        $uploadMaxSize = \App\Config::getMaxUploadSize();
Severity: Minor
Found in modules/Import/helpers/Utils.php by phpmd

Superglobals

Since: 0.2

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

Example

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

Source

validateFileUpload accesses the super-global variable $_FILES.
Open

    public static function validateFileUpload(App\Request $request)
    {
        $currentUser = \App\User::getCurrentUserModel();

        $uploadMaxSize = \App\Config::getMaxUploadSize();
Severity: Minor
Found in modules/Import/helpers/Utils.php by phpmd

Superglobals

Since: 0.2

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

Example

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

Source

validateFileUpload accesses the super-global variable $_FILES.
Open

    public static function validateFileUpload(App\Request $request)
    {
        $currentUser = \App\User::getCurrentUserModel();

        $uploadMaxSize = \App\Config::getMaxUploadSize();
Severity: Minor
Found in modules/Import/helpers/Utils.php by phpmd

Superglobals

Since: 0.2

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

Example

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

Source

validateFileUpload accesses the super-global variable $_FILES.
Open

    public static function validateFileUpload(App\Request $request)
    {
        $currentUser = \App\User::getCurrentUserModel();

        $uploadMaxSize = \App\Config::getMaxUploadSize();
Severity: Minor
Found in modules/Import/helpers/Utils.php by phpmd

Superglobals

Since: 0.2

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

Example

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

Source

Method validateFileUpload has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function validateFileUpload(App\Request $request)
    {
        $currentUser = \App\User::getCurrentUserModel();

        $uploadMaxSize = \App\Config::getMaxUploadSize();
Severity: Minor
Found in modules/Import/helpers/Utils.php - About 1 hr to fix

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

        public static function validateFileUpload(App\Request $request)
        {
            $currentUser = \App\User::getCurrentUserModel();
    
            $uploadMaxSize = \App\Config::getMaxUploadSize();
    Severity: Minor
    Found in modules/Import/helpers/Utils.php - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Avoid too many return statements within this method.
    Open

                return false;
    Severity: Major
    Found in modules/Import/helpers/Utils.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return false;
      Severity: Major
      Found in modules/Import/helpers/Utils.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return false;
        Severity: Major
        Found in modules/Import/helpers/Utils.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return false;
          Severity: Major
          Found in modules/Import/helpers/Utils.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return true;
            Severity: Major
            Found in modules/Import/helpers/Utils.php - About 30 mins to fix

              The method validateFileUpload() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
              Open

                  public static function validateFileUpload(App\Request $request)
                  {
                      $currentUser = \App\User::getCurrentUserModel();
              
                      $uploadMaxSize = \App\Config::getMaxUploadSize();
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              NPathComplexity

              Since: 0.1

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

              Example

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

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

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

                  public static function validateFileUpload(App\Request $request)
                  {
                      $currentUser = \App\User::getCurrentUserModel();
              
                      $uploadMaxSize = \App\Config::getMaxUploadSize();
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 9, down to the maximum allowed 3.
              Open

                  public static function validateFileUpload(App\Request $request)
              Severity: Major
              Found in modules/Import/helpers/Utils.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;
              }
              

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

                      $viewer = new Vtiger_Viewer();
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                  public static function showErrorPage($errorMessage, $errorDetails = false, $customActions = false)
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                  public static function showErrorPage($errorMessage, $errorDetails = false, $customActions = false)
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      if ($cache->getGroupList($module, \App\User::getCurrentUserId())) {
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                      $fileReader = Import_Module_Model::getFileReader($request, $currentUser);
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Language::translate('LBL_NO_ROWS_FOUND', 'Import'));
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'showImportLockedError'.
              Open

                      $errorMessage = \App\Language::translate('ERR_MODULE_IMPORT_LOCKED', 'Import');
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'getAssignedToUserList'.
              Open

                      if ($cache->getUserList($module, \App\User::getCurrentUserId())) {
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Fields\File' in method 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Fields\File::getErrorMessage($_FILES['import_file']['error']));
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                              $uploadMaxSize . ' ' . \App\Language::translate('LBL_IMPORT_CHANGE_UPLOAD_SIZE', 'Import'));
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Module' in method 'showImportLockedError'.
              Open

                      $errorDetails = [\App\Language::translate('LBL_MODULE_NAME', 'Import') => \App\Module::getModuleName($lockInfo['tabid']),
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'showImportLockedError'.
              Open

                          \App\Language::translate('LBL_USER_NAME', 'Import') => \App\Fields\Owner::getUserLabel($lockInfo['userid']),
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                      $cache = Vtiger_Cache::getInstance();
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Language::translate('LBL_IMPORT_DIRECTORY_NOT_WRITABLE', 'Import'));
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Language::translateArgs('LBL_IMPORT_FILE_DIFFERENT_ENCODING', 'Import', $fileInstance->getEncoding()));
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Fields\File' in method 'validateFileUpload'.
              Open

                      $fileInstance = \App\Fields\File::loadFromRequest($_FILES['import_file']);
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Language::translate('LBL_IMPORT_FILE_COPY_FAILED', 'Import'));
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'getAssignedToUserList'.
              Open

                      $cache->setUserList($module, $userList, \App\User::getCurrentUserId());
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'getAssignedToGroupList'.
              Open

                      $cache->setGroupList($module, $groupList, \App\User::getCurrentUserId());
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'showImportTableBlockedError'.
              Open

                      $errorMessage = \App\Language::translate('ERR_UNIMPORTED_RECORDS_EXIST', 'Import');
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class 'App\Fields\File' in method 'getImportFilePath'.
              Open

                      return App\Fields\File::getTmpPath() . 'IMPORT_' . $user->getId();
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                      $currentUser = \App\User::getCurrentUserModel();
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                      $uploadMaxSize = \App\Config::getMaxUploadSize();
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Language::translate('LBL_INVALID_FILE', 'Import'));
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                      $cache = Vtiger_Cache::getInstance();
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Language::translate('LBL_FILE_UPLOAD_FAILED', 'Import'));
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'validateFileUpload'.
              Open

                          $request->set('error_message', \App\Language::translate('LBL_IMPORT_ERROR_LARGE_FILE', 'Import') .
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class '\App\Fields\Owner' in method 'showImportLockedError'.
              Open

                          \App\Language::translate('LBL_USER_NAME', 'Import') => \App\Fields\Owner::getUserLabel($lockInfo['userid']),
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'showImportLockedError'.
              Open

                          \App\Language::translate('LBL_LOCKED_TIME', 'Import') => $lockInfo['locked_since'], ];
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'getAssignedToGroupList'.
              Open

                          return $cache->getGroupList($module, \App\User::getCurrentUserId());
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

              Avoid using static access to class 'App\Fields\File' in method 'validateFileUpload'.
              Open

                      $importDirectory = App\Fields\File::getTmpPath();
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'getAssignedToUserList'.
              Open

                          return $cache->getUserList($module, \App\User::getCurrentUserId());
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 'showImportLockedError'.
              Open

                      $errorDetails = [\App\Language::translate('LBL_MODULE_NAME', 'Import') => \App\Module::getModuleName($lockInfo['tabid']),
              Severity: Minor
              Found in modules/Import/helpers/Utils.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 "import_file" 5 times.
              Open

                      if ($_FILES['import_file']['error']) {
              Severity: Critical
              Found in modules/Import/helpers/Utils.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 "error_message" 8 times.
              Open

                          $request->set('error_message', \App\Fields\File::getErrorMessage($_FILES['import_file']['error']));
              Severity: Critical
              Found in modules/Import/helpers/Utils.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" 15 times.
              Open

                      $viewer->assign('MODULE_NAME', 'Import');
              Severity: Critical
              Found in modules/Import/helpers/Utils.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('CUSTOM_ACTIONS', $customActions);
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method setUserList on non-class type false
              Open

                      $cache->setUserList($module, $userList, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

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

                      if ($cache->getUserList($module, \App\User::getCurrentUserId())) {
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

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

                      $cache->setUserList($module, $userList, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Parameter $user has undeclared type \App\User (Did you mean class \Tests\App\User)
              Open

                  public static function getImportFilePath(App\User $user)
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phan

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

                      return App\Fields\File::getTmpPath() . 'IMPORT_' . $user->getId();
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to undeclared method \Vtiger_Viewer::assign
              Open

                      $viewer->assign('ERROR_MESSAGE', $errorMessage);
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method getInstance from undeclared class \App\Fields\Owner
              Open

                      $userList = \App\Fields\Owner::getInstance($module)->getAccessibleUsers('', 'owner');
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method getGroupList on non-class type false
              Open

                      if ($cache->getGroupList($module, \App\User::getCurrentUserId())) {
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

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

                          return $cache->getGroupList($module, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method getUserList on non-class type false
              Open

                          return $cache->getUserList($module, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to undeclared method \Vtiger_Viewer::assign
              Open

                      $viewer->assign('ERROR_DETAILS', $errorDetails);
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to undeclared method \Vtiger_Viewer::assign
              Open

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

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

                          return $cache->getUserList($module, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method getInstance from undeclared class \App\Fields\Owner
              Open

                      $groupList = \App\Fields\Owner::getInstance()->getGroups(false);
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method getUserLabel from undeclared class \App\Fields\Owner
              Open

                          \App\Language::translate('LBL_USER_NAME', 'Import') => \App\Fields\Owner::getUserLabel($lockInfo['userid']),
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method getUserList on non-class type false
              Open

                      if ($cache->getUserList($module, \App\User::getCurrentUserId())) {
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

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

                      $cache->setGroupList($module, $groupList, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

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

                      $currentUser = \App\User::getCurrentUserModel();
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method getGroupList on non-class type false
              Open

                          return $cache->getGroupList($module, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

              Call to method setGroupList on non-class type false
              Open

                      $cache->setGroupList($module, $groupList, \App\User::getCurrentUserId());
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

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

                      if ($cache->getGroupList($module, \App\User::getCurrentUserId())) {
              Severity: Critical
              Found in modules/Import/helpers/Utils.php by phan

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

                  public static $supportedFileExtensionsByModule = ['Contacts' => ['csv', 'vcf'], 'Calendar' => ['csv', 'ical', 'ics'], 'Default' => ['csv', 'xml', 'zip']];
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

                  public static $supportedFileExtensions = ['csv', 'vcf', 'ical', 'xml', 'ics'];
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

                  public static $AUTO_MERGE_MERGEFIELDS = 3;
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

              class Import_Utils_Helper

              The property $AUTO_MERGE_MERGEFIELDS is not named in camelCase.
              Open

              class Import_Utils_Helper
              {
                  public static $AUTO_MERGE_NONE = 0;
                  public static $AUTO_MERGE_IGNORE = 1;
                  public static $AUTO_MERGE_OVERWRITE = 2;
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $AUTO_MERGE_IGNORE is not named in camelCase.
              Open

              class Import_Utils_Helper
              {
                  public static $AUTO_MERGE_NONE = 0;
                  public static $AUTO_MERGE_IGNORE = 1;
                  public static $AUTO_MERGE_OVERWRITE = 2;
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The class Import_Utils_Helper is not named in CamelCase.
              Open

              class Import_Utils_Helper
              {
                  public static $AUTO_MERGE_NONE = 0;
                  public static $AUTO_MERGE_IGNORE = 1;
                  public static $AUTO_MERGE_OVERWRITE = 2;
              Severity: Minor
              Found in modules/Import/helpers/Utils.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

              The property $AUTO_MERGE_OVERWRITE is not named in camelCase.
              Open

              class Import_Utils_Helper
              {
                  public static $AUTO_MERGE_NONE = 0;
                  public static $AUTO_MERGE_IGNORE = 1;
                  public static $AUTO_MERGE_OVERWRITE = 2;
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $AUTO_MERGE_NONE is not named in camelCase.
              Open

              class Import_Utils_Helper
              {
                  public static $AUTO_MERGE_NONE = 0;
                  public static $AUTO_MERGE_IGNORE = 1;
                  public static $AUTO_MERGE_OVERWRITE = 2;
              Severity: Minor
              Found in modules/Import/helpers/Utils.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              Terminating statement must be indented to the same level as the CASE body
              Open

                                  return self::$supportedFileExtensionsByModule[$moduleName];

              Terminating statement must be indented to the same level as the CASE body
              Open

                                  return self::$supportedFileExtensionsByModule['Default'];

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

                  public static $AUTO_MERGE_IGNORE = 1;

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

                  /**

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

                          \App\Language::translate('LBL_USER_NAME', 'Import') => \App\Fields\Owner::getUserLabel($lockInfo['userid']),

              Line exceeds 120 characters; contains 132 characters
              Open

                      $customActions = ['LBL_CLEAR_DATA' => "location.href='index.php?module={$moduleName}&view=Import&mode=clearCorruptedData'"];

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

                      if ($cache->getUserList($module, \App\User::getCurrentUserId())) {

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

                   * Get supported file extensions description.

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

                   * @return string

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

                      $viewer->assign('ERROR_MESSAGE', $errorMessage);

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

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

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

                  }

              Line exceeds 120 characters; contains 129 characters
              Open

                      $errorDetails = [\App\Language::translate('LBL_MODULE_NAME', 'Import') => \App\Module::getModuleName($lockInfo['tabid']),

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

                          \App\Language::translate('LBL_LOCKED_TIME', 'Import') => $lockInfo['locked_since'], ];

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

                      self::showErrorPage($errorMessage, $errorDetails);

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

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

                      }

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

                  public static $supportedFileExtensions = ['csv', 'vcf', 'ical', 'xml', 'ics'];

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

                  public static function getSupportedFileExtensions($moduleName = 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

                   *

              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

                   * @param string $moduleName

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

                                  return self::$supportedFileExtensionsByModule[$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

                   * Shows import errors in the table.

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

                      }

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

                  public static function getAssignedToGroupList($module)

              Line exceeds 120 characters; contains 158 characters
              Open

                  public static $supportedFileExtensionsByModule = ['Contacts' => ['csv', 'vcf'], 'Calendar' => ['csv', 'ical', 'ics'], 'Default' => ['csv', '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

                      foreach ($supportedFileTypes as $fileType) {

              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

                      $supportedFileTypes = self::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

                  {

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

                      $userList = \App\Fields\Owner::getInstance($module)->getAccessibleUsers('', 'owner');

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

                      $cache = Vtiger_Cache::getInstance();

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

                              default:

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

                   * @return string

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

                  /**

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

                   */

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

                      $errorMessage = \App\Language::translate('ERR_UNIMPORTED_RECORDS_EXIST', 'Import');

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

                  public static function getAssignedToUserList($module)

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

                  public static $AUTO_MERGE_OVERWRITE = 2;

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

                  public static $supportedFileExtensionsByModule = ['Contacts' => ['csv', 'vcf'], 'Calendar' => ['csv', 'ical', 'ics'], 'Default' => ['csv', 'xml', 'zip']];

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

                      if (!$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

                              case 'Calendar':

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

                  public static function getSupportedFileExtensionsDescription(string $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

                          return $cache->getUserList($module, \App\User::getCurrentUserId());

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

                          return $cache->getGroupList($module, \App\User::getCurrentUserId());

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

                  public static $AUTO_MERGE_MERGEFIELDS = 3;

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

                   */

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

                   *

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

                  public static function getImportFilePath(App\User $user)

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

                      return App\Fields\File::getTmpPath() . 'IMPORT_' . $user->getId();

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

                      $errorMessage = \App\Language::translate('ERR_MODULE_IMPORT_LOCKED', 'Import');

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

                      $customActions = ['LBL_CLEAR_DATA' => "location.href='index.php?module={$moduleName}&view=Import&mode=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

                      $cache->setUserList($module, $userList, \App\User::getCurrentUserId());

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

                      $groupList = \App\Fields\Owner::getInstance()->getGroups(false);

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

                  public static $AUTO_MERGE_NONE = 0;

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

                              case 'Contacts':

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

                   *

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

                  {

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

                  public static function showImportLockedError($lockInfo)

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

                          $description[] = '.' . strtoupper($fileType);

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

                  public static function showErrorPage($errorMessage, $errorDetails = false, $customActions = false)

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

                  public static function showImportTableBlockedError($moduleName)

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

                      $cache = Vtiger_Cache::getInstance();

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

                      switch ($moduleName) {

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

                   * @param string $moduleName

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

                      $viewer->assign('CUSTOM_ACTIONS', $customActions);

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

                      $viewer->view('ImportError.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

                   * @param \App\User $user

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

                      $viewer->assign('ERROR_DETAILS', $errorDetails);

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

                      self::showErrorPage($errorMessage, '', $customActions);

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

                          return self::$supportedFileExtensions;

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

                                  return self::$supportedFileExtensionsByModule['Default'];

              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 implode(', ', $description);

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

                   * The function takes the path of the file to be imported.

              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 ($cache->getGroupList($module, \App\User::getCurrentUserId())) {

              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 (!is_uploaded_file($_FILES['import_file']['tmp_name'])) {

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

                          return false;

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

                  }

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

                      $description = [];

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

                  {

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

                      $errorDetails = [\App\Language::translate('LBL_MODULE_NAME', 'Import') => \App\Module::getModuleName($lockInfo['tabid']),

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

                   *

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

                      $assignableGroupsList = self::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

                          $request->set('error_message', \App\Language::translate('LBL_FILE_UPLOAD_FAILED', 'Import'));

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

                      if ($_FILES['import_file']['size'] > $uploadMaxSize) {

              Line exceeds 120 characters; contains 151 characters
              Open

                          $request->set('error_message', \App\Language::translateArgs('LBL_IMPORT_FILE_DIFFERENT_ENCODING', 'Import', $fileInstance->getEncoding()));

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

                      if (!$fileInstance->moveFile($temporaryFileName)) {

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

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

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

                          $request->set('error_message', \App\Language::translate('LBL_INVALID_FILE', 'Import'));

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

                      $temporaryFileName = self::getImportFilePath($currentUser);

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

                      if ($_FILES['import_file']['error']) {

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

                  public static function hasAssignPrivilege($moduleName, $assignToUserId)

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

                          $request->set('error_message', \App\Fields\File::getErrorMessage($_FILES['import_file']['error']));

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

                          return false;

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

                      }

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

                      $fileInstance = \App\Fields\File::loadFromRequest($_FILES['import_file']);

              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

                          $request->set('error_message', \App\Language::translate('LBL_IMPORT_DIRECTORY_NOT_WRITABLE', '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

                  public static function validateFileUpload(App\Request $request)

              Line exceeds 120 characters; contains 151 characters
              Open

                      if ('zip' !== $fileInstance->getExtension(true) && $fileInstance->getEncoding() !== strtoupper($request->getByType('file_encoding', 'Text'))) {

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

              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

                      }

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

                      if (\array_key_exists($assignToUserId, $assignableGroupsList)) {

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

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

                          return false;

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

                      if (\array_key_exists($assignToUserId, $assignableUsersList)) {

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

                      }

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

                          return false;

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

                      }

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

                      if (null === $fileReader) {

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

                      if (false === $firstRow) {

              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

                      $assignableUsersList = self::getAssignedToUserList($moduleName);

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

                   * Validates uploads file.

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

                      }

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

                  /**

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

                   *

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

                  {

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

                          return false;

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

                      }

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

                      $firstRow = $fileReader->getFirstRowData($fileReader->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

                      $importDirectory = App\Fields\File::getTmpPath();

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

                      if ('zip' !== $fileInstance->getExtension(true) && $fileInstance->getEncoding() !== strtoupper($request->getByType('file_encoding', 'Text'))) {

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

                          $request->set('error_message', \App\Language::translate('LBL_NO_ROWS_FOUND', 'Import'));

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

                      $uploadMaxSize = \App\Config::getMaxUploadSize();

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

                          $request->set('error_message', \App\Language::translateArgs('LBL_IMPORT_FILE_DIFFERENT_ENCODING', 'Import', $fileInstance->getEncoding()));

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

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

                   * @return bool

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

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

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

                      }

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

                      $cache->setGroupList($module, $groupList, \App\User::getCurrentUserId());

              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

                          $request->set('error_message', \App\Language::translate('LBL_IMPORT_ERROR_LARGE_FILE', 'Import') .

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

                              $uploadMaxSize . ' ' . \App\Language::translate('LBL_IMPORT_CHANGE_UPLOAD_SIZE', 'Import'));

              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

                          $request->set('error_message', \App\Language::translate('LBL_IMPORT_FILE_COPY_FAILED', 'Import'));

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              case 'Calendar':

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          }

              Closing brace indented incorrectly; expected 8 spaces, found 12
              Open

                          }

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              default:

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

              class Import_Utils_Helper

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              case 'Contacts':

              There are no issues that match your filters.

              Category
              Status