DashboardController   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 3
dl 0
loc 76
rs 10
c 0
b 0
f 0
ccs 0
cts 34
cp 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 11 1
A tasks() 0 4 1
A number() 0 12 1
A createRandom() 0 6 1
A graph() 0 8 1
A fetchActivityFeed() 0 4 1
1
<?php
2
3
namespace Scool\EnrollmentMobile\Http\Controllers;
4
5
//use App\Activity;
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
6
//use App\Task;
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Http\Request;
9
use Illuminate\Support\Facades\Cache;
10
use Scool\EnrollmentMobile\Models\Activity;
11
12
/**
13
 * Class DashboardController
14
 * @package App\Http\Controllers
15
 */
16
class DashboardController extends Controller
17
{
18
    //
19
    /**
20
     *
21
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
22
     */
23
    public function index()
24
    {
25
        $data = [];
26
27
        $data['labels1'] = "['January', 'February', 'March', 'April', 'May', 'June', 'July']";
28
        $data['values1'] = "[10, 42, 4, 23, 43, 54]";
29
30
        $data['labels2'] = "['January', 'February', 'March', 'April', 'May', 'June', 'July']";
31
        $data['values2'] = "[10, 42, 4, 23, 43, 54]";
32
        return view('enrollment_mobile::dashboard.dashboard', $data);
33
    }
34
35
    /**
36
     * @param $model
37
     * @return mixed
38
     */
39
    public function tasks($model)
40
    {
41
        return $model::all();
42
    }
43
44
    /**
45
     * @param $model
46
     * @return mixed
47
     */
48
    public function number($model)
49
    {
50
        //        $value = Cache::remember('tasksNumber',5, function () use ($model){
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
51
            //Codi a executar si cache MISS
52
//            return DB::table()->get();
53
// $this?
54
            $model='\\Scool\EnrollmentMobile\Models\\'.ucfirst($model);
55
        return $model::all()->count();
56
//        });
57
58
//        return $value;
59
    }
60
61
    /**
62
     * @param $model
63
     */
64
    public function createRandom($model)
65
    {
66
        //        $model='\\Scool\EnrollmentMobile\Models\\'.ucfirst($model);
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
67
        $model='Scool\\EnrollmentMobile\\Models\\'.ucfirst($model);
68
        factory($model)->create();
69
    }
70
71
    /**
72
     * @param $id
73
     * @return array
74
     */
75
    public function graph($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
76
    {
77
        $data = [];
78
        $data['labels'] = ['Pepe', 'Maria', 'Pedo', 'April', 'May', 'Abdul', 'Mare'];
79
        $data['values'] = [10, 42, 4, 23, 43, 54];
80
81
        return $data;
82
    }
83
84
    /**
85
     * @return mixed
86
     */
87
    public function fetchActivityFeed()
88
    {
89
        return Activity::all();
90
    }
91
}
92