YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/Purifier.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

Method dataProviderByType has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function dataProviderByType()
    {
        // $type, $assertion, $expected, $text, $message, $exception
        return [
            ['Standard', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample text should be unchanged', null],
Severity: Minor
Found in tests/App/Purifier.php - About 1 hr to fix

    Method testPurifyByType has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function testPurifyByType($type, $assertion, $expected, $text, string $message, ?string $exception): void
    Severity: Minor
    Found in tests/App/Purifier.php - About 45 mins to fix

      Missing class import via use statement (line '251', column '15').
      Open

                      throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE');
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\DateTime' in method 'setUpBeforeClass'.
      Open

              $userRecordModel->set('time_zone', \App\Fields\DateTime::getTimeZone());
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              $userModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Minor
      Found in tests/App/Purifier.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 'testEmptyValues'.
      Open

              $this->assertNull(\App\Purifier::purifyHtmlEventAttributes(''), 'Empty text should not throw exception');
      Severity: Minor
      Found in tests/App/Purifier.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 'testTextValues'.
      Open

              $this->assertSame(['Test text string for purifier', 'Test text string for purifier'], \App\Purifier::purify(['Test text string for purifier', 'Test text string for purifier']), 'Sample text should be unchanged(array)');
      Severity: Minor
      Found in tests/App/Purifier.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 'testEmptyValues'.
      Open

              $this->assertSame('', \App\Purifier::purifyHtml(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.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 'testEmptyValues'.
      Open

              $this->assertSame('', \App\Purifier::encodeHtml(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.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 'testTextValues'.
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged(cached)');
      Severity: Minor
      Found in tests/App/Purifier.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 'testPurifyHtmlFailure'.
      Open

                  $purifyHtml = \App\Purifier::purifyHtml($text);
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              \App\User::setCurrentUserId(\App\User::getActiveAdminId());
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              \App\User::setCurrentUserId(\App\User::getActiveAdminId());
      Severity: Minor
      Found in tests/App/Purifier.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 'testEmptyValues'.
      Open

              $this->assertSame('', \App\Purifier::decodeHtml(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.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 'testTextValues'.
      Open

              $this->assertNull(\App\Purifier::purifyHtmlEventAttributes('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.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 'testPurifyHtmlSuccess'.
      Open

              $this->assertSame($expected, \App\Purifier::purifyHtml($text), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              $userRecordModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              $userModel = \App\User::getCurrentUserModel();
      Severity: Minor
      Found in tests/App/Purifier.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 'testEmptyValues'.
      Open

              $this->assertSame('', \App\Purifier::purifySql(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.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 'testTextValues'.
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purifyHtml('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.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 'testPurifyByType'.
      Open

              $this->{$assertion}($expected, \App\Purifier::purifyByType($text, $type), $message);
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              $userRecordModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Minor
      Found in tests/App/Purifier.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\DateTime' in method 'setUpBeforeClass'.
      Open

              date_default_timezone_set(\App\Fields\DateTime::getTimeZone());
      Severity: Minor
      Found in tests/App/Purifier.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 'testEmptyValues'.
      Open

              $this->assertSame('', \App\Purifier::purify(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              $userModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Minor
      Found in tests/App/Purifier.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 'testTextValues'.
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.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 'purifyHtmlProviderFailure'.
      Open

              $file = \App\Fields\File::loadFromUrl('https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM-Tests/main/xss-payload.txt');
      Severity: Minor
      Found in tests/App/Purifier.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 'testEmptyValues'.
      Open

                  $this->assertSame('', \App\Purifier::purifySql('', false), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              self::$separatorGrouping = $userModel->getDetail('currency_grouping_separator');
      Severity: Critical
      Found in tests/App/Purifier.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 "Sample number should be purified" 5 times.
      Open

                  ['Digits', 'NotSame', '43453C53', '43453C53', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Critical
      Found in tests/App/Purifier.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 "currency_grouping_pattern" 3 times.
      Open

              self::$patternGrouping = $userModel->getDetail('currency_grouping_pattern');
      Severity: Critical
      Found in tests/App/Purifier.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 "Test-text-string-for-purifier" 10 times.
      Open

                  ['Standard', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample text should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.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 "NotSame" 16 times.
      Open

                  ['Standard', 'NotSame', 'Test-text-string-for-purifier%$54#T$#BR', 'Test-text-string-for-purifier%$54#T$#BR', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Critical
      Found in tests/App/Purifier.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 "no_of_currency_decimals" 3 times.
      Open

              self::$decimalNum = $userModel->getDetail('no_of_currency_decimals');
      Severity: Critical
      Found in tests/App/Purifier.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 "Sample number should be unchanged" 5 times.
      Open

                  ['Digits', 'Same', '43453453', '43453453', 'Sample number should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.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 "MailId" 3 times.
      Open

                  ['MailId', 'Same',  '5FB2B5EF@xx.cc.it> (added by postmaster@cc.it)', '<5FB2B5EF@xx.cc.it> (added by postmaster@cc.it)', 'Sample text should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.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 "currency_symbol_placement" 3 times.
      Open

              self::$symbolPlacement = $userModel->getDetail('currency_symbol_placement');
      Severity: Critical
      Found in tests/App/Purifier.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 "Sample text should be unchanged" 17 times.
      Open

                  ['Standard', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample text should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.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 "Empty text should be unchanged" 6 times.
      Open

              $this->assertSame('', \App\Purifier::purify(''), 'Empty text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.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 "hour_format" 3 times.
      Open

              self::$hourFormat = $userModel->getDetail('hour_format');
      Severity: Critical
      Found in tests/App/Purifier.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 "time_zone" 3 times.
      Open

              self::$userTimeZone = $userModel->getDetail('time_zone');
      Severity: Critical
      Found in tests/App/Purifier.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 "Standard" 3 times.
      Open

                  ['Standard', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample text should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.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 "Test text string for purifier" 11 times.
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.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 "truncate_trailing_zeros" 3 times.
      Open

              self::$truncateTrailingZeros = $userModel->getDetail('truncate_trailing_zeros');
      Severity: Critical
      Found in tests/App/Purifier.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 "Sample text should be purified" 8 times.
      Open

                  ['Standard', 'NotSame', 'Test-text-string-for-purifier%$54#T$#BR', 'Test-text-string-for-purifier%$54#T$#BR', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Critical
      Found in tests/App/Purifier.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 "Test_text_alnum_4_purifier%$54#T$#BR-" 4 times.
      Open

                  ['Alnum', 'NotSame', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Critical
      Found in tests/App/Purifier.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 "+1 day" 4 times.
      Open

                  ['DateRangeUserFormat', 'Same', [date('Y-m-d'), date('Y-m-d', strtotime('+1 day'))], date('Y-m-d') . ',' . date('Y-m-d', strtotime('+1 day')), 'Sample text should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.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 "currency_decimal_separator" 3 times.
      Open

              self::$separatorDecimal = $userModel->getDetail('currency_decimal_separator');
      Severity: Critical
      Found in tests/App/Purifier.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 "ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) <svg/onabort=alert(3)// <svg onfocus='alert(2)//"' times.></svg>
      Open

                  ['Text', 'NotSame', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Critical
      Found in tests/App/Purifier.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 "Y.m.d" 6 times.
      Open

                  ['DateInUserFormat', 'NotSame', date('Y.m.d'), date('Y.m.d'), 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Critical
      Found in tests/App/Purifier.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 "Test_text_alnum_4_purifier" 4 times.
      Open

                  ['Alnum', 'Same', 'Test_text_alnum_4_purifier', 'Test_text_alnum_4_purifier', 'Sample text should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.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 "Y-m-d" 8 times.
      Open

                  ['DateInUserFormat', 'Same', date('Y-m-d'), date('Y-m-d'), 'Sample text should be unchanged', null],
      Severity: Critical
      Found in tests/App/Purifier.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

              \App\User::setCurrentUserId(\App\User::getActiveAdminId());
      Severity: Critical
      Found in tests/App/Purifier.php by phan

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

              $userModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Static call to undeclared method \Tests\Base::tearDownAfterClass
      Open

              parent::tearDownAfterClass();
      Severity: Critical
      Found in tests/App/Purifier.php by phan

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

              $userRecordModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

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

              \App\User::setCurrentUserId(\App\User::getActiveAdminId());
      Severity: Critical
      Found in tests/App/Purifier.php by phan

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

              $userModel = \App\User::getCurrentUserModel();
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('', \App\Purifier::purify(''), 'Empty text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('', \App\Purifier::purifyHtml(''), 'Empty text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('', \App\Purifier::purifySql(''), 'Empty text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertNull
      Open

              $this->assertNull(\App\Purifier::purifyHtmlEventAttributes(''), 'Empty text should not throw exception');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame(['Test text string for purifier', 'Test text string for purifier'], \App\Purifier::purify(['Test text string for purifier', 'Test text string for purifier']), 'Sample text should be unchanged(array)');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

                  $this->assertSame('', \App\Purifier::purifySql('', false), 'Empty text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::expectException
      Open

              $this->expectException(\App\Exceptions\IllegalValue::class);
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged(cached)');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Argument 1 (input) is array{0:'Test text string for purifier',1:'Test text string for purifier'} but \App\Purifier::purify() takes string defined at /code/app/Purifier.php:122
      Open

              $this->assertSame(['Test text string for purifier', 'Test text string for purifier'], \App\Purifier::purify(['Test text string for purifier', 'Test text string for purifier']), 'Sample text should be unchanged(array)');
      Severity: Minor
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purifyHtml('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::expectException
      Open

                  $this->expectException($exception);
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('', \App\Purifier::encodeHtml(''), 'Empty text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertNull
      Open

              $this->assertNull(\App\Purifier::purifyHtmlEventAttributes('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::expectException
      Open

              $this->expectException(\App\Exceptions\IllegalValue::class);
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame($expected, \App\Purifier::purifyHtml($text), 'Sample text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

      Call to undeclared method \Tests\App\Purifier::assertSame
      Open

              $this->assertSame('', \App\Purifier::decodeHtml(''), 'Empty text should be unchanged');
      Severity: Critical
      Found in tests/App/Purifier.php by phan

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

          public static $truncateTrailingZeros;
      Severity: Minor
      Found in tests/App/Purifier.php by phpmd

      LongVariable

      Since: 0.2

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

      Example

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

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

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

              \App\User::setCurrentUserId(\App\User::getActiveAdminId());
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('currency_decimal_separator', '.');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var int Decimal places count
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var string Timezone.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('currency_decimal_separator', self::$separatorDecimal);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('time_zone', self::$userTimeZone);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var string Decimal numbers separator
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * Setting of tests.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$patternGrouping = $userModel->getDetail('currency_grouping_pattern');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var string Numbers grouping pattern
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $timeZone;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$separatorDecimal = $userModel->getDetail('currency_decimal_separator');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$userTimeZone = $userModel->getDetail('time_zone');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->save();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('currency_grouping_pattern', self::$patternGrouping);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('hour_format', '24');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static function tearDownAfterClass(): void
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('currency_symbol_placement', self::$symbolPlacement);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              parent::tearDownAfterClass();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var bool Truncate zeros in decimal numbers
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$symbolPlacement = $userModel->getDetail('currency_symbol_placement');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('truncate_trailing_zeros', self::$truncateTrailingZeros);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Bool', 'NotSame', 'Test-text', 'Test-text', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 150 characters
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame(['Test text string for purifier', 'Test text string for purifier'], \App\Purifier::purify(['Test text string for purifier', 'Test text string for purifier']), 'Sample text should be unchanged(array)');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $separatorDecimal;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $separatorGrouping;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $decimalNum;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel = \App\User::getCurrentUserModel();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var string Numbers grouping separator
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->save();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Standard', 'NotSame', 'Test-text-string-for-purifier%$54#T$#BR', 'Test-text-string-for-purifier%$54#T$#BR', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $patternGrouping;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['DateInUserFormat', 'NotSame', date('Y.m.d'), date('Y.m.d'), 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['date', 'Same', date('Y-m-d'), date('Y-m-d'), 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 131 characters
      Open

                  ['date', 'NotSame', '201X-07-26', '201X-07-26', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var User string Timezone.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 129 characters
      Open

                  ['Bool', 'NotSame', 'Test-text', 'Test-text', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('currency_grouping_separator', ' ');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * Testing purify empty values.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('currency_grouping_pattern', '123456789');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param mixed       $expected
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('no_of_currency_decimals', '2');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @return array
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 217 characters
      Open

                  ['Standard', 'Same', ['Test-text-string-for-purifier', 'Test-text-string-for-purifier'], ['Test-text-string-for-purifier', 'Test-text-string-for-purifier'], 'Sample text should be unchanged(array)', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function purifyHtmlProviderFailure(): array
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @dataProvider purifyHtmlProviderFailure
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 137 characters
      Open

                  ['NumberInUserFormat', 'Same', 1234567890.0, '1234567890', 'Sample text should be unchanged and converted to decimal', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Color', 'Same', '#3A13F5', '#3A13F5', 'Sample number should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['MailId', 'Same',  'CAK01GN-UtTiM90_wQNB07OnE6aBm=w@mail.g.c', '<CAK01GN-UtTiM90_wQNB07OnE6aBm=w@mail.g.c>', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $hourFormat;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel = \Vtiger_Record_Model::getInstanceById(\App\User::getCurrentUserId(), 'Users');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * Restore current user preferences.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('no_of_currency_decimals', self::$decimalNum);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['TimeInUserFormat', 'Same', date('H:i'), date('H:i'), 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$timeZone = date_default_timezone_get();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @throws \Exception
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('hour_format', self::$hourFormat);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              return [
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 186 characters
      Open

                  ['Alnum', 'NotSame', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Color', 'NotSame', '#3A13FZ', '#3A13FZ', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  [\App\Purifier::PATH, 'NotSame', '../Test', '../Test', 'Path should be discarded', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function testTextValues()
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  $this->expectException($exception);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var string Currency symbol placement
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $symbolPlacement;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('currency_symbol_placement', '1.0$');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Integer', 'Same', 1234, 1234, 'Sample integer should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 349 characters
      Open

                  ['Text', 'NotSame', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 163 characters
      Open

                  ['MailId', 'Same',  'CAK01GN-UtTiM90_wQNB07OnE6aBm=w@mail.g.c', '<CAK01GN-UtTiM90_wQNB07OnE6aBm=w@mail.g.c>', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->disableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->disableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 154 characters
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purifyHtml('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $fileRows = explode("\n", $file->getContents());
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              foreach ($fileRows as $row) {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['ę€ółśążźćń23{}":?>><>?:"{}+_)', 'ę€ółśążźćń23{}":?&gt;&gt;&lt;&gt;?:"{}+_)', true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @var string Hour format.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('time_zone', \App\Fields\DateTime::getTimeZone());
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              date_default_timezone_set(\App\Fields\DateTime::getTimeZone());
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function dataProviderByType()
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Standard', 'Same', ['Test-text-string-for-purifier', 'Test-text-string-for-purifier'], ['Test-text-string-for-purifier', 'Test-text-string-for-purifier'], 'Sample text should be unchanged(array)', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Alnum', 'Same', 'Test_text_alnum_4_purifier', 'Test_text_alnum_4_purifier', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Alnum', 'NotSame', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  [2, 'NotSame', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 180 characters
      Open

                  [2, 'NotSame', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Test_text_alnum_4_purifier%$54#T$#BR-', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['DateRangeUserFormat', 'Same', [date('Y-m-d'), date('Y-m-d', strtotime('+1 day'))], date('Y-m-d') . ',' . date('Y-m-d', strtotime('+1 day')), 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['time', 'NotSame', '24:12:20', '24:12:20', 'Sample text should be unchanged', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 145 characters
      Open

                  ['NumberInUserFormat', 'NotSame', '12345X7890', '12345X7890', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Digits', 'Same', '43453453', '43453453', 'Sample number should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Year', 'NotSame', '201X', '201X', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 352 characters
      Open

                  ['Default', 'NotSame', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 132 characters
      Open

                  [\App\Purifier::PATH, 'NotSame', '../Test', '../Test', 'Path should be discarded', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param mixed       $assertion
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param string      $message
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              if ($exception) {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  if ($row) {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              } catch (\Throwable $th) {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function purifyHtmlProviderSuccess(): array
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['<div>Test-text-string-for-purifier</div>', '<div>Test-text-string-for-purifier</div>', true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 143 characters
      Open

                  ['ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!)', 'ę€ółśążźćń23{}":?&gt;&gt;&lt;&gt;?:"{}+_)(*&amp;^%$#@!)', true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 149 characters
      Open

                  [file_get_contents(ROOT_DIRECTORY . '/tests/data/phpFile1.html'), file_get_contents(ROOT_DIRECTORY . '/tests/data/phpFile2.html'), true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 121 characters
      Open

                  ['Year', 'NotSame', '201X', '201X', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Text', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample number should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Text', 'NotSame', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Default', 'NotSame', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!) &lt;svg/onabort=alert(3)//  <svg/onload=alert(1) onfocus=alert(2)//', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->expectException(\App\Exceptions\IllegalValue::class);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('Test text string for purifier', \App\Purifier::purifyHtml('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                      throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['<p><yetiforce type="Documents" crm-id="70521" attachment-id="22855"></yetiforce></p>', '<p><yetiforce type="Documents" crm-id="70521" attachment-id="22855"></yetiforce></p>', true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$decimalNum = $userModel->getDetail('no_of_currency_decimals');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * Provide data for purifyByType test cases.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['DateInUserFormat', 'Same', date('Y-m-d'), date('Y-m-d'), 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 196 characters
      Open

                  ['DateRangeUserFormat', 'Same', [date('Y-m-d'), date('Y-m-d', strtotime('+1 day'))], date('Y-m-d') . ',' . date('Y-m-d', strtotime('+1 day')), 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['NumberInUserFormat', 'NotSame', '12345X7890', '12345X7890', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              ];
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              try {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * Testing purify text values.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function testPurifyHtmlFailure(string $text): void
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @codeCoverageIgnore
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              return [
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  [file_get_contents(ROOT_DIRECTORY . '/tests/data/phpFile1.html'), file_get_contents(ROOT_DIRECTORY . '/tests/data/phpFile2.html'), true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param string $text
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @codeCoverageIgnore
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$truncateTrailingZeros = $userModel->getDetail('truncate_trailing_zeros');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @codeCoverageIgnore
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              // $type, $assertion, $expected, $text, $message, $exception
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Standard', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Integer', 'NotSame', '12X4', '12X4', 'Sample integer should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 131 characters
      Open

                  ['Digits', 'NotSame', '43453C53', '43453C53', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['MailId', 'Same',  '5FB2B5EF@xx.cc.it> (added by postmaster@cc.it)', '<5FB2B5EF@xx.cc.it> (added by postmaster@cc.it)', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 167 characters
      Open

                  ['MailId', 'Same',  '30.123.12.JavaMail."admin.azure"@A-PROXY01', '<30.123.12.JavaMail."admin.azure"@A-PROXY01>', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              } catch (\Throwable $th) {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $file = \App\Fields\File::loadFromUrl('https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM-Tests/main/xss-payload.txt');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                      $rows[] = [$row];
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$hourFormat = $userModel->getDetail('hour_format');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              date_default_timezone_set(self::$timeZone);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['DateRangeUserFormat', 'NotSame', date('Y.m.d') . ',' . date('Y.m.d', strtotime('+1 day')), date('Y.m.d') . ',' . date('Y.m.d', strtotime('+1 day')), 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 128 characters
      Open

                  ['time', 'NotSame', '24:12:20', '24:12:20', 'Sample text should be unchanged', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 128 characters
      Open

                  ['Color', 'NotSame', '#3A13FZ', '#3A13FZ', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Year', 'Same', date('Y'), date('Y'), 'Sample number should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('', \App\Purifier::purify(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('', \App\Purifier::encodeHtml(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 136 characters
      Open

              $this->assertNull(\App\Purifier::purifyHtmlEventAttributes('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @dataProvider dataProviderByType
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param mixed       $text
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $truncateTrailingZeros;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static $userTimeZone;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public static function setUpBeforeClass(): void
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              self::$separatorGrouping = $userModel->getDetail('currency_grouping_separator');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userRecordModel->set('truncate_trailing_zeros', 1);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $userModel->set('currency_grouping_separator', self::$separatorGrouping);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @return array
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['time', 'Same', date('H:i:s'), date('H:i:s'), 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              return $rows;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * Testing html purifier failure.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->disableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @return array
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 140 characters
      Open

                  ['Standard', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 145 characters
      Open

                  ['DateInUserFormat', 'NotSame', date('Y.m.d'), date('Y.m.d'), 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['NumberInUserFormat', 'Same', 1234567890.0, '1234567890', 'Sample text should be unchanged and converted to decimal', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                  ['Integer', 'NotSame', '12X4', '12X4', 'Sample integer should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertNull(\App\Purifier::purifyHtmlEventAttributes(''), 'Empty text should not throw exception');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('', \App\Purifier::purifySql(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param string|null $exception
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->disableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @codeCoverageIgnore
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  $this->enableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @dataProvider purifyHtmlProviderSuccess
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  $this->enableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  throw $th;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->enableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  [2, 'Same', 'Test_text_alnum_4_purifier', 'Test_text_alnum_4_purifier', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Bool', 'Same', true, true, 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['MailId', 'Same',  '30.123.12.JavaMail."admin.azure"@A-PROXY01', '<30.123.12.JavaMail."admin.azure"@A-PROXY01>', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function testEmptyValues()
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged(cached)');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $rows = [];
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 140 characters
      Open

              $file = \App\Fields\File::loadFromUrl('https://raw.githubusercontent.com/YetiForceCompany/YetiForceCRM-Tests/main/xss-payload.txt');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['ę€ółśążźćń23{}":?>><>?:"{}+_)(*&^%$#@!)', 'ę€ółśążźćń23{}":?&gt;&gt;&lt;&gt;?:"{}+_)(*&amp;^%$#@!)', true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->expectException(\App\Exceptions\IllegalValue::class);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  if ($purifyHtml !== $text) {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 131 characters
      Open

                  ['Alnum', 'Same', 'Test_text_alnum_4_purifier', 'Test_text_alnum_4_purifier', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Digits', 'NotSame', '43453C53', '43453C53', 'Sample number should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 174 characters
      Open

                  ['MailId', 'Same',  '5FB2B5EF@xx.cc.it> (added by postmaster@cc.it)', '<5FB2B5EF@xx.cc.it> (added by postmaster@cc.it)', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertNull(\App\Purifier::purifyHtmlEventAttributes('Test text string for purifier'), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 195 characters
      Open

                  ['<p><yetiforce type="Documents" crm-id="70521" attachment-id="22855"></yetiforce></p>', '<p><yetiforce type="Documents" crm-id="70521" attachment-id="22855"></yetiforce></p>', true],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              ];
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 193 characters
      Open

                  ['Standard', 'NotSame', 'Test-text-string-for-purifier%$54#T$#BR', 'Test-text-string-for-purifier%$54#T$#BR', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['date', 'NotSame', '201X-07-26', '201X-07-26', 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  ['Default', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample number should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 141 characters
      Open

                  ['Default', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample number should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  [\App\Purifier::PATH, 'Same', '/Test/test', '/Test/test', 'Path should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('', \App\Purifier::purifyHtml(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame('', \App\Purifier::decodeHtml(''), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  $this->assertSame('', \App\Purifier::purifySql('', false), 'Empty text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 227 characters
      Open

              $this->assertSame(['Test text string for purifier', 'Test text string for purifier'], \App\Purifier::purify(['Test text string for purifier', 'Test text string for purifier']), 'Sample text should be unchanged(array)');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function testPurifyByType($type, $assertion, $expected, $text, string $message, ?string $exception): void
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              try {
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  $purifyHtml = \App\Purifier::purifyHtml($text);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                  [2, 'Same', 'Test_text_alnum_4_purifier', 'Test_text_alnum_4_purifier', 'Sample text should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 234 characters
      Open

                  ['DateRangeUserFormat', 'NotSame', date('Y.m.d') . ',' . date('Y.m.d', strtotime('+1 day')), date('Y.m.d') . ',' . date('Y.m.d', strtotime('+1 day')), 'Sample text should be purified', \App\Exceptions\IllegalValue::class],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 138 characters
      Open

                  ['Text', 'Same', 'Test-text-string-for-purifier', 'Test-text-string-for-purifier', 'Sample number should be unchanged', null],
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      Line exceeds 120 characters; contains 158 characters
      Open

              $this->assertSame('Test text string for purifier', \App\Purifier::purify('Test text string for purifier'), 'Sample text should be unchanged(cached)');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param mixed       $type
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->enableLogs();
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param string $text
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $assertion = 'assert' . $assertion;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->{$assertion}($expected, \App\Purifier::purifyByType($text, $type), $message);
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  throw $th;
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * @param string $expected
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

          public function testPurifyHtmlSuccess(string $text, string $expected): void
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

              $this->assertSame($expected, \App\Purifier::purifyHtml($text), 'Sample text should be unchanged');
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

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

           * Testing html purifier success.
      Severity: Minor
      Found in tests/App/Purifier.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status