rugk/xenforo-threema-gateway

View on GitHub

Showing 597 of 597 total issues

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

    public function groupArray(array $array, $indexKey, $ignoreIndex = 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

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

    public static function roundToDay($time, $roundUp = 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 '106', column '33').
Open

            $keyConverter = new ThreemaGateway_Handler_Action_KeyConverter;

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

            throw new XenForo_Exception('Download dir ' . $downloadPath . ' cannot be accessed.');

MissingImport

Since: 2.7.0

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

Example

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

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

Avoid 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

    Missing class import via use statement (line '34', column '23').
    Open

                throw new XenForo_Exception(new XenForo_Phrase('threemagw_threema_id_does_not_exist') . ' ' . $e->getMessage());

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

                $dataWriter->error(new XenForo_Phrase('threemagw_invalid_discard_old_date'), $fieldName);

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                throw new XenForo_Exception('Message could not be saved: [' . get_class($e) . '] ' . $e->getMessage());

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Avoid 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

      Missing class import via use statement (line '406', column '23').
      Open

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

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

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

      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 '29', column '37').
      Open

              $gatewayHandlerServer = new ThreemaGateway_Handler_Action_GatewayServer;

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

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

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

                  $dataWriter->error(new XenForo_Phrase('threemagw_invalid_downloadpath'), $fieldName);

      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 '233', column '46').
      Open

                  $status['credits']['text'] = new XenForo_Phrase('option_threema_gateway_status_credits', ['credits' => $credits]);

      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 '244', column '51').
      Open

                  $status['credits']['descr']     = new XenForo_Phrase('option_threema_gateway_status_credits_low');

      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 '73', column '36').
      Open

                  $dataWriter->error(new XenForo_Phrase('threemagw_invalid_threema_secret'), $fieldName);

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

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

      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 '108', column '57').
      Open

                      $status['libsodium']['descr']     = new XenForo_Phrase('option_threema_gateway_status_libsodium_outdated');

      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 '215', column '46').
      Open

              $status['credits']['addition'] = new XenForo_Phrase('option_threema_gateway_status_credits_recharge');

      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

      Severity
      Category
      Status
      Source
      Language