nutgram/laravel

View on GitHub

Showing 6 of 6 total issues

Method resolveMessageListener has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function resolveMessageListener(string $signature): string
    {
        $subHandlerSignature = Str::after($signature, 'message.');
        $subHandlerName = explode('.', $subHandlerSignature)[0] ?? null;

Severity: Major
Found in src/Console/ListCommand.php - About 2 hrs to fix

    Method register has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function register()
        {
            $this->telegramRoutes = $this->app->basePath('routes/telegram.php');
    
            $this->mergeConfigFrom(self::CONFIG_PATH, 'nutgram');
    Severity: Minor
    Found in src/NutgramServiceProvider.php - About 1 hr to fix

      Method handle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function handle(Nutgram $bot): int
          {
              $webhookInfo = $bot->getWebhookInfo();
      
              if ($webhookInfo === null) {
      Severity: Minor
      Found in src/Console/HookInfoCommand.php - About 1 hr to fix

        Method boot has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function boot(): void
            {
                $this->loadViewsFrom(__DIR__.'/../resources/views/logging', 'logging');
        
                if ($this->app->runningInConsole()) {
        Severity: Minor
        Found in src/NutgramServiceProvider.php - About 1 hr to fix

          Method resolveUpdateListener has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function resolveUpdateListener(string $signature): string
              {
                  return match (Str::before($signature, '.')) {
                      'message' => $this->resolveMessageListener($signature),
                      'edited_message' => 'onEditedMessage',
          Severity: Minor
          Found in src/Console/ListCommand.php - About 1 hr to fix

            Avoid too many return statements within this method.
            Open

                    return 'unknown';
            Severity: Major
            Found in src/Console/ListCommand.php - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language