fisharebest/webtrees

View on GitHub
app/Factories/ImageFactory.php

Summary

Maintainability
A
3 hrs
Test Coverage

Method mediaFileThumbnailResponse has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function mediaFileThumbnailResponse(
        MediaFile $media_file,
        int $width,
        int $height,
        string $fit,
Severity: Minor
Found in app/Factories/ImageFactory.php - About 1 hr to fix

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

            MediaFile $media_file,
            int $width,
            int $height,
            string $fit,
            bool $add_watermark
    Severity: Minor
    Found in app/Factories/ImageFactory.php - About 35 mins to fix

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

              FilesystemOperator $filesystem,
              string $path,
              int $width,
              int $height,
              string $fit
      Severity: Minor
      Found in app/Factories/ImageFactory.php - About 35 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $this
                        ->replacementImageResponse(text: (string) StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR)
                        ->withHeader('x-thumbnail-exception', get_class(object: $ex) . ': ' . $ex->getMessage());
        Severity: Major
        Found in app/Factories/ImageFactory.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $this->replacementImageResponse(text: (string) StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR)
                          ->withHeader('x-image-exception', $ex->getMessage());
          Severity: Major
          Found in app/Factories/ImageFactory.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status