Showing 21 of 21 total issues
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 setInjectsParameters
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
protected static function setInjectsParameters($class, $method, array $parm = [])
{
$methods = array('__construct', $method);
$instance = 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
Function editParameter
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected static function editParameter($depends, array $params)
{
if(count($depends) > 0 && count($params) > 0){
foreach ($depends as $key => $value) {
if(!preg_match('/array(\s+)\$(.*?)/', $value) && !preg_match('/\$(.*?)(\s+)\=(\s+)(.*?)/', $value)){
- 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 setInjectsParameters
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function setInjectsParameters($class, $method, array $parm = [])
{
$methods = array('__construct', $method);
$instance = null;
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 editParameter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function editParameter($depends, array $params)
{
if(count($depends) > 0 && count($params) > 0){
foreach ($depends as $key => $value) {
if(!preg_match('/array(\s+)\$(.*?)/', $value) && !preg_match('/\$(.*?)(\s+)\=(\s+)(.*?)/', $value)){
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 set
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function set($name = false, $value = false, $lifeTime = '', $path = '/', $domain = '', $secure = false, $httpOnly = false);
Method set
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function set($name = false, $value = false, $lifeTime = '', $path = '/', $domain = '.', $secure = false, $httpOnly = false)
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 apply
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function apply(array $user, $cond = array(), Dispatcher $eventDispatcher)
{
$this->check = true;
$this->add($cond);
- 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 has
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function has($keyOrClass)
{
if(is_object($keyOrClass)) {
foreach(self::$container as $key => $class) {
if(is_object($class) && $class instanceof $keyOrClass) {
- 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 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 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 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 bindWhere
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function bindWhere(array $where)
{
$_where = '';
foreach($where as $operator => $w) {
- 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"