hnhdigital-os/laravel-frontend-assets

View on GitHub
src/Flot.php

Summary

Maintainability
A
2 hrs
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/Flot.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/flot/'.$version.'/jquery.flot.min.js');
FrontendAsset::add('https://cdnjs.cloudflare.com/ajax/libs/flot/'.$version.'/jquery.flot.resize.min.js');
}
Severity: Minor
Found in src/Flot.php by phpmd

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

<?php
 
namespace HnhDigital\LaravelFrontendAssets;
 
use FrontendAsset;
Severity: Major
Found in src/Flot.php and 1 other location - About 2 hrs to fix
src/MetisMenu.php on lines 1..22
Category
Status