Showing 81 of 119 total issues
Method isCookieValid
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isCookieValid(){
// "auth" or "remember me" cookie
if(empty($_COOKIE['auth'])) {
return false;
Function isEmailVerificationTokenValid
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function isEmailVerificationTokenValid($userId, $emailToken){
if (empty($userId) || empty($emailToken)) {
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 updateBackup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function updateBackup(){
$dir = APP . "backups/";
$files = scandir($dir);
- 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 getBackups
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getBackups() {
$files = scandir(APP . "backups/");
$basename = $filename = $unixTimestamp = 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 form
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function form($config){
if(empty($config['fields']) || $this->request->dataSizeOverflow()){
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 emailUnique
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function emailUnique($email){
$database = Database::openConnection();
// email is unique in the database, So, we can't have more than 2 same emails
- 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 isForgottenPasswordTokenValid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function isForgottenPasswordTokenValid($userId, $passwordToken){
if (empty($userId) || empty($passwordToken)) {
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 init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
init: function(){
$("ul.pagination a").click(function(e){
var pageNumber;
- 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 validateData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
validateData: function (result, targetBlock, errorFunc, errorType, returnVal){
Method register
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function register($name, $email, $password, $confirmPassword, $captcha){
Method updateProfileInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateProfileInfo($userId, $name, $password, $email, $confirmEmail){
Method updateUserInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateUserInfo($userId, $adminId, $name, $password, $role){
Method doLogIn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function doLogIn($email, $password, $rememberMe, $userIp, $userAgent){
Method handleError
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function handleError($errno, $errmsg, $filename, $linenum, $vars){
Method pagination
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function pagination($table, $options, $values, $pageNum, $extraOffset = 0){
Function init
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
init: function (){
// initialize todo application event
events.todo.init();
- 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 sendEmail
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function sendEmail($type, $email, $userData, $data){
$mail = new PHPMailer();
$mail->IsSMTP();
- 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 send
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function send(){
$this->sendHeaders();
if ($this->file) {
- 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 doLogIn
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function doLogIn($email, $password, $rememberMe, $userIp, $userAgent){
// 1. check if user is blocked
if($this->isIpBlocked($userIp)) {
$this->errors[] = "Your IP Address has been blocked";
- 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 _get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function _get($key, $source){
if (!isset(self::$config[$source])) {
$config_file = APP . 'config/' . $source . '.php';
- 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"