Showing 13 of 14 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
private function afterUploadFile(BaseFile $baseFile) { if (!$this->afterUploadActions || !is_array($this->afterUploadActions)) { return $baseFile; }
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
private function beforeUploadFile(UploadedFile $file): UploadedFile { if (!$this->beforeUploadActions || !is_array($this->beforeUploadActions)) { return $file; }
- Read upRead up
Method up
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up(): void { Schema::create(config('files.table.name'), function (Blueprint $table): void { $typeId = config('files.table.id');
Function beforeUploadFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function beforeUploadFile(UploadedFile $file): UploadedFile { if (!$this->beforeUploadActions || !is_array($this->beforeUploadActions)) { return $file; }
- Read upRead up
Function mimeIs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function mimeIs(string $mimeExist, string $mimeAsk): bool { if (empty($mimeExist) || empty($mimeAsk)) { return false; }
- Read upRead up
Function afterUploadFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function afterUploadFile(BaseFile $baseFile) { if (!$this->afterUploadActions || !is_array($this->afterUploadActions)) { return $baseFile; }
- Read upRead up
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle($model, ... $options) { if ($this->width !== null && $this->height !== null) { if ($this->bestFit) { $model->getImageProcessor()->resizeToBestFit($this->width, $this->height, ...$options);
- Read upRead up
Function up
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function up(): void { Schema::create(config('files.table.name'), function (Blueprint $table): void { $typeId = config('files.table.id');
- Read upRead up
Avoid too many return
statements within this method. Open
return File::class;
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function isAudio() { if ($this->isMime('audio')) { return true; }
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function isVideo() { if ($this->isMime('video')) { return true; }
- Read upRead up
Avoid too many return
statements within this method. Open
return $formatExist === $formatAsk;
Avoid too many return
statements within this method. Open
return true;