hnhdigital-os/laravel-resources-loader

View on GitHub

Showing 7 of 83 total issues

Function controller has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

public function controller($file_extensions, $file)
{
// Only look in a single file extension folder.
if (!is_array($file_extensions)) {
$file_extensions = [$file_extensions];
Severity: Minor
Found in src/Resource.php - About 2 hrs to fix

Function loadFile has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

public function loadFile($file_name, $extension, $full_path = '')
{
if (array_has(config('rev-manifest', []), $file_name) || (!empty($full_path) && file_exists($full_path))) {
if (env('APP_ASSET_INLINE', false)) {
if (!isset($this->loaded_inline[$full_path])) {
Severity: Minor
Found in src/Resource.php - About 1 hr to fix

Method controller has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function controller($file_extensions, $file)
{
// Only look in a single file extension folder.
if (!is_array($file_extensions)) {
$file_extensions = [$file_extensions];
Severity: Minor
Found in src/Resource.php - About 1 hr to fix

    Function elixir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    public function elixir($file)
    {
    if (substr($file, 0, 4) === 'http') {
    return $file;
    }
    Severity: Minor
    Found in src/Resource.php - About 35 mins to fix

    Avoid too many return statements within this method.
    Open

    return '';
    Severity: Major
    Found in src/Resource.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

      return '/assets/'.$file;
      Severity: Major
      Found in src/Resource.php - About 30 mins to fix

        Function loadContainer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        private static function loadContainer($class_settings, $config = [])
        {
        if (is_array($class_settings)) {
        $asset_name = array_shift($class_settings);
        } else {
        Severity: Minor
        Found in src/Resource.php - About 25 mins to fix
        Severity
        Category
        Status
        Source
        Language