rugk/xenforo-threema-gateway

View on GitHub

Showing 104 of 597 total issues

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 true;
    Severity: Major
    Found in src/library/ThreemaGateway/Tfa/Reversed.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/Reversed.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

                  return $controller->responseView(
                      'ThreemaGateway_ViewPublic_TfaManage',
                      'account_two_step_' . $this->_providerId . '_manage',
                      $viewParams
                  );
          Severity: Major
          Found in src/library/ThreemaGateway/Tfa/AbstractProvider.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return true;
            Severity: Major
            Found in src/library/ThreemaGateway/Handler/Settings.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/Handler/Action/Callback.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/Conventional.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

                              Function initiate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function initiate(&$threemaId = null)
                                  {
                                      if (!$this->isPermissionChecked) {
                                          // general permission
                                          if (!$this->permissions->hasPermission('send')) {
                              Severity: Minor
                              Found in src/library/ThreemaGateway/Handler/Action/Sender.php - About 25 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

                              Function parseTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  final protected function parseTime($seconds)
                                  {
                                      /** @var string $displayTime output/result */
                                      $displayTime = '';
                                      /** @var int $minutes */
                              Severity: Minor
                              Found in src/library/ThreemaGateway/Tfa/AbstractProvider.php - About 25 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

                              Function getRandomString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function getRandomString($length, $keyspace = 'abcdefghijklmnopqrstuvwxyz01234567')
                                  {
                                      /** @var string $output */
                                      $output = '';
                                      if (self::canUseLibsodium()) {
                              Severity: Minor
                              Found in src/library/ThreemaGateway/Helper/Random.php - About 25 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

                              Function pushArrayKeys has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function pushArrayKeys(array &$baseArray, array &$subArray, array $removeKeys)
                                  {
                                      foreach ($removeKeys as $key) {
                                          // skip invalid keys
                                          if (!array_key_exists($key, $subArray[0])) {
                              Severity: Minor
                              Found in src/library/ThreemaGateway/Model/Messages.php - About 25 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

                              Function checkPhpSdk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected static function checkPhpSdk(array &$status, array &$extraError, ThreemaGateway_Handler_Settings $gwSettings = null)
                                  {
                                      // auto-create Gateway settings if not given
                                      if ($gwSettings === null) {
                                          $gwSettings = new ThreemaGateway_Handler_Settings;
                              Severity: Minor
                              Found in src/library/ThreemaGateway/Option/Status.php - About 25 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

                              Function verifyOption has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function verifyOption(&$option, XenForo_DataWriter $dataWriter, $fieldName)
                                  {
                                      if (!$option || !$option['enabled']) {
                                          // skip check if option is disabled
                                          return true;
                              Severity: Minor
                              Found in src/library/ThreemaGateway/Option/VerifyReceiveTime.php - About 25 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

                              Severity
                              Category
                              Status
                              Source
                              Language