File yf_user_profile.class.php
has 553 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// User profile handling module
class yf_user_profile extends yf_module
{
Function compact_info
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function compact_info()
{
main()->NO_GRAPHICS = true;
conf('no_ajax_here', true);
// Check user id
- 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 compact_info
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compact_info()
{
main()->NO_GRAPHICS = true;
conf('no_ajax_here', true);
// Check user id
Method _show_info_items
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _show_info_items()
{
// Array of text fields
$text_fields = [
'name' => 'Name',
Function _show_info_items
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function _show_info_items()
{
// Array of text fields
$text_fields = [
'name' => 'Name',
- 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
yf_user_profile
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_user_profile extends yf_module
{
/** @var int */
public $MAX_SHOW_ADS = 10;
/** @var int */
Method show
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
// Check if user exists
if (empty($this->_user_info)) {
return _e('No such user!');
Method _init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _init()
{
if ( ! empty($_SESSION['edit_escort_id'])) {
// Do cache
if ( ! isset($GLOBALS['_agency_info'])) {
Method show_friend_stats
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_friend_stats()
{
if (empty(main()->USER_ID)) {
return _error_need_login();
}
Method show_visits_stats
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_visits_stats()
{
if (empty(main()->USER_ID)) {
return _error_need_login();
}
Function _init
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function _init()
{
if ( ! empty($_SESSION['edit_escort_id'])) {
// Do cache
if ( ! isset($GLOBALS['_agency_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 _quick_menu
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _quick_menu()
{
$menu = [
[
'name' => 'Manage',
Function _get_user_info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _get_user_info()
{
if ( ! empty($this->_user_info)) {
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"