PreviewController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A show() 0 9 2
1
<?php
2
3
namespace Devpri\Tinre\Http\Controllers;
4
5
use Devpri\Tinre\Models\Url;
6
use Illuminate\Http\Request;
7
8
class PreviewController extends Controller
9
{
10 2
    public function show(Request $request, $path)
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

10
    public function show(/** @scrutinizer ignore-unused */ Request $request, $path)

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...
11
    {
12 2
        $url = URL::select(['long_url', 'path', 'created_at'])->where(['path' => $path, 'active' => 1])->first();
13
14 2
        if (! $url) {
15 1
            return redirect('/');
16
        }
17
18 1
        return view('tinre::preview', ['url' => $url]);
19
    }
20
}
21