rugk/xenforo-threema-gateway

View on GitHub

Showing 104 of 597 total issues

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

    public static function checkForDeliveryReceipt(ThreemaGateway_Handler_Action_Callback $handler,
                                        Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
                                        Threema\MsgApi\Messages\ThreemaMessage $threemaMsg,
                                        &$output,
                                        &$saveMessage,
Severity: Minor
Found in src/library/ThreemaGateway/Listener/TfaMessageCallback.php - About 45 mins to fix

    Function _getExistingData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _getExistingData($data)
        {
            // try primary key first
            /** @var string $requestId */
            if ($requestId = $this->_getExistingPrimaryKey($data, 'request_id')) {
    Severity: Minor
    Found in src/library/ThreemaGateway/DataWriter/TfaPendingMessagesConfirmation.php - About 45 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 validatePreConditions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function validatePreConditions(&$errorString)
        {
            /** @var XenForo_Options $options */
            $options = XenForo_Application::getOptions();
    
    
    Severity: Minor
    Found in src/library/ThreemaGateway/Handler/Action/Callback.php - About 45 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 checkForReceiverCode has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function checkForReceiverCode(ThreemaGateway_Handler_Action_Callback $handler,
                                            Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
                                            Threema\MsgApi\Messages\ThreemaMessage $threemaMsg,
                                            &$output,
                                            &$saveMessage,
    Severity: Minor
    Found in src/library/ThreemaGateway/Listener/TfaMessageCallback.php - About 45 mins to fix

      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/Reversed.php - About 35 mins to fix

        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

          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/AbstractProvider.php - About 35 mins to fix

            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/Conventional.php - About 35 mins to fix

              Function checkForDeliveryReceipt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function checkForDeliveryReceipt(ThreemaGateway_Handler_Action_Callback $handler,
                                                      Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
                                                      Threema\MsgApi\Messages\ThreemaMessage $threemaMsg,
                                                      &$output,
                                                      &$saveMessage,
              Severity: Minor
              Found in src/library/ThreemaGateway/Listener/TfaMessageCallback.php - About 35 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 renderHtml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function renderHtml(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
                  {
                      /** @var array $status */
                      $status = ['libsodium', 'libsodiumphp', 'phpsdk', 'credits'];
                      /** @var array $extraError */
              Severity: Minor
              Found in src/library/ThreemaGateway/Option/Status.php - About 35 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 addLog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function addLog(&$log, $stringToAdd, $stringToAddDetail = null)
                  {
                      // convert to array if necessary or just add string
                      if (is_string($log)) {
                          if ($stringToAddDetail) {
              Severity: Minor
              Found in src/library/ThreemaGateway/Handler/Action/Callback.php - About 35 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 saveMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function saveMessage(
                      Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
                      Threema\MsgApi\Messages\ThreemaMessage $threemaMsg
                  ) {
                      $dataWriter = XenForo_DataWriter::create('ThreemaGateway_DataWriter_Messages');
              Severity: Minor
              Found in src/library/ThreemaGateway/Handler/Action/Callback.php - About 35 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 checkForReceiverCode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function checkForReceiverCode(ThreemaGateway_Handler_Action_Callback $handler,
                                                      Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
                                                      Threema\MsgApi\Messages\ThreemaMessage $threemaMsg,
                                                      &$output,
                                                      &$saveMessage,
              Severity: Minor
              Found in src/library/ThreemaGateway/Listener/TfaMessageCallback.php - About 35 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 setDataForRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function setDataForRequest(
                      array $confirmRequest,
                      array $setData,
                      array $processOptions = []
                  ) {
              Severity: Minor
              Found in src/library/ThreemaGateway/Handler/Action/TfaCallback/Abstract.php - About 35 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 setUserId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function setUserId($newUser = null)
                  {
                      // get user ids (or null)
                      if ($this->user === null) {
                          /** @var int|null $oldUserId User id of user (from class) */
              Severity: Minor
              Found in src/library/ThreemaGateway/Handler/Permissions.php - About 35 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 applyFilter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function applyFilter($filterType, $filterData, $failOnError = true)
                  {
                      /** @var $success bool */
                      $success = true;
              
              
              Severity: Minor
              Found in src/library/ThreemaGateway/Handler/Action/TfaCallback/TextMessage.php - About 35 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 processMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function processMessage($downloadPath, $debugMode = false)
                  {
                      /** @var string $output */
                      $output = '';
              
              
              Severity: Minor
              Found in src/library/ThreemaGateway/Handler/Action/Callback.php - About 35 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

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