rugk/xenforo-threema-gateway

View on GitHub
src/library/ThreemaGateway/Tfa/Fast.php

Summary

Maintainability
D
2 days
Test Coverage

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

class ThreemaGateway_Tfa_Fast extends ThreemaGateway_Tfa_AbstractProvider
{
    /**
     * Called when verifying displaying the choose 2FA mode.
     *

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

<?php
/**
 * Two factor authentication provider for Threema Gateway which sends a
 * confirmation message.
 *
Severity: Minor
Found in src/library/ThreemaGateway/Tfa/Fast.php - About 3 hrs to fix

    Method handleMessageDecline has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function handleMessageDecline(array &$providerData, array $user, $userIp = null)
        {
            /** @var XenForo_Options $xenOptions */
            $xenOptions = XenForo_Application::getOptions();
            /** @var int $blockingTime seconds how long users should be blocked */
    Severity: Major
    Found in src/library/ThreemaGateway/Tfa/Fast.php - About 2 hrs to fix

      Method triggerVerification has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function triggerVerification($context, array $user, $userIp, array &$providerData)
          {
              parent::triggerVerification($context, $user, $userIp, $providerData);
      
              // this 2FA mode requires end-to-end encryption
      Severity: Minor
      Found in src/library/ThreemaGateway/Tfa/Fast.php - About 1 hr to fix

        Method verifyFromInput has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function verifyFromInput($context, XenForo_Input $input, array $user, array &$providerData)
            {
                /** @var bool $result from parent, for error checking */
                $result = parent::verifyFromInput($context, $input, $user, $providerData);
        
        
        Severity: Minor
        Found in src/library/ThreemaGateway/Tfa/Fast.php - About 1 hr to fix

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

              private function handleMessageDecline(array &$providerData, array $user, $userIp = null)
              {
                  /** @var XenForo_Options $xenOptions */
                  $xenOptions = XenForo_Application::getOptions();
                  /** @var int $blockingTime seconds how long users should be blocked */
          Severity: Minor
          Found in src/library/ThreemaGateway/Tfa/Fast.php - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function verifyFromInput($context, XenForo_Input $input, array $user, array &$providerData)
              {
                  /** @var bool $result from parent, for error checking */
                  $result = parent::verifyFromInput($context, $input, $user, $providerData);
          
          
          Severity: Minor
          Found in src/library/ThreemaGateway/Tfa/Fast.php - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function triggerVerification($context, array $user, $userIp, array &$providerData)
              {
                  parent::triggerVerification($context, $user, $userIp, $providerData);
          
                  // this 2FA mode requires end-to-end encryption
          Severity: Minor
          Found in src/library/ThreemaGateway/Tfa/Fast.php - About 55 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function renderVerification(XenForo_View $view, $context, array $user,
                                                  array $providerData, array $triggerData)
          Severity: Minor
          Found in src/library/ThreemaGateway/Tfa/Fast.php - About 35 mins to fix

            Avoid too many return statements within this method.
            Open

                    return true;
            Severity: Major
            Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return false;
              Severity: Major
              Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return false; // and fail silently
                Severity: Major
                Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return true;
                  Severity: Major
                  Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return true;
                    Severity: Major
                    Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return false;
                      Severity: Major
                      Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return false;
                        Severity: Major
                        Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return false;
                          Severity: Major
                          Found in src/library/ThreemaGateway/Tfa/Fast.php - About 30 mins to fix

                            The method handleMessageDecline() has an NPath complexity of 864. The configured NPath complexity threshold is 200.
                            Open

                                private function handleMessageDecline(array &$providerData, array $user, $userIp = null)
                                {
                                    /** @var XenForo_Options $xenOptions */
                                    $xenOptions = XenForo_Application::getOptions();
                                    /** @var int $blockingTime seconds how long users should be blocked */

                            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 handleMessageDecline() has 117 lines of code. Current threshold is set to 100. Avoid really long methods.
                            Open

                                private function handleMessageDecline(array &$providerData, array $user, $userIp = null)
                                {
                                    /** @var XenForo_Options $xenOptions */
                                    $xenOptions = XenForo_Application::getOptions();
                                    /** @var int $blockingTime seconds how long users should be blocked */

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

                                public function verifyFromInput($context, XenForo_Input $input, array $user, array &$providerData)
                                {
                                    /** @var bool $result from parent, for error checking */
                                    $result = parent::verifyFromInput($context, $input, $user, $providerData);
                            
                            

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

                                private function handleMessageDecline(array &$providerData, array $user, $userIp = null)
                                {
                                    /** @var XenForo_Options $xenOptions */
                                    $xenOptions = XenForo_Application::getOptions();
                                    /** @var int $blockingTime seconds how long users should be blocked */

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

                                public function verifyFromInput($context, XenForo_Input $input, array $user, array &$providerData)
                                {
                                    /** @var bool $result from parent, for error checking */
                                    $result = parent::verifyFromInput($context, $input, $user, $providerData);
                            
                            

                            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

                            Missing class import via use statement (line '547', column '58').
                            Open

                                            $blockActions = PHP_EOL . PHP_EOL . (new XenForo_Phrase('tfa_threemagw_message_blocked_canreverse'))->render();

                            MissingImport

                            Since: 2.7.0

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

                            Example

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

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

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

                                private function userIsBlocked(array $providerData, $messageYetToSent = false)

                            BooleanArgumentFlag

                            Since: 1.4.0

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

                            Example

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

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

                            Missing class import via use statement (line '116', column '24').
                            Open

                                    $message = new XenForo_Phrase($phrase, [

                            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 '509', column '41').
                            Open

                                        $blockActions .= ' ' . (new XenForo_Phrase('tfa_threemagw_message_blocked_user', [

                            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 '554', column '28').
                            Open

                                        $message = new XenForo_Phrase('tfa_threemagw_message_blocked_general', [

                            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 '67', column '23').
                            Open

                                        throw new XenForo_Exception(new XenForo_Phrase('threema_this_action_required_e2e'));

                            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 '496', column '48').
                            Open

                                        $userBanDw->set('user_reason', new XenForo_Phrase('threemagw_tfa_user_banned'));

                            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 '481', column '41').
                            Open

                                        $blockActions .= ' ' . (new XenForo_Phrase('tfa_threemagw_message_blocked_login', [

                            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 '523', column '41').
                            Open

                                        $blockActions .= ' ' . (new XenForo_Phrase('tfa_threemagw_message_blocked_ip'))->render();

                            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 '67', column '45').
                            Open

                                        throw new XenForo_Exception(new XenForo_Phrase('threema_this_action_required_e2e'));

                            MissingImport

                            Since: 2.7.0

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

                            Example

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

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

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

                                        } else {
                                            // theoretically we could explicitly state that nothing has
                                            // been done, but this is not particularly useful:
                                            // $blockActions = (new XenForo_Phrase('tfa_threemagw_message_blocked_nothing'))->render();
                                        }

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

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

                            Avoid using static access to class 'XenForo_Application' in method 'renderVerification'.
                            Open

                                    $xenOptions = XenForo_Application::getOptions();

                            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 'ThreemaGateway_Helper_General' in method 'handleMessageDecline'.
                            Open

                                            ThreemaGateway_Helper_General::roundToDay(
                                                XenForo_Application::$time + $blockingTime,
                                                true // round up to next full day
                                            )

                            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 'XenForo_Model' in method 'verifyFromInput'.
                            Open

                                            $tfaModel = XenForo_Model::create('XenForo_Model_Tfa');

                            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 'XenForo_Model' in method 'handleMessageDecline'.
                            Open

                                        $userIpBanModel = XenForo_Model::create('XenForo_Model_Banning');

                            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 'XenForo_DataWriter' in method 'handleMessageDecline'.
                            Open

                                        $userBanDw = XenForo_DataWriter::create('XenForo_DataWriter_UserBan', XenForo_DataWriter::ERROR_SILENT);

                            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 'XenForo_Application' in method 'handleMessageDecline'.
                            Open

                                        $options = XenForo_Application::getOptions();

                            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 'XenForo_Application' in method 'handleMessageDecline'.
                            Open

                                    $xenOptions = XenForo_Application::getOptions();

                            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 'XenForo_Application' in method 'canEnable'.
                            Open

                                    $options = XenForo_Application::getOptions();

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                    } else {
                                        $providerData['validationTime'] = $options->threema_gateway_tfa_fast_validation * 60; //default: 3 minutes
                                    }

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

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

                            Avoid using static access to class 'XenForo_Application' in method 'adjustViewParams'.
                            Open

                                    $xenOptions = XenForo_Application::getOptions();

                            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 'ThreemaGateway_Helper_General' in method 'handleMessageDecline'.
                            Open

                                            'blockTime' => $this->parseTime(ThreemaGateway_Helper_General::roundToDayRelative($blockingTime, 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 'ThreemaGateway_Helper_General' in method 'adjustViewParams'.
                            Open

                                        'blockTimeDayRounded' => $this->parseTime(ThreemaGateway_Helper_General::roundToDayRelative($xenOptions->threema_gateway_tfa_blocking_time * 60, 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 'XenForo_Application' in method 'triggerVerification'.
                            Open

                                    $options = XenForo_Application::getOptions();

                            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 unused parameters such as '$providerData'.
                            Open

                                protected function initiateSetupData(array &$providerData, array &$triggerData)

                            UnusedFormalParameter

                            Since: 0.2

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

                            Example

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

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

                            Avoid unused parameters such as '$triggerData'.
                            Open

                                protected function initiateSetupData(array &$providerData, array &$triggerData)

                            UnusedFormalParameter

                            Since: 0.2

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

                            Example

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

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

                            Avoid unused parameters such as '$context'.
                            Open

                                protected function adjustViewParams(array $viewParams, $context, array $user)

                            UnusedFormalParameter

                            Since: 0.2

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

                            Example

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

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

                            There are no issues that match your filters.

                            Category
                            Status