DashboardController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A dashboard() 0 14 3
1
<?php
2
3
namespace Pratiksh\Adminetic\Http\Controllers\Admin;
4
5
use App\Http\Controllers\Controller;
0 ignored issues
show
Bug introduced by
The type App\Http\Controllers\Controller was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Exception;
7
8
class DashboardController extends Controller
9
{
10
    public function dashboard()
11
    {
12
        $view = null;
13
        $dashboard = \App\Services\MyDashboard::class;
0 ignored issues
show
Bug introduced by
The type App\Services\MyDashboard was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
        if (class_exists($dashboard)) {
15
            if (method_exists($dashboard, 'view')) {
16
                $my_dashboard = new $dashboard;
17
                $view = $my_dashboard->view();
18
            } else {
19
                throw new Exception('view method is not found', 1);
20
            }
21
        }
22
23
        return $view ?? view('adminetic::admin.dashboard.index');
24
    }
25
}
26