Showing 12 of 20 total issues
Function authLogin
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function authLogin($data)
{
$data = $this->emptyValue($data);
$login = $data["login"];
- 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 authRegister
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function authRegister($data)
{
$data = $this->emptyValue($data);
$name = $data["name"];
$email = $data["email"];
Method authLogin
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function authLogin($data)
{
$data = $this->emptyValue($data);
$login = $data["login"];
Function registerCheck
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerCheck() {
var name = $("#name").val();
var email = $("#email").val();
var username = $("#username").val();
var mob = $("#mob").val();
Function loginCheck
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loginCheck()
{
var login = $("#login").val();
var password = $("#passLogin").val();
initLogin();
Function loginCheck
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function loginCheck()
{
var login = $("#login").val();
var password = $("#passLogin").val();
initLogin();
- 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 registerCheck
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function registerCheck() {
var name = $("#name").val();
var email = $("#email").val();
var username = $("#username").val();
var mob = $("#mob").val();
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function login()
{
var re = /^\S+@/;
var val = $("#login").val();
$("input#login").prev("span").remove();
Function authRegister
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function authRegister($data)
{
$data = $this->emptyValue($data);
$name = $data["name"];
$email = $data["email"];
- 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
Avoid too many return
statements within this method. Open
return json_encode(
[
"Error" => "You are not registered, " . $this->connect->error
]
);
Avoid too many return
statements within this method. Open
return json_encode($this->error);
Function login
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function login()
{
var re = /^\S+@/;
var val = $("#login").val();
$("input#login").prev("span").remove();
- 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"