hnhdigital-os/laravel-resources-loader

View on GitHub
src/Assets/Pace.php

Summary

Maintainability
A
55 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/Assets/Pace.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 = Resource::version(class_basename(__CLASS__), $version);
Resource::add('https://cdnjs.cloudflare.com/ajax/libs/pace/'.$version.'/pace.min.js');
}
Severity: Minor
Found in src/Assets/Pace.php by phpmd

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

<?php
 
namespace Bluora\LaravelResourcesLoader\Assets;
 
use Resource;
Severity: Minor
Found in src/Assets/Pace.php and 1 other location - About 55 mins to fix
src/Assets/FlotTooltip.php on lines 1..18
Category
Status