Showing 21 of 21 total issues
Function qrSubmitAction
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
public function qrSubmitAction()
{
if ( ! $this->getRequest()->isPost()) {
return;
}
- 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 TwofactorauthController.php
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* adminhtml controller to enforce Two Factor Authentication
*
Method qrSubmitAction
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function qrSubmitAction()
{
if ( ! $this->getRequest()->isPost()) {
return;
}
Function adminUserAuthenticateAfter
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function adminUserAuthenticateAfter(Varien_Event_Observer $observer)
{
if (!Mage::helper('twofactorauth')->isActive()) {
return $this;
}
- 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 saveAction
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function saveAction()
{
if (!$this->_validateFormKey()) {
return $this->_redirect('twofactorauth/customer/configure');
}
Function saveAction
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function saveAction()
{
if (!$this->_validateFormKey()) {
return $this->_redirect('twofactorauth/customer/configure');
}
- 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 adminUserAuthenticateAfter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function adminUserAuthenticateAfter(Varien_Event_Observer $observer)
{
if (!Mage::helper('twofactorauth')->isActive()) {
return $this;
}
Method resetAction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resetAction()
{
if ( ! Mage::helper('twofactorauth/auth')->isReAuthenticated()) {
$this->_getSession()->addError($this->__('Access Denied.'));
$this->_redirectReferer();
Method answerAction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function answerAction()
{
$questionId = (int) Mage::app()->getRequest()->getPost('question_id');
if ( ! $questionId) {
$this->_redirect('*/*/interstitial');
Function _isAllowed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function _isAllowed()
{
$action = $this->getRequest()->getActionName();
if ($action == 'resetUser') {
- 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 checkTfaSubmitted
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function checkTfaSubmitted(Varien_Event_Observer $observer)
{
$request = $observer->getControllerAction()->getRequest();
if ($request->getActionName() == 'logout' || !Mage::helper('twofactorauth')->isActive()) {
- 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
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return FALSE;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return TRUE;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return ($hasToken && $authenticated);