File Service.php
has 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Platform\Gatekeeper\Authorization\Account;
use SPHERE\Application\People\Person\Service\Entity\TblPerson;
use SPHERE\Application\Platform\Gatekeeper\Authorization\Access\Service\Entity\TblRole;
Service
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
class Service extends AbstractService
{
/** @var TblAccount[] $AccountByIdCache */
private static $AccountByIdCache = array();
Function isCredentialValid
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
private function isCredentialValid($Username, $Password, $TokenString, TblIdentification $tblIdentification)
{
if (false === ($tblAccount = $this->getAccountByCredential($Username, $Password, $tblIdentification))) {
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
Function createSessionCredentialToken
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function createSessionCredentialToken(
IFormInterface &$Form,
$CredentialName,
$CredentialLock,
$CredentialKey,
- 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 createSessionCredential
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function createSessionCredential(
IFormInterface &$Form,
$CredentialName,
$CredentialLock,
TblIdentification $tblIdentification
- 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 editGroup
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function editGroup(
IFormInterface $Form,
TblGroup $tblGroup,
$Group,
Pipeline $pipelineSuccess = null
- 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 editGroup
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function editGroup(
IFormInterface $Form,
TblGroup $tblGroup,
$Group,
Pipeline $pipelineSuccess = null
Function createGroup
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function createGroup(
IFormInterface $Form,
$Group,
Pipeline $pipelineSuccess = null
)
- 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 createGroup
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createGroup(
IFormInterface $Form,
$Group,
Pipeline $pipelineSuccess = null
)
Method isCredentialValid
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function isCredentialValid($Username, $Password, $TokenString, TblIdentification $tblIdentification)
{
if (false === ($tblAccount = $this->getAccountByCredential($Username, $Password, $tblIdentification))) {
return false;
Method createSessionCredentialToken
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSessionCredentialToken(
IFormInterface &$Form,
$CredentialName,
$CredentialLock,
$CredentialKey,
Method createSessionCredential
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSessionCredential(
IFormInterface &$Form,
$CredentialName,
$CredentialLock,
TblIdentification $tblIdentification
Method insertAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function insertAccount($Username, $Password, TblToken $tblToken = null, TblConsumer $tblConsumer = null, $SaveInitialPW = false)
Method createSessionCredentialToken
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
IFormInterface &$Form,
$CredentialName,
$CredentialLock,
$CredentialKey,
TblIdentification $tblIdentification
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;