plugins/user/modules/yf_register.class.php
Function confirm
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
public function confirm()
{
// Send registration confirmation email
if ( ! $this->CONFIRM_REGISTER) {
return tpl()->parse('@object/confirm_messages', ['msg' => 'confirm_not_needed']);
- 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 confirm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function confirm()
{
// Send registration confirmation email
if ( ! $this->CONFIRM_REGISTER) {
return tpl()->parse('@object/confirm_messages', ['msg' => 'confirm_not_needed']);
Method resend_code
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function resend_code()
{
if ( ! empty($_POST['email'])) {
$user_info = db()->query_fetch('SELECT * FROM ' . db('user') . ' WHERE email="' . _es($_POST['email']) . '"');
if (empty($user_info)) {
Function resend_code
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public function resend_code()
{
if ( ! empty($_POST['email'])) {
$user_info = db()->query_fetch('SELECT * FROM ' . db('user') . ' WHERE email="' . _es($_POST['email']) . '"');
if (empty($user_info)) {
- 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 show
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function show()
{
$validate_rules = [
'__form_id__' => 'register_form',
'login' => ['trim|required|min_length[2]|max_length[12]|ajax_is_unique[user.login]|xss_clean', function ($in) {
Avoid too many return
statements within this method. Open
Open
return tpl()->parse('@object/confirm_messages', ['msg' => 'confirm_success']);
Avoid too many return
statements within this method. Open
Open
return $body;
Avoid too many return
statements within this method. Open
Open
return tpl()->parse('@object/resend_code', $replace);