Showing 9 of 14 total issues
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
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
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
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
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
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
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
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
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
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return File::class;
Avoid too many return
statements within this method. Open
return $formatExist === $formatAsk;