Showing 81 of 119 total issues
Method defaultMessages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function defaultMessages($rule){
$messages = [
"required" => "{placeholder} can't be empty",
"minLen" => "{placeholder} can't be less than {0} character",
"maxLen" => "{placeholder} can't be greater than {0} character",
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 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 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 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 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
Method updateProfileInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateProfileInfo($userId, $name, $password, $email, $confirmEmail){
Method handleError
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function handleError($errno, $errmsg, $filename, $linenum, $vars){
Method doLogIn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function doLogIn($email, $password, $rememberMe, $userIp, $userAgent){
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 updateUserInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateUserInfo($userId, $adminId, $name, $password, $role){
Method pagination
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function pagination($table, $options, $values, $pageNum, $extraOffset = 0){
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 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 updateEmail
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function updateEmail(){
$userId = $this->request->query("id");
$userId = empty($userId)? null: Encryption::decryptId($this->request->query("id"));
$token = $this->request->query("token");
- 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 secureRequired
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function secureRequired(){
$key = "requireSecure";
if(!empty($this->config[$key])){
if (in_array($this->request->param('action'), $this->config[$key], true) || $this->config[$key] === ['*']) {
if (!$this->request->isSSL()) {
- 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"