Progress   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 13 2
1
<?php
2
3
namespace App\Http\Controllers\Gedcom;
4
5
use App\Http\Controllers\Controller;
6
use App\ImportJob;
7
use Auth;
8
use Illuminate\Http\Request;
9
10
class Progress extends Controller
11
{
12
    //
13
    public function index(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

13
    public function index(/** @scrutinizer ignore-unused */ Request $request)

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

Loading history...
14
    {
15
        $user_id = Auth::user()->id;
0 ignored issues
show
Bug introduced by
Accessing id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
16
        $runningjob = ImportJob::orderby('id', 'DESC')->first();
17
        $slug = null;
18
        if ($runningjob != null) {
19
            $slug = $runningjob->slug;
20
        }
21
        $ret = [];
22
        $ret['slug'] = $slug;
23
        $ret['user'] = $user_id;
24
25
        return $ret;
26
    }
27
}
28