File Author.php
has 467 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Glad;
use Glad\Interfaces\ConditionsInterface;
Author
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class Author
{
/**
* Repository instance
*
Function loginFromRemember
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected static function loginFromRemember()
{
$rememberConf = static::$constants->remember;
if($rememberConf['enabled'] === true) {
- 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 setRemember
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function setRemember(array $userData)
{
$rememberConf = static::$constants->remember;
if($rememberConf['enabled'] === true) {
Method logout
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function logout()
{
static::resetCheckVariables();
$expire = (static::currentTime()-static::$constants->remember['lifetime']);
Function setRemember
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function setRemember(array $userData)
{
$rememberConf = static::$constants->remember;
if($rememberConf['enabled'] === true) {
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Constants $constants, CookerInterface $cooker, Injector $injector, CryptInterface $crypt, DatabaseServiceInterface $databaseService, SessionHandlerInterface $repository, Dispatcher $eventDispatcher)
Function resolveDbResult
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected static function resolveDbResult($result)
{
$exception = false;
if(!isset($result) || !$result) 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
Function login
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function login(HashInterface $hash, array $user, $remember = false)
{
static::resetCheckVariables();
$passField = static::$constants->authFields['password'];
- 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 register
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function register(HashInterface $hash, array $credentials)
{
static::resetCheckVariables();
if(static::guest() === true) {
static::checkIdentityAsParameter($credentials);
- 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 loginByUserId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function loginByUserId($userId, $remember = false)
{
static::resetCheckVariables();
if(static::check() === true || $userId == null) return static::getInstance();
- 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 getIdField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected static function getIdField(array $credentials)
{
$identity = static::$constants->authFields['identity'];
$fields = [];
- 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"