YetiForceCompany/YetiForceCRM

View on GitHub
app/Utils/Benchmarks.php

Summary

Maintainability
F
3 days
Test Coverage
A
97%

Method db has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function db(): array
    {
        $benchmarkCountGroup = 20;
        $insertCountGroup = 5;
        $updateCountGroup = 5;
Severity: Major
Found in app/Utils/Benchmarks.php - About 4 hrs to fix

    Function hardDrive has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function hardDrive(): array
        {
            $countGroup = 50;
            $maxTime = 0.2;
            $read = $write = [];
    Severity: Minor
    Found in app/Utils/Benchmarks.php - About 4 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function db has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function db(): array
        {
            $benchmarkCountGroup = 20;
            $insertCountGroup = 5;
            $updateCountGroup = 5;
    Severity: Minor
    Found in app/Utils/Benchmarks.php - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    File Benchmarks.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Benchmarks file.
     *
    Severity: Minor
    Found in app/Utils/Benchmarks.php - About 3 hrs to fix

      Function cpu has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          private static function cpu(): array
          {
              $mathFunctions = self::$mathFunctions;
              $mathCountGroup = 5000;
              $mathMaxTime = 0.3;
      Severity: Minor
      Found in app/Utils/Benchmarks.php - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method cpu has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function cpu(): array
          {
              $mathFunctions = self::$mathFunctions;
              $mathCountGroup = 5000;
              $mathMaxTime = 0.3;
      Severity: Major
      Found in app/Utils/Benchmarks.php - About 2 hrs to fix

        Method hardDrive has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function hardDrive(): array
            {
                $countGroup = 50;
                $maxTime = 0.2;
                $read = $write = [];
        Severity: Major
        Found in app/Utils/Benchmarks.php - About 2 hrs to fix

          Method ram has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static function ram(): array
              {
                  $mathCountGroup = 1000;
                  $writeTime = $readTime = $readOperations = $writeOperations = 0;
                  for ($i = 0; $i < 5; ++$i) {
          Severity: Minor
          Found in app/Utils/Benchmarks.php - About 1 hr to fix

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

                private static function ram(): array
                {
                    $mathCountGroup = 1000;
                    $writeTime = $readTime = $readOperations = $writeOperations = 0;
                    for ($i = 0; $i < 5; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php - About 1 hr to fix

            Cognitive Complexity

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

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

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

            Further reading

            The method db() has 120 lines of code. Current threshold is set to 100. Avoid really long methods.
            Open

                private static function db(): array
                {
                    $benchmarkCountGroup = 20;
                    $insertCountGroup = 5;
                    $updateCountGroup = 5;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            The method db() has an NPath complexity of 1152. The configured NPath complexity threshold is 200.
            Open

                private static function db(): array
                {
                    $benchmarkCountGroup = 20;
                    $insertCountGroup = 5;
                    $updateCountGroup = 5;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            NPathComplexity

            Since: 0.1

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

            Example

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

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

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

                private static function hardDrive(): array
                {
                    $countGroup = 50;
                    $maxTime = 0.2;
                    $read = $write = [];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            CyclomaticComplexity

            Since: 0.1

            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

            Example

            // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

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

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

                private static function cpu(): array
                {
                    $mathFunctions = self::$mathFunctions;
                    $mathCountGroup = 5000;
                    $mathMaxTime = 0.3;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            CyclomaticComplexity

            Since: 0.1

            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

            Example

            // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

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

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

                private static function db(): array
                {
                    $benchmarkCountGroup = 20;
                    $insertCountGroup = 5;
                    $updateCountGroup = 5;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            CyclomaticComplexity

            Since: 0.1

            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

            Example

            // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

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

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

                private static function hardDrive(): array
            Severity: Critical
            Found in app/Utils/Benchmarks.php by sonar-php

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

            See

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

                private static function cpu(): array
            Severity: Critical
            Found in app/Utils/Benchmarks.php by sonar-php

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

            See

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

                private static function db(): array
            Severity: Critical
            Found in app/Utils/Benchmarks.php by sonar-php

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

            See

            Missing class import via use statement (line '277', column '39').
            Open

                            (new \App\Db\Query())->select(new \yii\db\Expression('sql_no_cache *'))->from('benchmark_temp_table')->where(['id' => $lastId])->all();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            MissingImport

            Since: 2.7.0

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

            Example

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

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

            Missing class import via use statement (line '180', column '18').
            Open

                            foreach (new \DirectoryIterator($dirGroup) as $itemGroup) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            MissingImport

            Since: 2.7.0

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

            Example

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

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

            Missing class import via use statement (line '277', column '10').
            Open

                            (new \App\Db\Query())->select(new \yii\db\Expression('sql_no_cache *'))->from('benchmark_temp_table')->where(['id' => $lastId])->all();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            MissingImport

            Since: 2.7.0

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

            Example

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

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

            Missing class import via use statement (line '182', column '20').
            Open

                                    foreach (new \DirectoryIterator($itemGroup->getPathname()) as $item) {
            Severity: Minor
            Found in app/Utils/Benchmarks.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\Log' in method 'hardDrive'.
            Open

                            \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\App\Db' in method 'db'.
            Open

                    $db = \App\Db::getInstance();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\vtlib\Functions' in method 'hardDrive'.
            Open

                            \vtlib\Functions::recurseDelete('cache/speed');
            Severity: Minor
            Found in app/Utils/Benchmarks.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 "crmid" 3 times.
            Open

                            'crmid' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 10),
            Severity: Critical
            Found in app/Utils/Benchmarks.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 "benchmark_temp_table" 7 times.
            Open

                    if (!$db->getTableSchema('benchmark_temp_table')) {
            Severity: Critical
            Found in app/Utils/Benchmarks.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 "profile" 7 times.
            Open

                            'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.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 "operations" 12 times.
            Open

                            'operations' => $mathOperations,
            Severity: Critical
            Found in app/Utils/Benchmarks.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 "string" 4 times.
            Open

                        'string' => [
            Severity: Critical
            Found in app/Utils/Benchmarks.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 "SHOW PROFILE" 7 times.
            Open

                            'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.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.

            Unused array offset fetch
            Open

                                $test[$j];
            Severity: Info
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::getSchema
            Open

                    $schema = $db->getSchema();
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                            'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                    $dbCommand = $db->createCommand();
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::getTableSchema
            Open

                    if (!$db->getTableSchema('benchmark_temp_table')) {
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                            $db->createCommand('SELECT BENCHMARK(1000,1+1);')->execute();
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to method error from undeclared class \App\Log
            Open

                            \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Reference to constant TYPE_STRING from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
            Open

                            'string' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_STRING, 200),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Reference to constant TYPE_TIMESTAMP from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
            Open

                            'date' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TIMESTAMP)->null(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

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

                            (new \App\Db\Query())->select(new \yii\db\Expression('sql_no_cache *'))->from('benchmark_temp_table')->where(['id' => $lastId])->all();
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                    $db->createCommand('set profiling=0;')->execute();
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to undeclared method \App\Db::createCommand
            Open

                    $db->createCommand('set profiling=1;')->execute();
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Reference to constant TYPE_UPK from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
            Open

                            'id' => \yii\db\Schema::TYPE_UPK,
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Reference to constant TYPE_INTEGER from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
            Open

                            'crmid' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 10),
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Call to method __construct from undeclared class \yii\db\Expression
            Open

                            (new \App\Db\Query())->select(new \yii\db\Expression('sql_no_cache *'))->from('benchmark_temp_table')->where(['id' => $lastId])->all();
            Severity: Critical
            Found in app/Utils/Benchmarks.php by phan

            Avoid using short method names like Benchmarks::db(). The configured minimum method name length is 3.
            Open

                private static function db(): array
                {
                    $benchmarkCountGroup = 20;
                    $insertCountGroup = 5;
                    $updateCountGroup = 5;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            ShortMethodName

            Since: 0.2

            Detects when very short method names are used.

            Example

            class ShortMethod {
                public function a( $index ) { // Violation
                }
            }

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

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

                            $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            ShortVariable

            Since: 0.2

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

            Example

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

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

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

                        $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            ShortVariable

            Since: 0.2

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

            Example

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

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

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

                    $j = 1;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            ShortVariable

            Since: 0.2

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

            Example

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

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

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

                        $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            ShortVariable

            Since: 0.2

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

            Example

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

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

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

                    $db = \App\Db::getInstance();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpmd

            ShortVariable

            Since: 0.2

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

            Example

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

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

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

                /**
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

            Line exceeds 120 characters; contains 128 characters
            Open

                public static $mathFunctions = ['abs', 'acos', 'asin', 'atan', 'floor', 'exp', 'sin', 'tan', 'is_finite', 'is_nan', 'sqrt'];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 */
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

            Line exceeds 120 characters; contains 208 characters
            Open

                public static $stringFunctions = ['addslashes', 'chunk_split', 'metaphone', 'strip_tags', 'strtoupper', 'strtolower', 'strrev', 'strlen', 'soundex', 'ord', 'ucfirst', 'ucwords', 'rtrim', 'trim', 'ltrim'];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                private static function cpu(): array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $hashAlgo = self::$hashAlgo;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            foreach ($hashAlgo as $algo) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $mathCountGroup = 1000;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        while ((microtime(true) - $timeStart) < $maxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                            $fileContent = file_get_contents($item->getPathname());
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $mathCountGroup = 5000;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $mathMaxTime = 0.3;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = $t; $i < $hashCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * RAM benchmark.
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $test = [];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                private static function hardDrive(): array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 *
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'time' => (int) ($mathOperations / $mathTime),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            for ($j = $t; $j < $mathCountGroup; ++$j) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $t += $mathCountGroup;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $fileContent = str_repeat('12345', $value);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            for ($i = 0; $i < $countGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                /** @var string[] Math functions list */
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                private static function ram(): array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $readTime += (microtime(true) - $timeStart);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'time' => (int) ($writeOperations / $writeTime),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $dirGroup = $dir . $key . \DIRECTORY_SEPARATOR . $t . \DIRECTORY_SEPARATOR;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    foreach ([1, 10, 100] as $value) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * CPU benchmark.
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * @return array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $stringMaxTime = 0.3;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $t += $mathCountGroup;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    return [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'string' => [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'operations' => $writeOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                /**
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = 0; $i < 4; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $t += $mathCountGroup;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                $function("$i - $i | $i");
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'time' => (int) ($readOperations / $readTime),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $t += $countGroup;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                public static $stringFunctions = ['addslashes', 'chunk_split', 'metaphone', 'strip_tags', 'strtoupper', 'strtolower', 'strrev', 'strlen', 'soundex', 'ord', 'ucfirst', 'ucwords', 'rtrim', 'trim', 'ltrim'];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $mathFunctions = self::$mathFunctions;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $stringFunctions = self::$stringFunctions;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $stringOperations = $hashOperations = $mathOperations = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = $t; $i < $stringCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ],
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                /**
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            for ($j = 0; $j < $mathCountGroup; ++$j) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'write' => [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 *
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'operations' => $writeOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $dirGroup = $dir . $value . \DIRECTORY_SEPARATOR;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                /** @var string[] Hash functions list */
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                ++$mathOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                ++$hashOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                $test[] = [[[$j]]];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                $test[$j];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $write[$key] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                public static $hashAlgo = ['md4', 'md5', 'crc32', 'sha1', 'adler32', 'ripemd256', 'sha256', 'sha384', 'sha512'];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                /** @var string[] String functions list */
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $hashCountGroup = 1000;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $hashMaxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                ++$stringOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $writeTime = $readTime = $readOperations = $writeOperations = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        while ((microtime(true) - $timeStart) < 0.05) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ],
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ],
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $hashTime = microtime(true) - $timeStart;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            foreach ($stringFunctions as $function) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    for ($i = 0; $i < 5; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                ++$writeOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $countGroup = 50;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $dir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'cache' . \DIRECTORY_SEPARATOR . 'speed' . \DIRECTORY_SEPARATOR;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'time' => (int) ($readOperations / (microtime(true) - $timeStart)),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                /**
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $return['benchmark'] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $return['insert'] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                'string' => $string,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                $lastId = $insertOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * RAM benchmark.
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $schema = $db->getSchema();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'date' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TIMESTAMP)->null(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ]);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $maxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                'date' => date('Y-m-d H:i:s'),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                'string' => $string,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                'date' => date('Y-m-d H:i:s'),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    return [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $deleteCountGroup = 5;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $deleteOperations = $selectOperations = $updateOperations = $insertOperations = $benchmarkOperations = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $db->createCommand('SELECT BENCHMARK(1000,1+1);')->execute();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'operations' => $benchmarkOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            ++$insertOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $maxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            ++$selectOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $maxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            ++$deleteOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $return['delete'] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'operations' => $deleteOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    return [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'read' => $read,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $selectCountGroup = 10;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $db->createTable('benchmark_temp_table', [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            ])->execute();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'operations' => $selectOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'time' => (int) ($updateOperations / (microtime(true) - $timeStart)),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $dbCommand->delete('benchmark_temp_table', ['crmid' => $lastId])->execute();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $dbCommand->dropTable('benchmark_temp_table')->execute();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'db' => self::db(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            \vtlib\Functions::recurseDelete('cache/speed');
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $benchmarkCountGroup = 20;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'queryTime' => microtime(true) - $timeStart,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = 0; $i < $insertCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            if (0 === $lastId) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            if (0 === $lastId) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'time' => (int) ($deleteOperations / (microtime(true) - $timeStart)),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $dbCommand = $db->createCommand();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $benchmarkOperations += 1000;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            ++$j;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            if (0 === $lastId) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'time' => (int) ($selectOperations / (microtime(true) - $timeStart)),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = 0; $i < $updateCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                private static function db(): array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'string' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_STRING, 200),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $return['createTable'] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $return['select'] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'write' => $write,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * @return array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'operations' => $updateOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $return = [];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'crmid' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 10),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $maxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'ram' => self::ram(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $hashMaxTime = 0.3;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = 0; $i < $selectCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            (new \App\Db\Query())->select(new \yii\db\Expression('sql_no_cache *'))->from('benchmark_temp_table')->where(['id' => $lastId])->all();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = $t; $i < $mathCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                $lastId = $insertOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $dbCommand->update('benchmark_temp_table', [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'math' => [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    return $return;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'time' => (int) ($stringOperations / $stringTime),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ],
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $read = $write = [];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            if (!is_dir($dirGroup)) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                    foreach (new \DirectoryIterator($itemGroup->getPathname()) as $item) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $updateCountGroup = 5;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                $lastId = $insertOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $return['dropTable'] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'cpu' => self::cpu(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                $function($i);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $insertCountGroup = 5;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'hash' => [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'id' => \yii\db\Schema::TYPE_UPK,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'time' => (int) ($benchmarkOperations / (microtime(true) - $timeStart)),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ],
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'operations' => $insertOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                ++$writeOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            --$lastId;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'time' => (int) ($writeOperations / (microtime(true) - $timeStart)),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            ], ['id' => $lastId])->execute();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $readOperations = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $db->createCommand('set profiling=1;')->execute();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $db->createCommand('set profiling=0;')->execute();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'query' => "SELECT BENCHMARK({$benchmarkOperations},1+1);",
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $j = 1;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'time' => (int) ($insertOperations / (microtime(true) - $timeStart)),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $maxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            ++$updateOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            --$lastId;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 */
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $maxTime = 0.2;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            $dbCommand->insert('benchmark_temp_table', [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $lastId = $insertOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            --$lastId;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $stringMaxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 */
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 */
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    foreach ([1 => 207, 10 => 2050, 100 => 20500] as $key => $value) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                mkdir($dirGroup, 0755, true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        } catch (\Throwable $e) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $db = \App\Db::getInstance();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    if (!$db->getTableSchema('benchmark_temp_table')) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                'crmid' => $j,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $lastId = $insertOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                public static $mathFunctions = ['abs', 'acos', 'asin', 'atan', 'floor', 'exp', 'sin', 'tan', 'is_finite', 'is_nan', 'sqrt'];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $t = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            foreach ($mathFunctions as $function) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'operations' => $stringOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $stringCountGroup = 1000;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'read' => [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'operations' => $readOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                hash($algo, "$i - $i | $i");
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $maxTime = 0.2;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $t += $mathCountGroup;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                file_put_contents("{$dirGroup}{$i}.txt", $fileContent);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'operations' => $hashOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'time' => (int) ($hashOperations / $hashTime),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    register_shutdown_function(function () {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * @return array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 *
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    return [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * @return array
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

            Line exceeds 120 characters; contains 151 characters
            Open

                            (new \App\Db\Query())->select(new \yii\db\Expression('sql_no_cache *'))->from('benchmark_temp_table')->where(['id' => $lastId])->all();
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $lastId = $insertOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            foreach (new \DirectoryIterator($dirGroup) as $itemGroup) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                        if ($item->isFile()) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'operations' => $readOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        try {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    });
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $string = str_repeat('zxcvb', 20);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = 0; $i < $benchmarkCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                public static function all()
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'hardDrive' => self::hardDrive(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    while ((microtime(true) - $timeStart) < $mathMaxTime) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $mathTime = microtime(true) - $timeStart;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $stringTime = microtime(true) - $timeStart;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            'operations' => $mathOperations,
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 *
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            }
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $writeTime += (microtime(true) - $timeStart);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        while ((microtime(true) - $timeStart) < 0.05) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                ++$readOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                 * Hard drive benchmark.
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $writeOperations = 0;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                if (!$itemGroup->isDot() && $itemGroup->isDir()) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                                            ++$readOperations;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        $read[$value] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                            throw $e;
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    ];
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $timeStart = microtime(true);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $string = str_repeat('123', 20);
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                    $return['update'] = [
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        'profile' => $db->createCommand('SHOW PROFILE')->queryAll(),
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

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

                        for ($i = 0; $i < $deleteCountGroup; ++$i) {
            Severity: Minor
            Found in app/Utils/Benchmarks.php by phpcodesniffer

            There are no issues that match your filters.

            Category
            Status