bavix/laravel-wallet

View on GitHub

Showing 15 of 27 total issues

File WalletServiceProvider.php has 420 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

<?php

declare(strict_types=1);

namespace Bavix\Wallet;
Severity: Minor
Found in src/WalletServiceProvider.php - About 6 hrs to fix

    Method forceExchange has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

        public function forceExchange(Wallet $to, int|string $amount, ExtraDtoInterface|array|null $meta = null): Transfer
        {
            // Get the atomic service to execute the exchange operation as a single, indivisible action.
            $atomicService = app(AtomicServiceInterface::class);
    
    
    Severity: Major
    Found in src/Traits/CanExchange.php - About 2 hrs to fix

      File CartPay.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
      Confirmed

      <?php
      
      declare(strict_types=1);
      
      namespace Bavix\Wallet\Traits;
      Severity: Minor
      Found in src/Traits/CartPay.php - About 2 hrs to fix

        Method services has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Confirmed

            private function services(array $configure, array $cache): void
            {
                $this->app->singleton(AssistantServiceInterface::class, $configure['assistant'] ?? AssistantService::class);
                $this->app->singleton(AtmServiceInterface::class, $configure['atm'] ?? AtmService::class);
                $this->app->singleton(AtomicServiceInterface::class, $configure['atomic'] ?? AtomicService::class);
        Severity: Major
        Found in src/WalletServiceProvider.php - About 2 hrs to fix

          Method payFreeCart has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function payFreeCart(CartInterface $cart): array
              {
                  $atomicService = app(AtomicServiceInterface::class);
                  $eagerLoaderService = app(EagerLoaderServiceInterface::class);
                  $basketService = app(BasketServiceInterface::class);
          Severity: Minor
          Found in src/Traits/CartPay.php - About 2 hrs to fix

            Method assemblers has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Confirmed

                private function assemblers(array $configure): void
                {
                    $this->app->singleton(
                        AvailabilityDtoAssemblerInterface::class,
                        $configure['availability'] ?? AvailabilityDtoAssembler::class
            Severity: Minor
            Found in src/WalletServiceProvider.php - About 1 hr to fix

              Method create has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Confirmed

                      int $depositId,
                      int $withdrawId,
                      string $status,
                      Model $fromModel,
                      Model $toModel,
              Severity: Major
              Found in src/Internal/Assembler/TransferDtoAssemblerInterface.php - About 1 hr to fix

                Method create has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Confirmed

                        Wallet $fromWallet,
                        Wallet $toWallet,
                        int $discount,
                        string $fee,
                        TransactionDtoInterface $withdrawDto,
                Severity: Major
                Found in src/Internal/Assembler/TransferLazyDtoAssembler.php - About 1 hr to fix

                  Method create has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Confirmed

                          Wallet $fromWallet,
                          Wallet $toWallet,
                          int $discount,
                          string $fee,
                          TransactionDtoInterface $withdrawDto,
                  Severity: Major
                  Found in src/Internal/Assembler/TransferLazyDtoAssemblerInterface.php - About 1 hr to fix

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

                            Wallet $from,
                            WalletModel $fromWallet,
                            Wallet $to,
                            WalletModel $toWallet,
                            string $status,
                    Severity: Major
                    Found in src/Services/PrepareServiceInterface.php - About 50 mins to fix

                      Method create has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Confirmed

                              Model $payable,
                              int $walletId,
                              string $type,
                              float|int|string $amount,
                              bool $confirmed,
                      Severity: Major
                      Found in src/Internal/Assembler/TransactionDtoAssemblerInterface.php - About 50 mins to fix

                        Method withdraw has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Confirmed

                                Wallet $wallet,
                                float|int|string $amount,
                                ?array $meta,
                                bool $confirmed = true,
                                ?string $uuid = null
                        Severity: Minor
                        Found in src/Services/PrepareServiceInterface.php - About 35 mins to fix

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

                                  Wallet $wallet,
                                  string $type,
                                  float|int|string $amount,
                                  ?array $meta,
                                  bool $confirmed = true
                          Severity: Minor
                          Found in src/Services/TransactionServiceInterface.php - About 35 mins to fix

                            Method deposit has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Confirmed

                                    Wallet $wallet,
                                    float|int|string $amount,
                                    ?array $meta,
                                    bool $confirmed = true,
                                    ?string $uuid = null
                            Severity: Minor
                            Found in src/Services/PrepareServiceInterface.php - About 35 mins to fix

                              Method transferLazy has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Confirmed

                                      Wallet $from,
                                      Wallet $to,
                                      string $status,
                                      float|int|string $amount,
                                      ExtraDtoInterface|array|null $meta = null
                              Severity: Minor
                              Found in src/Services/PrepareServiceInterface.php - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language