Showing 104 of 597 total issues
Method _getFields
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _getFields()
{
return [
ThreemaGateway_Model_Messages::DB_TABLE_MESSAGES => [
'message_id' => [
Function _preSave
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function _preSave()
{
// filter data
// also uses existing data as a data base as otherwise the main table
// may also get deleted because of missing message id
- 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 AutoTriggerer
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
var AutoTriggerer = (function(window, document) {
'use strict';
var me = {};
var indicatorElem = '#threemagw_auto_trigger';
var period = 2000;
- 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
ThreemaGateway_Tfa_AbstractProvider
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ThreemaGateway_Tfa_AbstractProvider extends XenForo_Tfa_AbstractProvider
{
/**
* Variable, which will be filled with object of the Gateway Permissions class.
*
Method getMessageDataByType
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMessageDataByType($messageType, $includeMetaData = true)
{
/** @var array $output */
$output = [];
File Messages.php
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Model for messages stored in database.
*
* @package ThreemaGateway
File AbstractProvider.php
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Two factor authentication abstract provider for Threema Gateway.
*
* @package ThreemaGateway
File Messages.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* DataWriter for Threema messages.
*
* @package ThreemaGateway
Function AutoTriggerer
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
var AutoTriggerer = (function(window, document) {
'use strict';
var me = {};
var indicatorElem = '#threemagw_auto_trigger';
var period = 2000;
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.
*
Function getAllMessageData
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getAllMessageData(array $metaData, $groupByMessageType = false)
{
// get grouped messages by type
$messageTypes = $this->groupArray($metaData, 'message_type_code');
// we always need to do this (regardless of message_type_code) as each
- 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 renewCache
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function renewCache($userId)
{
/** @var array $permissions Temporary variable for permissions */
$permissions = [];
- 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
File Abstract.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* 2FA callback actions.
*
* @package ThreemaGateway
File Callback.php
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Allows XenForo to receive Threema messages by providing a callback.
*
* @package ThreemaGateway
ThreemaGateway_Handler_Action_TfaCallback_Abstract
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ThreemaGateway_Handler_Action_TfaCallback_Abstract extends ThreemaGateway_Handler_Action_Abstract
{
/**
* @var array Cache of models
*/
Method handleManage
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function handleManage(XenForo_Controller $controller, array $user, array $providerData)
{
$this->gatewayPermissions->setUserId($user);
/** @var XenForo_Input $input */
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 */
Function handleManage
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
final public function handleManage(XenForo_Controller $controller, array $user, array $providerData)
{
$this->gatewayPermissions->setUserId($user);
/** @var XenForo_Input $input */
- 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 create
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create()
{
$db = XenForo_Application::get('db');
// set charset
Method setDataForRequest
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setDataForRequest(
array $confirmRequest,
array $setData,
array $processOptions = []
) {