Showing 11 of 91 total issues
User
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable, Eloquence, Mappable;
/**
Method createPoolRoom
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function createPoolRoom(User $user): bool
{
$room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 307, 3104, 1.10, $user->uniqueId, $user->name);
$user->update(['home_room' => $room->id]);
Method store
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function store(string $roomName, string $description, string $model, int $maxUsers, int $roomCategory, int $floorPaper, int $wallPaper, float $landscapePaper, int $ownerId, string $ownerName)
Method store
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function store(int $userId, int $roomId, int $itemId, int $xPosition, int $yPosition, string $zPosition, int $rotation, string $extraData, string $wallPosition = ''): self
Method createClubRoom
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function createClubRoom(User $user): bool
{
$room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 409, 1902, 0.0, $user->uniqueId, $user->name);
$user->update(['home_room' => $room->id]);
Method store
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function store(string $title, string $description, string $content, string $author, string $categories, string $imageUrl, string $thumbnailUrl): self
Method store
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function store(int $userId, int $userStaffId, string $banReason, $banType = 'account', $banExpire = 0, $ipAddress = '', $machineId = ''): self
Method store
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function store(int $userId, int $firstQuestion, int $secondQuestion, string $firstAnswer, string $secondAnswer): self
Method success
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function success(Request $request, string $paymentCategory, int $countryCode, int $shopItem, int $paymentMethod)
Method store
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function store(string $itemName, string $countryCode, int $creditAmount, int $iconId, array $paymentMethods): self
Function get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function get(string $token = '')
{
if ($this->mailModel == null && !empty($token)) {
$mailModel = MailModel::where('token', $token)->where('used', '0')->first();
- 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"