chitoku-k/HomoChecker

View on GitHub

Showing 12 of 39 total issues

Response has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Response implements ResponseInterface
{
/**
* @var float The total time.
*/
Severity: Minor
Found in api/src/Contracts/Service/Client/Response.php - About 2 hrs to fix

    Method validateAsync has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    private function validateAsync(Homo $homo): PromiseInterface
    {
    $url = $homo->getUrl();
    if (!$url) {
    throw new \InvalidArgumentException('Invalid URL');
    Severity: Major
    Found in api/src/Service/CheckService.php - About 2 hrs to fix

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

      #[\Override]
      public function register()
      {
      $this->app->extend(AccessLog::class, fn (AccessLog $log) => $log->format($this->format));
      $this->app->when(AccessLog::class)
      Severity: Major
      Found in api/src/Providers/HomoProvider.php - About 2 hrs to fix

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

        #[\Override]
        public function register()
        {
        $this->app->singleton(RegistryInterface::class, CollectorRegistry::class);
        $this->app->when(CollectorRegistry::class)
        Severity: Minor
        Found in api/src/Providers/HomoMetricsProvider.php - About 1 hr to fix

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

          #[\Override]
          public function register()
          {
          $this->app->singleton(WebFingerAction::class);
          $this->app->singleton(ActivityPubActorAction::class);
          Severity: Minor
          Found in api/src/Providers/HomoAppProvider.php - About 1 hr to fix

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

            #[\Override]
            public function register()
            {
            $this->app->singleton('mastodon.client', function (Container $app) {
            $handler = HandlerStack::create();
            Severity: Minor
            Found in api/src/Providers/HomoProfileServiceProvider.php - About 1 hr to fix

              Method createStatusAsync has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              private function createStatusAsync(Homo $homo, ?callable $callback = null): PromiseInterface
              {
              return Coroutine::of(function () use ($homo, $callback) {
              $service = $homo->getService();
              $screen_name = $homo->getScreenName();
              Severity: Minor
              Found in api/src/Service/CheckService.php - About 1 hr to fix

                Function validateAsync has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                private function validateAsync(Homo $homo): PromiseInterface
                {
                $url = $homo->getUrl();
                if (!$url) {
                throw new \InvalidArgumentException('Invalid URL');
                Severity: Minor
                Found in api/src/Service/CheckService.php - About 1 hr to fix

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

                private function sign(Request $request): Request
                {
                $requestTarget = strtolower($request->getMethod()) . ' ' . $request->getRequestTarget();
                if (!$date = $request->getHeaderLine('Date')) {
                $date = (new \DateTimeImmutable())->format(\DateTimeImmutable::RFC7231);
                Severity: Minor
                Found in api/src/Http/RequestSigner.php - About 1 hr to fix

                  Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  protected ClientServiceContract $client,
                  protected HomoServiceContract $homo,
                  protected Counter $checkCounter,
                  protected Counter $checkErrorCounter,
                  protected Collection $profiles,
                  Severity: Minor
                  Found in api/src/Service/CheckService.php - About 45 mins to fix

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

                    public function __invoke(Request $request, \Throwable $exception, bool $displayErrorDetails, bool $logErrors, bool $logErrorDetails): Response
                    Severity: Minor
                    Found in api/src/Handlers/ErrorHandler.php - About 35 mins to fix

                      Function createDisplayURL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      private function createDisplayURL(?string $url, bool $scheme = false): string
                      {
                      if (!$url) {
                      return '';
                      }
                      Severity: Minor
                      Found in api/src/Domain/Status.php - About 25 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language