Showing 104 of 597 total issues
Method getLogData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getLogData(
Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
Threema\MsgApi\Messages\ThreemaMessage $threemaMsg
) {
$eol = PHP_EOL;
Method _getExistingData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _getExistingData($data)
{
// try primary key first
/** @var string $requestId */
if ($requestId = $this->_getExistingPrimaryKey($data, 'request_id')) {
Method queryCredits
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function queryCredits(array &$status, array &$extraError)
{
/** @var ThreemaGateway_Handler_Permissions $permissions */
$permissions = ThreemaGateway_Handler_Permissions::getInstance();
Function ReceiveCallback
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ReceiveCallback = (function () {
'use strict';
var me = {};
var $inputElem;
var $hiddenElem;
Method checkForReceiverCode
has 29 lines of code (exceeds 25 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,
Method checkTecRequire
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function checkTecRequire(array &$status, array &$extraError)
{
// optional check: HTTPS
if (!XenForo_Application::$secure) {
$extraError[]['text'] = new XenForo_Phrase('option_threema_gateway_status_no_https');
Function processPending
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function processPending(array $processOptions = [])
{
if (!$this->pendingRequests) {
$this->preProcessPending();
}
- Read upRead up
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 getMessageMetaData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getMessageMetaData($groupById = false, $ignoreInvalid = true)
{
/** @var array $limitOptions */
$limitOptions = $this->prepareLimitFetchOptions($this->fetchOptions);
- Read upRead up
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 getRandomBytes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getRandomBytes($number)
{
/** @var string $output */
$output = '';
- Read upRead up
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 validatePreConditions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validatePreConditions(&$errorString)
{
/** @var XenForo_Options $options */
$options = XenForo_Application::getOptions();
Method uninstall
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function uninstall()
{
// delete throttle table
/** @var ThreemaGateway_Installer_ActionThrottle $throttleInstaller */
$throttleInstaller = new ThreemaGateway_Installer_ActionThrottle;
Method validateRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateRequest(&$errorString)
{
// access token validation (authentication of Gateway server)
/** @var XenForo_Options $options */
$options = XenForo_Application::getOptions();
Consider simplifying this complex logical expression. Open
if (!$this->input->inRequest('from') ||
!$this->input->inRequest('to') ||
!$this->input->inRequest('messageId') ||
!$this->input->inRequest('date') ||
!$this->input->inRequest('nonce') ||
Function actionTwoStepEnable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function actionTwoStepEnable()
{
/** @var XenForo_ControllerResponse_View $parent */
$parent = parent::actionTwoStepEnable();
- Read upRead up
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
- Read upRead up
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 testCallbackPostSave
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function testCallbackPostSave(ThreemaGateway_Handler_Action_Callback $handler,
Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
Threema\MsgApi\Messages\ThreemaMessage $threemaMsg,
&$output,
$messageSaved,
Method testCallbackPreSave
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function testCallbackPreSave(ThreemaGateway_Handler_Action_Callback $handler,
Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
Threema\MsgApi\Messages\ThreemaMessage $threemaMsg,
&$output,
&$saveMessage,
Function getDefaultThreemaId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
final protected function getDefaultThreemaId(array $user)
{
/** @var XenForo_Options $options */
$options = XenForo_Application::getOptions();
// check for custom user field
- Read upRead up
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 processConfirmRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function processConfirmRequest($confirmRequest, array $processOptions = [])
{
if (!parent::processConfirmRequest($confirmRequest, $processOptions)) {
return false;
}
- Read upRead up
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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(ThreemaGateway_Handler_Action_Callback $handler,
Threema\MsgApi\Helpers\ReceiveMessageResult $receiveResult,
Threema\MsgApi\Messages\ThreemaMessage $threemaMsg,
&$output,
&$saveMessage,