YetiForceCompany/YetiForceCRM

View on GitHub
app/SystemWarnings/SystemRequirements/Configuration.php

Summary

Maintainability
C
1 day
Test Coverage
D
66%

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

    public function process(): void
    {
        \App\Utils\ConfReport::saveEnv();
        $this->status = 1;
        $errorsText = '<br>';
Severity: Minor
Found in app/SystemWarnings/SystemRequirements/Configuration.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

Method process has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(): void
    {
        \App\Utils\ConfReport::saveEnv();
        $this->status = 1;
        $errorsText = '<br>';
Severity: Major
Found in app/SystemWarnings/SystemRequirements/Configuration.php - About 2 hrs to fix

    The method process() has an NPath complexity of 2457. The configured NPath complexity threshold is 200.
    Open

        public function process(): void
        {
            \App\Utils\ConfReport::saveEnv();
            $this->status = 1;
            $errorsText = '<br>';

    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 process() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
    Open

        public function process(): void
        {
            \App\Utils\ConfReport::saveEnv();
            $this->status = 1;
            $errorsText = '<br>';

    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

        public function process(): void

    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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                        ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Utils\ConfReport' in method 'process'.
    Open

            $errorsStability = \App\Utils\ConfReport::getErrors('stability', true);

    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 '\yii\helpers\VarDumper' in method 'process'.
    Open

                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Utils\ConfReport' in method 'process'.
    Open

            $errorsLibraries = \App\Utils\ConfReport::getErrors('libraries', true);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                            $errorsText .= '<h4>' . \App\Language::translate('LBL_PHPEXT', 'Settings:SystemWarnings') . ':</h4>';

    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 '\yii\helpers\VarDumper' in method 'process'.
    Open

                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                            ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                        ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                        '<a target="_blank" rel="noreferrer noopener" href="https://doc.yetiforce.com/introduction/requirements/"><u>' . \App\Language::translate('LBL_CONFIG_DOC_URL_LABEL', 'Settings:SystemWarnings') . '</u></a>'

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                $errorsText .= '<h5>' . \App\Language::translate('LBL_DATABASE', 'Settings:SystemWarnings') . ':</h5><pre>';

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                    $errorsText .= '<h5>' . \App\Language::translate('LBL_PERFORMANCE', 'Settings:SystemWarnings') . ':</h5>';

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Utils\ConfReport' in method 'process'.
    Open

            \App\Utils\ConfReport::saveEnv();

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                            ($value['mandatory'] ? \App\Language::translate('LBL_LIB_REQUIRED', 'Settings:SystemWarnings') : \App\Language::translate('LBL_LIB_OPTIONAL', 'Settings:SystemWarnings')) .

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                $errorsText .= '<h5>' . \App\Language::translate('LBL_STABILITY', 'Settings:SystemWarnings') . ':</h5><pre>';

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Utils\ConfReport' in method 'process'.
    Open

            $errorsPerformance = \App\Utils\ConfReport::getErrors('performance', true);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Utils\ConfReport' in method 'process'.
    Open

            $errorsDatabase = \App\Utils\ConfReport::getErrors('database', true);

    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 '\yii\helpers\VarDumper' in method 'process'.
    Open

                        $performance .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                $this->description = \App\Language::translateArgs(
                        'LBL_CONFIG_SERVER_DESC',
                        'Settings:SystemWarnings',
                        '<a target="_blank" rel="noreferrer noopener" href="https://doc.yetiforce.com/introduction/requirements/"><u>' . \App\Language::translate('LBL_CONFIG_DOC_URL_LABEL', 'Settings:SystemWarnings') . '</u></a>'
                    ) . $errorsText;

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                            ($value['mandatory'] ? \App\Language::translate('LBL_LIB_REQUIRED', 'Settings:SystemWarnings') : \App\Language::translate('LBL_LIB_OPTIONAL', 'Settings:SystemWarnings')) .

    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\Security\AdminAccess' in method 'process'.
    Open

                if (\App\Security\AdminAccess::isPermitted('ConfReport')) {

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Language' in method 'process'.
    Open

                    $this->linkTitle = \App\Language::translate('LBL_CONFIG_REPORT_LINK', 'Settings:SystemWarnings');

    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 "recommended" 4 times.
    Open

                        ": '" . ($value['recommended'] ?? '') . "')";

    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 "Settings:SystemWarnings" 12 times.
    Open

                $errorsText .= '<h5>' . \App\Language::translate('LBL_STABILITY', 'Settings:SystemWarnings') . ':</h5><pre>';

    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 "LBL_RECOMMENDED_VALUE" 3 times.
    Open

                        ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Call to method getErrors from undeclared class \App\Utils\ConfReport (Did you mean class \Tests\Settings\ConfReport)
    Open

            $errorsStability = \App\Utils\ConfReport::getErrors('stability', true);

    Reference to undeclared property \App\SystemWarnings\SystemRequirements\Configuration->linkTitle
    Open

                    $this->linkTitle = \App\Language::translate('LBL_CONFIG_REPORT_LINK', 'Settings:SystemWarnings');

    Call to method dumpAsString from undeclared class \yii\helpers\VarDumper
    Open

                        $performance .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

    Call to method getErrors from undeclared class \App\Utils\ConfReport (Did you mean class \Tests\Settings\ConfReport)
    Open

            $errorsPerformance = \App\Utils\ConfReport::getErrors('performance', true);

    Call to method getErrors from undeclared class \App\Utils\ConfReport (Did you mean class \Tests\Settings\ConfReport)
    Open

            $errorsDatabase = \App\Utils\ConfReport::getErrors('database', true);

    Call to method getErrors from undeclared class \App\Utils\ConfReport (Did you mean class \Tests\Settings\ConfReport)
    Open

            $errorsLibraries = \App\Utils\ConfReport::getErrors('libraries', true);

    Call to method dumpAsString from undeclared class \yii\helpers\VarDumper
    Open

                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

    Call to method saveEnv from undeclared class \App\Utils\ConfReport (Did you mean class \Tests\Settings\ConfReport)
    Open

            \App\Utils\ConfReport::saveEnv();

    Call to method dumpAsString from undeclared class \yii\helpers\VarDumper
    Open

                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

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

            if (!empty($errorsDatabase)) {
                $errorsText .= '<h5>' . \App\Language::translate('LBL_DATABASE', 'Settings:SystemWarnings') . ':</h5><pre>';
                foreach ($errorsDatabase as $key => $value) {
                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .
                        ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .
    Severity: Major
    Found in app/SystemWarnings/SystemRequirements/Configuration.php and 2 other locations - About 2 hrs to fix
    app/SystemWarnings/Security/SecurityConf.php on lines 39..48
    app/SystemWarnings/SystemRequirements/Configuration.php on lines 38..47

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 129.

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

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

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

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

    Refactorings

    Further Reading

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

            if (!empty($errorsStability)) {
                $errorsText .= '<h5>' . \App\Language::translate('LBL_STABILITY', 'Settings:SystemWarnings') . ':</h5><pre>';
                foreach ($errorsStability as $key => $value) {
                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .
                        ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .
    Severity: Major
    Found in app/SystemWarnings/SystemRequirements/Configuration.php and 2 other locations - About 2 hrs to fix
    app/SystemWarnings/Security/SecurityConf.php on lines 39..48
    app/SystemWarnings/SystemRequirements/Configuration.php on lines 49..58

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 129.

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

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

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

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

    Refactorings

    Further Reading

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

                foreach ($errorsDatabase as $key => $value) {

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

                            $noMandatoryLib = true;

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

        /** {@inheritdoc} */

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

        public function process(): void

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

            $errorsStability = \App\Utils\ConfReport::getErrors('stability', true);

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

            if (!empty($errorsStability)) {

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

            if (!empty($errorsDatabase)) {

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

            $errorsText = '<br>';

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

            }

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

                $noMandatoryLib = false;

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

                    if (isset($value['mandatory'])) {

    Line exceeds 120 characters; contains 125 characters
    Open

                            $errorsText .= '<h4>' . \App\Language::translate('LBL_PHPEXT', 'Settings:SystemWarnings') . ':</h4>';

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

            \App\Utils\ConfReport::saveEnv();

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

            $this->status = 1;

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

                        if (!$noMandatoryLib) {

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

                        ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .

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

                if ($noMandatoryLib) {

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

                foreach ($errorsPerformance as $key => $value) {

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

                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

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

                    if (isset($value['recommended'])) {

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

                            ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .

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

                    ) . $errorsText;

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

        /** {@inheritdoc} */

    Line exceeds 120 characters; contains 121 characters
    Open

                $errorsText .= '<h5>' . \App\Language::translate('LBL_STABILITY', 'Settings:SystemWarnings') . ':</h5><pre>';

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

                        ": '" . ($value['recommended'] ?? '') . "')";

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

                $errorsText .= '</pre><hr/>';

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

                $errorsText .= '</pre><hr/>';

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

                foreach ($errorsLibraries as $key => $value) {

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

                        }

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

                }

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

            }

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

            $errorsPerformance = \App\Utils\ConfReport::getErrors('performance', true);

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

                    $errorsText .= "<pre>$performance</pre>";

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

                    $this->status = 0;

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

            }

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

                $errorsText .= '<h5>' . \App\Language::translate('LBL_STABILITY', 'Settings:SystemWarnings') . ':</h5><pre>';

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

                }

    Line exceeds 120 characters; contains 195 characters
    Open

                            ($value['mandatory'] ? \App\Language::translate('LBL_LIB_REQUIRED', 'Settings:SystemWarnings') : \App\Language::translate('LBL_LIB_OPTIONAL', 'Settings:SystemWarnings')) .

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

        }

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

        {

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

                foreach ($errorsStability as $key => $value) {

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

                    $errorsText .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

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

                $this->status = 0;

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

                $errorsText .= '<h5>' . \App\Language::translate('LBL_DATABASE', 'Settings:SystemWarnings') . ':</h5><pre>';

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

                $performance = '';

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

                if ($performance) {

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

        /**

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

                }

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

                }

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

                    $errorsText .= '<h5>' . \App\Language::translate('LBL_PERFORMANCE', 'Settings:SystemWarnings') . ':</h5>';

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

                        'LBL_CONFIG_SERVER_DESC',

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

                            ')</pre>';

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

            if (!$this->status) {

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

                    }

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

                }

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

                        'Settings:SystemWarnings',

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

         */

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

            $errorsDatabase = \App\Utils\ConfReport::getErrors('database', true);

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

            $errorsLibraries = \App\Utils\ConfReport::getErrors('libraries', true);

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

                            $errorsText .= '<h4>' . \App\Language::translate('LBL_PHPEXT', 'Settings:SystemWarnings') . ':</h4>';

    Line exceeds 120 characters; contains 122 characters
    Open

                    $errorsText .= '<h5>' . \App\Language::translate('LBL_PERFORMANCE', 'Settings:SystemWarnings') . ':</h5>';

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

                    $this->link = 'index.php?parent=Settings&module=ConfReport&view=Index';

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

                        '<a target="_blank" rel="noreferrer noopener" href="https://doc.yetiforce.com/introduction/requirements/"><u>' . \App\Language::translate('LBL_CONFIG_DOC_URL_LABEL', 'Settings:SystemWarnings') . '</u></a>'

    Line exceeds 120 characters; contains 225 characters
    Open

                        '<a target="_blank" rel="noreferrer noopener" href="https://doc.yetiforce.com/introduction/requirements/"><u>' . \App\Language::translate('LBL_CONFIG_DOC_URL_LABEL', 'Settings:SystemWarnings') . '</u></a>'

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

                $this->description = \App\Language::translateArgs(

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

        protected $title = 'LBL_CONFIG_SERVER';

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

        protected $priority = 7;

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

         *

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

                        ": '" . ($value['recommended'] ?? '') . "')";

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

                $this->status = 0;

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

                        $errorsText .= PHP_EOL . "<pre>{$key} (" .

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

         * Checking whether all the configuration parameters are correct.

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

            }

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

                    $errorsText .= '<hr/>';

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

                    $this->status = 0;

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

         * @return void

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

                        ' (' . \App\Language::translate('LBL_RECOMMENDED_VALUE', 'Settings:SystemWarnings') .

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

                        $performance .= PHP_EOL . "  {$key} = " . \yii\helpers\VarDumper::dumpAsString($value['val']) .

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

                            ": '" . ($value['recommended'] ?? '') . "')";

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

            $errorsText .= '</pre>';

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

            if (!empty($errorsLibraries)) {

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

                if (\App\Security\AdminAccess::isPermitted('ConfReport')) {

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

                    $this->linkTitle = \App\Language::translate('LBL_CONFIG_REPORT_LINK', 'Settings:SystemWarnings');

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

                            ($value['mandatory'] ? \App\Language::translate('LBL_LIB_REQUIRED', 'Settings:SystemWarnings') : \App\Language::translate('LBL_LIB_OPTIONAL', 'Settings:SystemWarnings')) .

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

                    }

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

                }

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

            if (!empty($errorsPerformance)) {

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

            }

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

                }

    Multi-line function call not indented correctly; expected 16 spaces but found 20
    Open

                        'Settings:SystemWarnings',

    Multi-line function call not indented correctly; expected 16 spaces but found 20
    Open

                        '<a target="_blank" rel="noreferrer noopener" href="https://doc.yetiforce.com/introduction/requirements/"><u>' . \App\Language::translate('LBL_CONFIG_DOC_URL_LABEL', 'Settings:SystemWarnings') . '</u></a>'

    Multi-line function call not indented correctly; expected 16 spaces but found 20
    Open

                        'LBL_CONFIG_SERVER_DESC',

    Multi-line function call not indented correctly; expected 12 spaces but found 16
    Open

                    ) . $errorsText;

    There are no issues that match your filters.

    Category
    Status