hnhdigital-os/laravel-frontend-assets

View on GitHub
src/Dropzone.php

Summary

Maintainability
A
45 mins
Test Coverage

Showing 3 of 3 total issues

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

public function __construct($version = false)
Severity: Minor
Found in src/Dropzone.php by phpmd

The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$version = FrontendAsset::version(class_basename(__CLASS__), $version);
FrontendAsset::add('https://cdnjs.cloudflare.com/ajax/libs/dropzone/'.$version.'/min/dropzone.min.js');
FrontendAsset::add('vendor/dropzone.css');
}
Severity: Minor
Found in src/Dropzone.php by phpmd

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (!config('hnhdigital.assets.cdn', true)) {
FrontendAsset::add('vendor/dropzone.js');
FrontendAsset::add('vendor/dropzone.css');
} else {
$version = FrontendAsset::version(class_basename(__CLASS__), $version);
Severity: Minor
Found in src/Dropzone.php and 1 other location - About 45 mins to fix
src/Steps.php on lines 14..21
Category
Status