sant0ro/chocolatey

View on GitHub

Showing 11 of 91 total issues

User has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class User extends Model implements AuthenticatableContract, AuthorizableContract
{
    use Authenticatable, Authorizable, Eloquence, Mappable;

    /**
Severity: Minor
Found in app/Models/User.php - About 2 hrs to fix

    Method createPoolRoom has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    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]);
    Severity: Major
    Found in app/Helpers/Nux.php - About 2 hrs to fix

      Method store has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function store(string $roomName, string $description, string $model, int $maxUsers, int $roomCategory, int $floorPaper, int $wallPaper, float $landscapePaper, int $ownerId, string $ownerName)
      Severity: Major
      Found in app/Models/Room.php - About 1 hr to fix

        Method store has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function store(int $userId, int $roomId, int $itemId, int $xPosition, int $yPosition, string $zPosition, int $rotation, string $extraData, string $wallPosition = ''): self
        Severity: Major
        Found in app/Models/RoomItem.php - About 1 hr to fix

          Method createClubRoom has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          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]);
          Severity: Minor
          Found in app/Helpers/Nux.php - About 1 hr to fix

            Method store has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function store(string $title, string $description, string $content, string $author, string $categories, string $imageUrl, string $thumbnailUrl): self
            Severity: Major
            Found in app/Models/Article.php - About 50 mins to fix

              Method store has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function store(int $userId, int $userStaffId, string $banReason, $banType = 'account', $banExpire = 0, $ipAddress = '', $machineId = ''): self
              Severity: Major
              Found in app/Models/Ban.php - About 50 mins to fix

                Method store has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function store(int $userId, int $firstQuestion, int $secondQuestion, string $firstAnswer, string $secondAnswer): self
                Severity: Minor
                Found in app/Models/UserSecurity.php - About 35 mins to fix

                  Method success has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function success(Request $request, string $paymentCategory, int $countryCode, int $shopItem, int $paymentMethod)
                  Severity: Minor
                  Found in app/Http/Controllers/ShopController.php - About 35 mins to fix

                    Method store has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function store(string $itemName, string $countryCode, int $creditAmount, int $iconId, array $paymentMethods): self
                    Severity: Minor
                    Found in app/Models/ShopItem.php - About 35 mins to fix

                      Function get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function get(string $token = '')
                          {
                              if ($this->mailModel == null && !empty($token)) {
                                  $mailModel = MailModel::where('token', $token)->where('used', '0')->first();
                      
                      
                      Severity: Minor
                      Found in app/Helpers/Mail.php - About 35 mins to fix

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language