chitoku-k/HomoChecker

View on GitHub

Showing 39 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

                    The class HomoProvider has a coupling between objects value of 30. Consider to reduce the number of dependencies under 13.
                    Open

                    final class HomoProvider extends ServiceProvider
                    {
                    protected string $format = AccessLog::FORMAT_COMBINED . ' "%{X-Forwarded-For}i"';
                     
                    #[\Override]
                    Severity: Minor
                    Found in api/src/Providers/HomoProvider.php by phpmd

                    The class HomoAppProvider has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13.
                    Open

                    final class HomoAppProvider extends ServiceProvider
                    {
                    #[\Override]
                    public function register()
                    {
                    Severity: Minor
                    Found in api/src/Providers/HomoAppProvider.php by phpmd

                    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

                      Missing class import via use statement (line '37', column '83').
                      Open

                      set_error_handler(fn ($severity, $message, $filename, $line) => throw new \ErrorException($message, 0, $severity, $filename, $line));
                      Severity: Minor
                      Found in api/src/Http/RequestSigner.php by phpmd

                      Missing class import via use statement (line '23', column '83').
                      Open

                      set_error_handler(fn ($severity, $message, $filename, $line) => throw new \ErrorException($message, 0, $severity, $filename, $line));

                      Missing class import via use statement (line '31', column '26').
                      Open

                      $xpath = new \DOMXPath($doc);

                      Missing class import via use statement (line '47', column '23').
                      Open

                      throw new \RuntimeException('Signing request failed', 0, $e);
                      Severity: Minor
                      Found in api/src/Http/RequestSigner.php by phpmd

                      The method withFileDownload has a boolean flag argument $contentType, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                      public function withFileDownload($file, ?string $name = null, $contentType = true): static
                      Severity: Minor
                      Found in api/src/Http/ErrorResponse.php by phpmd

                      Missing class import via use statement (line '23', column '26').
                      Open

                      $date = (new \DateTimeImmutable())->format(\DateTimeImmutable::RFC7231);
                      Severity: Minor
                      Found in api/src/Http/RequestSigner.php by phpmd

                      The method withFile has a boolean flag argument $contentType, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                      public function withFile($file, $contentType = true): static
                      Severity: Minor
                      Found in api/src/Http/ErrorResponse.php by phpmd
                      Severity
                      Category
                      Status
                      Source
                      Language