Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function vote_get() |
||
18 | { |
||
19 | $logos = []; |
||
20 | |||
21 | if (\Auth::check()) { |
||
22 | $logos = \DB::table('logos') |
||
23 | ->leftJoin('logo_votes', 'logos.id', '=', 'logo_votes.logo_id') |
||
24 | ->leftJoin('users', 'logos.user_id', '=', 'users.id') |
||
25 | ->select(['logos.id', 'logos.filename', 'logos.title', 'users.name', 'logos.user_id']) |
||
26 | ->whereNotExists(function ($query) { |
||
27 | $query->select(\DB::raw(1)) |
||
28 | ->from('logo_votes') |
||
29 | ->whereRaw('logo_votes.logo_id = logos.id') |
||
30 | ->whereRaw('logo_votes.user_id = '.\Auth::id()); |
||
31 | }) |
||
32 | ->inRandomOrder() |
||
33 | ->first(); |
||
34 | |||
35 | } |
||
36 | |||
37 | return view('logo.index', ['logos' => $logos]); |
||
38 | } |
||
39 | |||
60 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.