YetiForceCompany/YetiForceCRM

View on GitHub
app/Export/Records.php

Summary

Maintainability
D
2 days
Test Coverage
F
0%

sendHttpHeader accesses the super-global variable $_SERVER.
Open

    public function sendHttpHeader(): void
    {
        header("content-disposition: attachment; filename=\"{$this->getFileName()}\"");
        header("content-type: {$this->getExportContentType()}; charset=UTF-8");
        header('expires: Mon, 31 Dec 2000 00:00:00 GMT');
Severity: Minor
Found in app/Export/Records.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

sendHttpHeader accesses the super-global variable $_SERVER.
Open

    public function sendHttpHeader(): void
    {
        header("content-disposition: attachment; filename=\"{$this->getFileName()}\"");
        header("content-type: {$this->getExportContentType()}; charset=UTF-8");
        header('expires: Mon, 31 Dec 2000 00:00:00 GMT');
Severity: Minor
Found in app/Export/Records.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

Function sanitizeInventoryValues has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function sanitizeInventoryValues(array $inventoryRow, array $inventoryFields): array
    {
        $inventoryEntries = [];
        foreach ($inventoryFields as $columnName => $field) {
            $value = $inventoryRow[$columnName];
Severity: Minor
Found in app/Export/Records.php - About 4 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

abstract class Records extends \App\Base
{
    /** @var int Data export in a format that can be imported later */
    public const EXPORT_FORMAT = 0;

Severity: Minor
Found in app/Export/Records.php by phpmd

File Records.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Abstract base view controller file.
 *
 * @package   Export
Severity: Minor
Found in app/Export/Records.php - About 2 hrs to fix

    Records has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class Records extends \App\Base
    {
        /** @var int Data export in a format that can be imported later */
        public const EXPORT_FORMAT = 0;
    
    
    Severity: Minor
    Found in app/Export/Records.php - About 2 hrs to fix

      Method sanitizeInventoryValues has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function sanitizeInventoryValues(array $inventoryRow, array $inventoryFields): array
          {
              $inventoryEntries = [];
              foreach ($inventoryFields as $columnName => $field) {
                  $value = $inventoryRow[$columnName];
      Severity: Minor
      Found in app/Export/Records.php - About 1 hr to fix

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

            public function getAllModuleFieldsAsHeaders(): array
            {
                $headers = [];
                $exportBlockName = \App\Config::component('Export', 'BLOCK_NAME');
                foreach ($this->moduleFieldInstances as $fieldModel) {
        Severity: Minor
        Found in app/Export/Records.php - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function setField has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function setField(string $fieldName)
            {
                $fieldModel = null;
                [$relatedFieldName, $relatedModule, $referenceField] = array_pad(explode(':', $fieldName), 3, null);
        
        
        Severity: Minor
        Found in app/Export/Records.php - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method getDisplayValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function getDisplayValue(\Vtiger_Field_Model $fieldModel, $value, int $recordId, array $rowData, $length = 65000)
        Severity: Minor
        Found in app/Export/Records.php - About 35 mins to fix

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

              public function getHeaders(): array
              {
                  if (!$this->headers) {
                      if ($this->fullData) {
                          $this->headers = $this->getAllModuleFieldsAsHeaders();
          Severity: Minor
          Found in app/Export/Records.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 sanitizeInventoryValues() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
          Open

              public function sanitizeInventoryValues(array $inventoryRow, array $inventoryFields): array
              {
                  $inventoryEntries = [];
                  foreach ($inventoryFields as $columnName => $field) {
                      $value = $inventoryRow[$columnName];
          Severity: Minor
          Found in app/Export/Records.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

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

          abstract class Records extends \App\Base
          Severity: Major
          Found in app/Export/Records.php by sonar-php

          A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

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

              public function sanitizeInventoryValues(array $inventoryRow, array $inventoryFields): array
          Severity: Critical
          Found in app/Export/Records.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 Records has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13.
          Open

          abstract class Records extends \App\Base
          {
              /** @var int Data export in a format that can be imported later */
              public const EXPORT_FORMAT = 0;
          
          
          Severity: Minor
          Found in app/Export/Records.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 '177', column '15').
          Open

                          throw new \App\Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$relatedFieldName}");
          Severity: Minor
          Found in app/Export/Records.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 '77', column '35').
          Open

                  $instance->queryGenerator = new \App\QueryGenerator($moduleName);
          Severity: Minor
          Found in app/Export/Records.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 assigning values to variables in if clauses and the like (line '155', column '9').
          Open

              public function loadFieldsFromCvId(int $cvId): void
              {
                  foreach (\App\CustomView::getInstance($this->moduleName)->getColumnsListByCvid($cvId) as $fieldInfo) {
                      ['field_name' => $relatedFieldName, 'module_name' => $relatedModule, 'source_field_name' => $referenceField] = $fieldInfo;
                      $cvFieldData = $referenceField ? "{$relatedFieldName}:{$relatedModule}:{$referenceField}" : $relatedFieldName;
          Severity: Minor
          Found in app/Export/Records.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\Language' in method 'getAllModuleFieldsAsHeaders'.
          Open

                          $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getFieldLabel()), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.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 'sanitizeInventoryValues'.
          Open

                              $recordModule = \App\Record::getType($value);
          Severity: Minor
          Found in app/Export/Records.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\SharedOwner' in method 'getDisplayValue'.
          Open

                      $value = implode(',', \App\Fields\SharedOwner::getById($recordId));
          Severity: Minor
          Found in app/Export/Records.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 setField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $result = false;
                  }
          Severity: Minor
          Found in app/Export/Records.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\Purifier' in method 'getAllModuleFieldsAsHeaders'.
          Open

                          $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getFieldLabel()), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.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 'sanitizeInventoryValues'.
          Open

                                  $valueParam = \App\Json::encode($valueNewData);
          Severity: Minor
          Found in app/Export/Records.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 'sanitizeInventoryValues'.
          Open

                              $displayValue = \App\Record::getLabel($value);
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  return \App\Utils::sanitizeSpecialChars(\App\Purifier::decodeHtml(\App\Language::translate($this->moduleName, $this->moduleName))) . ".{$this->fileExtension}";
          Severity: Minor
          Found in app/Export/Records.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 'getFileName'.
          Open

                  return \App\Utils::sanitizeSpecialChars(\App\Purifier::decodeHtml(\App\Language::translate($this->moduleName, $this->moduleName))) . ".{$this->fileExtension}";
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                          $headers[] = 'Inventory::' . \App\Language::translate(\App\Purifier::decodeHtml($field->get('label')), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  $instance->moduleInstance = \Vtiger_Module_Model::getInstance($moduleName);
          Severity: Minor
          Found in app/Export/Records.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 'getExportContentType'.
          Open

                  return \App\Fields\File::getMimeContentType($this->getFileName());
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                              $this->headers[] = \App\Purifier::decodeHtml($label);
          Severity: Minor
          Found in app/Export/Records.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 'getAllModuleFieldsAsHeaders'.
          Open

                          $headers[] = 'Inventory::' . \App\Language::translate(\App\Purifier::decodeHtml($field->get('label')), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.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_Loader' in method 'getInstance'.
          Open

                  $modelClassName = \Vtiger_Loader::getComponentClassName('Model', $componentName, $moduleName);
          Severity: Minor
          Found in app/Export/Records.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 sanitizeValues uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $valuesToReturn = $this->getDataInExportFormat($recordValues);
                  }
          Severity: Minor
          Found in app/Export/Records.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

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

                      } else {
                          foreach ($this->fields as $fieldModel) {
                              $label = $fieldModel->getFullLabelTranslation($this->moduleInstance);
                              $this->headers[] = \App\Purifier::decodeHtml($label);
                          }
          Severity: Minor
          Found in app/Export/Records.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\Language' in method 'getAllModuleFieldsAsHeaders'.
          Open

                              $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getBlockName()), $this->moduleName) . '::' . $header;
          Severity: Minor
          Found in app/Export/Records.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\Utils' in method 'getFileName'.
          Open

                  return \App\Utils::sanitizeSpecialChars(\App\Purifier::decodeHtml(\App\Language::translate($this->moduleName, $this->moduleName))) . ".{$this->fileExtension}";
          Severity: Minor
          Found in app/Export/Records.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 'getSupportedFileFormats'.
          Open

                  return \App\Config::module($moduleName, 'EXPORT_SUPPORTED_FILE_FORMATS') ?? [
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                              $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getBlockName()), $this->moduleName) . '::' . $header;
          Severity: Minor
          Found in app/Export/Records.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 'getAllModuleFieldsAsHeaders'.
          Open

                      $inventoryModel = \Vtiger_Inventory_Model::getInstance($this->moduleName);
          Severity: Minor
          Found in app/Export/Records.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 sanitizeInventoryValues uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                              } else {
                                  $value = '';
                              }
          Severity: Minor
          Found in app/Export/Records.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\Fields\Currency' in method 'sanitizeInventoryValues'.
          Open

          }
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      $returnValue = \App\Purifier::decodeHtml($returnValue);
          Severity: Minor
          Found in app/Export/Records.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 getInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $componentName = 'ExportTo' . ucfirst($exportType);
                  }
          Severity: Minor
          Found in app/Export/Records.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\Config' in method 'getAllModuleFieldsAsHeaders'.
          Open

                  $exportBlockName = \App\Config::component('Export', 'BLOCK_NAME');
          Severity: Minor
          Found in app/Export/Records.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 sanitizeInventoryValues uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                          } else {
                              $value = '';
                          }
          Severity: Minor
          Found in app/Export/Records.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

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

                      if (($fieldModel = $this->setField($cvFieldData)) && $fieldInfo['label']) {
          Severity: Critical
          Found in app/Export/Records.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 "source_field_name" 6 times.
          Open

                      ['field_name' => $relatedFieldName, 'module_name' => $relatedModule, 'source_field_name' => $referenceField] = $fieldInfo;
          Severity: Critical
          Found in app/Export/Records.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.

          Rename "$headers" which has the same name as the field declared at line 39.
          Open

                  $headers = [];
          Severity: Major
          Found in app/Export/Records.php by sonar-php

          Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

          Noncompliant Code Example

          class Foo {
            public $myField;
          
            public function doSomething() {
              $myField = 0;
              ...
            }
          }
          

          See

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

                          foreach ($field->getCustomColumn() as $columnName => $dbType) {
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          UnusedLocalVariable

          Since: 0.2

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

          Example

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

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

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

                      foreach ($field->getCustomColumn() as $customColumnName => $dbType) {
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          UnusedLocalVariable

          Since: 0.2

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

          Example

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

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

          Avoid unused parameters such as '$rowData'.
          Open

              public function getDisplayValue(\Vtiger_Field_Model $fieldModel, $value, int $recordId, array $rowData, $length = 65000)
          Severity: Minor
          Found in app/Export/Records.php by phpmd

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

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

          Call to method set from undeclared class \App\Export\Vtiger_Field_Model
          Open

                          $fieldModel->set('label', $fieldInfo['label']);
          Severity: Critical
          Found in app/Export/Records.php by phan

          Reference to undeclared property \App\Export\Records->queryGenerator
          Open

                  return $this->queryGenerator;
          Severity: Minor
          Found in app/Export/Records.php by phan

          Call to method set from undeclared class \App\Export\Vtiger_Field_Model
          Open

                          $fieldModel->set('isLabelCustomized', true);
          Severity: Critical
          Found in app/Export/Records.php by phan

          Return type of getInstance() is undeclared type \self
          Open

              public static function getInstance(string $moduleName, string $exportType = 'csv')
          Severity: Minor
          Found in app/Export/Records.php by phan

          Return type of getQueryGenerator() is undeclared type \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

              public function getQueryGenerator(): \App\QueryGenerator
          Severity: Minor
          Found in app/Export/Records.php by phan

          Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                      $queryGenerator->setFields(['id'])->addCondition('id', 0, 'e');
          Severity: Critical
          Found in app/Export/Records.php by phan

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

                          $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getFieldLabel()), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phan

          Call to method clearFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $queryGenerator->clearFields()->setLimit($this->limit);
          Severity: Critical
          Found in app/Export/Records.php by phan

          Saw an @param annotation for moduleName, but the param list of function getFileName() : string is empty
          Open

               * @param string $moduleName
          Severity: Info
          Found in app/Export/Records.php by phan

          Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  $instance->queryGenerator = new \App\QueryGenerator($moduleName);
          Severity: Critical
          Found in app/Export/Records.php by phan

          Assigning int to property but \App\Export\Records->format is bool
          Open

              protected $format = self::EXPORT_FORMAT;
          Severity: Minor
          Found in app/Export/Records.php by phan

          Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                  return $queryGenerator->createQuery();
          Severity: Critical
          Found in app/Export/Records.php by phan

          Return type of setField() is undeclared type \App\Export\Vtiger_Field_Model
          Open

              public function setField(string $fieldName)
          Severity: Minor
          Found in app/Export/Records.php by phan

          Call to method setField from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
          Open

                      $queryGenerator->setField($fieldName);
          Severity: Critical
          Found in app/Export/Records.php by phan

          Argument 1 (recordId) is string but \App\Record::getType() takes int defined at /code/app/Record.php:279
          Open

                              $recordModule = \App\Record::getType($value);
          Severity: Minor
          Found in app/Export/Records.php by phan

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

                      if (\in_array($field->getType(), ['Name', 'Reference'])) {
                          $value = trim($value);
                          if (!empty($value)) {
                              $recordModule = \App\Record::getType($value);
                              $displayValue = \App\Record::getLabel($value);
          Severity: Major
          Found in app/Export/Records.php and 1 other location - About 3 hrs to fix
          modules/Vtiger/models/ExportToXml.php on lines 101..116

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

          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

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

                          if ('currencyparam' === $customColumnName) {
                              $field = $inventoryFields['currency'];
                              $valueData = $field->getCurrencyParam([], $valueParam);
                              if (\is_array($valueData)) {
                                  $valueNewData = [];
          Severity: Major
          Found in app/Export/Records.php and 1 other location - About 1 hr to fix
          modules/Vtiger/models/ExportToSpreadsheet.php on lines 186..197

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

          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

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

              public const EXPORT_FORMAT = 0;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $moduleName;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $fields = [];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $instance = new $modelClassName();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  foreach ($fields as $fieldName) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $cvFieldData = $referenceField ? "{$relatedFieldName}:{$relatedModule}:{$referenceField}" : $relatedFieldName;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public $fullData = false;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $componentName = 'ExportToCsv';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Get supported file formats.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      'LBL_XML' => 'xml',
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Get query generator object.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $this->queryGenerator;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var int Data export in user format */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var \Vtiger_Module_Model Module model. */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getQueryGenerator(): \App\QueryGenerator
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param array $fields
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var string Module name */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $moduleFieldInstances;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var string File extension */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Set the format of the exported data.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              abstract public function exportData();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $this->setField($fieldName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return void
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function setFields(array $fields)
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param int $cvId
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      if (($fieldModel = $this->setField($cvFieldData)) && $fieldInfo['label']) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public const USER_FORMAT = 1;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var array Fields for export */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Get instance.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  } else {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $modelClassName = \Vtiger_Loader::getComponentClassName('Model', $componentName, $moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $instance->fileExtension = $exportType;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  ];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $fieldModel->set('isLabelCustomized', true);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $headers = [];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param string $moduleName
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $instance->queryGenerator = new \App\QueryGenerator($moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $instance;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      'LBL_XLS' => 'xls',
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $fileExtension = '';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var array Headers field */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var bool Export all data */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public static function getInstance(string $moduleName, string $exportType = 'csv')
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param string $moduleName
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Function exports the data.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function loadFieldsFromCvId(int $cvId): void
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 122 characters
          Open

                      $cvFieldData = $referenceField ? "{$relatedFieldName}:{$relatedModule}:{$referenceField}" : $relatedFieldName;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var int Data export in a format that can be imported later */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var \Vtiger_Field_Model[] Field model instance. */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $componentName = 'ExportToSpreadsheet';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $format = self::EXPORT_FORMAT;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param string $exportType
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return \self
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $this;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $this;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  foreach (\App\CustomView::getInstance($this->moduleName)->getColumnsListByCvid($cvId) as $fieldInfo) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if ('csv' === $exportType || empty($exportType)) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  } elseif ('xls' === $exportType || 'xlsx' === $exportType || 'ods' === $exportType) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return $this
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Set.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var bool Export all data */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public static function getSupportedFileFormats(string $moduleName): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return \App\Config::module($moduleName, 'EXPORT_SUPPORTED_FILE_FORMATS') ?? [
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param int $format self::EXPORT_FORMAT or self::USER_FORMAT
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      ['field_name' => $relatedFieldName, 'module_name' => $relatedModule, 'source_field_name' => $referenceField] = $fieldInfo;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $componentName = 'ExportTo' . ucfirst($exportType);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $instance->moduleName = $moduleName;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $this->format = $format;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return $this
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $instance->moduleFieldInstances = $instance->moduleInstance->getFields();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Load fields from custom view.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 134 characters
          Open

                      ['field_name' => $relatedFieldName, 'module_name' => $relatedModule, 'source_field_name' => $referenceField] = $fieldInfo;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $moduleInstance;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /** @var int Limit of exported entries */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              protected $limit;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $instance->moduleInstance = \Vtiger_Module_Model::getInstance($moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      'LBL_CSV' => 'csv',
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function setFormat(int $format)
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return \App\QueryGenerator
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return Vtiger_Field_Model|false
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          throw new \App\Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$relatedFieldName}");
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $result;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Set a limit for exported data.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Get fields for query.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if ($this->moduleInstance->isInventory()) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $this->headers[] = \App\Purifier::decodeHtml($label);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $this->headers;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if (self::USER_FORMAT === $this->format) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param array $inventoryRow
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if (!$this->headers) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getBlockName()), $this->moduleName) . '::' . $header;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      foreach ($inventoryFields as $field) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $headers[] = 'Inventory::' . $columnName;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function sanitizeValues(array $recordValues): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $fieldModel = clone $relatedFieldModel;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $result = $this->fields[$fieldModel->getFullName()] = $fieldModel;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return $this
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $this->limit = $limit;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  foreach ($this->moduleFieldInstances as $fieldModel) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $headers[] = 'Inventory::recordIteration';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function setField(string $fieldName)
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param int $limit
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          foreach ($this->fields as $fieldModel) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $this->fields;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 138 characters
          Open

                          $headers[] = 'Inventory::' . \App\Language::translate(\App\Purifier::decodeHtml($field->get('label')), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $queryGenerator->setField($fieldName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * This function takes in an array of values for an user and sanitizes it for export
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $result = false;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $label = $fieldModel->getFullLabelTranslation($this->moduleInstance);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $headers = [];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $queryGenerator->setFields(['id'])->addCondition('id', 0, 'e');
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 147 characters
          Open

                              $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getBlockName()), $this->moduleName) . '::' . $header;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  foreach (array_keys($queryFields) as $fieldName) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $valuesToReturn = $this->getDataInUserFormat($recordValues);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $this;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      if ($this->fullData) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      } else {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getFieldLabel()), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $headers[] = $header;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $inventoryFields = $inventoryModel->getFields();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          foreach ($field->getCustomColumn() as $columnName => $dbType) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return \App\Db\Query
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  [$relatedFieldName, $relatedModule, $referenceField] = array_pad(explode(':', $fieldName), 3, null);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getExportQuery(): \App\Db\Query
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $queryGenerator->createQuery();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Requires modification after adding a new field type.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $valuesToReturn = $this->getDataInExportFormat($recordValues);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $fieldModel->set('label', $fieldInfo['label']);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  } elseif (!empty($this->moduleFieldInstances[$relatedFieldName])) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $this->headers = $this->getAllModuleFieldsAsHeaders();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $this->setFields(array_keys($this->moduleFieldInstances));
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          if ($exportBlockName) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param array $inventoryFields
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Set field model.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      if (!isset($this->moduleFieldInstances[$referenceField]) || !$relatedFieldModel) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if ($fieldModel && $fieldModel->isExportable()) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $headers[] = 'Inventory::' . \App\Language::translate(\App\Purifier::decodeHtml($field->get('label')), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  } else {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if ($referenceField) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Function returns all module fields as headers.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $exportBlockName = \App\Config::component('Export', 'BLOCK_NAME');
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 127 characters
          Open

                          $header = \App\Language::translate(\App\Purifier::decodeHtml($fieldModel->getFieldLabel()), $this->moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $headers;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $relatedFieldModel = \Vtiger_Module_Model::getInstance($relatedModule)->getFieldByName($relatedFieldName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  } else {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function setLimit(int $limit)
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getHeaders(): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if ($this->fullData) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      if ($fieldModel->isExportable()) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $queryGenerator->clearFields()->setLimit($this->limit);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if (!$queryFields) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Sanitize inventory values.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param string $fieldName
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $fieldModel = clone $this->moduleFieldInstances[$relatedFieldName];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $queryGenerator = $this->getQueryGenerator();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $queryFields = $this->getFieldsForQuery();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param array $recordValues
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $valuesToReturn;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $displayValue = \App\Record::getLabel($value);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              if (!empty($recordModule) && !empty($displayValue)) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                  $value = $recordModule . '::::' . $displayValue;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $valueData = $field->getCurrencyParam([], $valueParam);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $inventoryEntries['inv_' . $customColumnName] = $valueParam;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getDataInUserFormat(array $recordValues): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Function returns the export type - This can be extended to support different file exports.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $inventoryEntries['inv_' . $columnName] = $value;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  foreach ($this->fields as $dbKey => $fieldModel) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $response;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param mixed               $value
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  header("content-disposition: attachment; filename=\"{$this->getFileName()}\"");
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getExportContentType(): string
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $fieldModel = null;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $fieldModel->set('source_field_name', $referenceField);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Get file headers.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getFieldsForQuery(): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getAllModuleFieldsAsHeaders(): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $inventoryModel = \Vtiger_Inventory_Model::getInstance($this->moduleName);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Function that generates Export Query object.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      foreach ($field->getCustomColumn() as $customColumnName => $dbType) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  header("content-type: {$this->getExportContentType()}; charset=UTF-8");
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $value = $inventoryRow[$columnName];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  foreach ($this->fields as $dbKey => $fieldModel) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $name = $fieldModel->get('source_field_name') . $fieldModel->getModuleName();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $idKey = $name . $idKey;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 151 characters
          Open

                      $response[$fieldModel->getFullName()] = $fieldModel->getUITypeModel()->getValueToExport($recordValues[$dbKey], $recordValues[$idKey] ?? 0);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Get display value.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if ('sharedOwner' === $fieldModel->getFieldDataType() && $recordId) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $idKey = $name . $idKey;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Function returns record data in export format.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param array               $rowData
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getDisplayValue(\Vtiger_Field_Model $fieldModel, $value, int $recordId, array $rowData, $length = 65000)
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $returnValue = $fieldModel->getDisplayValue($value, $recordId, null, true, $length);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 167 characters
          Open

                  return \App\Utils::sanitizeSpecialChars(\App\Purifier::decodeHtml(\App\Language::translate($this->moduleName, $this->moduleName))) . ".{$this->fileExtension}";
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $name = $fieldModel->get('source_field_name') . $fieldModel->getModuleName();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $response;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param array $recordValues
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $returnValue = \App\Purifier::decodeHtml($returnValue);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function sanitizeInventoryValues(array $inventoryRow, array $inventoryFields): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          if (!empty($value)) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $value = '';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $idKey = 'id';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param \Vtiger_Field_Model $fieldModel
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $returnValue && 'text' === $fieldModel->getFieldDataType() ? strip_tags($returnValue) : $returnValue;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return \App\Fields\File::getMimeContentType($this->getFileName());
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                  $valueNewData = [];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      if ($fieldModel->get('source_field_name')) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $dbKey = $name . $fieldModel->getName();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $response[$fieldModel->getFullName()] = $this->getDisplayValue($fieldModel, $recordValues[$dbKey], $recordValues[$idKey] ?? 0, $recordValues);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function sendHttpHeader(): void
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return string
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      if (\in_array($field->getType(), ['Name', 'Reference'])) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              } else {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $valueParam = $inventoryRow[$customColumnName];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                  foreach ($valueData as $currencyId => $data) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                      $valueNewData[$currencyName] = $data;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                  $valueParam = \App\Json::encode($valueNewData);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param array $recordValues
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return void
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  foreach ($inventoryFields as $columnName => $field) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $field = $inventoryFields['currency'];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $response = [];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Send HTTP Header.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      header('pragma: public');
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $value = trim($value);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $value = $field->getDisplayValue($value);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $idKey = 'id';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return string
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $inventoryEntries = [];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                  $value = '';
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param int                 $length
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  header('cache-control: post-check=0, pre-check=0', false);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param string $moduleName
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              $recordModule = \App\Record::getType($value);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return $inventoryEntries;
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getDataInExportFormat(array $recordValues): array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          if ('currencyparam' === $customColumnName) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              if (\is_array($valueData)) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      if ($fieldModel->get('source_field_name')) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          $dbKey = $name . $fieldModel->getName();
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @param int                 $recordId
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 124 characters
          Open

              public function getDisplayValue(\Vtiger_Field_Model $fieldModel, $value, int $recordId, array $rowData, $length = 65000)
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                          } else {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      } elseif ('Currency' === $field->getType()) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          Line exceeds 120 characters; contains 154 characters
          Open

                      $response[$fieldModel->getFullName()] = $this->getDisplayValue($fieldModel, $recordValues[$dbKey], $recordValues[$idKey] ?? 0, $recordValues);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  $response = [];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  if (\is_string($returnValue)) {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  header('last-modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return string
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              public function getFileName(): string
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  return \App\Utils::sanitizeSpecialChars(\App\Purifier::decodeHtml(\App\Language::translate($this->moduleName, $this->moduleName))) . ".{$this->fileExtension}";
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                                      $currencyName = \App\Fields\Currency::getById($currencyId)['currency_name'];
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * Get data from record in display format.
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $response[$fieldModel->getFullName()] = $fieldModel->getUITypeModel()->getValueToExport($recordValues[$dbKey], $recordValues[$idKey] ?? 0);
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                      $value = implode(',', \App\Fields\SharedOwner::getById($recordId));
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

                  header('expires: Mon, 31 Dec 2000 00:00:00 GMT');
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in app/Export/Records.php by phpcodesniffer

          There are no issues that match your filters.

          Category
          Status