This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * rmarchiv.tk |
||
5 | * (c) 2016-2017 by Marcel 'ryg' Hering |
||
6 | */ |
||
7 | |||
8 | namespace App\Http\Controllers; |
||
9 | |||
10 | use Illuminate\Http\Request; |
||
11 | use App\Models\GamesSavegame; |
||
12 | |||
13 | class SavegameController extends Controller |
||
14 | { |
||
15 | public function index($gamefileid) |
||
0 ignored issues
–
show
|
|||
16 | { |
||
17 | } |
||
18 | |||
19 | public function show($gamefileid, $slotid) |
||
0 ignored issues
–
show
|
|||
20 | { |
||
21 | } |
||
22 | |||
23 | public function api_load($gamefileid) |
||
24 | { |
||
25 | //Load Savegame Data from Database |
||
26 | $savegames = GamesSavegame::whereGamefileId($gamefileid) |
||
27 | ->where('user_id', '=', \Auth::id()) |
||
28 | ->get(); |
||
29 | |||
30 | $ret = []; |
||
31 | |||
32 | foreach ($savegames as $s) { |
||
33 | $ret[$s->slot_id] = $s->save_data; |
||
34 | } |
||
35 | |||
36 | return response()->json($ret); |
||
37 | } |
||
38 | |||
39 | public function api_save(Request $request, $gamefileid) |
||
0 ignored issues
–
show
|
|||
40 | { |
||
41 | $payLoad = json_decode(request()->getContent(), true); |
||
42 | |||
43 | \Log::info('savegamecount: '.count($payLoad)); |
||
44 | |||
45 | foreach ($payLoad as $key=>$value) { |
||
46 | \Log::info('slot: '.$key); |
||
47 | \Log::info('data: '.$value); |
||
48 | $save = GamesSavegame::where([ |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 22 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
49 | 'user_id' => $user = \Auth::id(), |
||
50 | 'gamefile_id' => $gamefileid, |
||
51 | 'slot_id' => $key, |
||
52 | ]) |
||
53 | ->first(); |
||
54 | |||
55 | View Code Duplication | if (! $save) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
56 | $s = new GamesSavegame(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 14 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
57 | $s->save_data = $value; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
58 | $s->slot_id = $key; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
59 | $s->gamefile_id = $gamefileid; |
||
60 | $s->user_id = \Auth::id(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
61 | $s->save(); |
||
62 | \Log::info('created'); |
||
63 | } else { |
||
64 | $save->save_data = $value; |
||
65 | $save->save(); |
||
66 | \Log::info('updated'); |
||
67 | } |
||
68 | } |
||
69 | } |
||
70 | |||
71 | public function api_save_slot(Request $request, $gamefileid, $slot) |
||
0 ignored issues
–
show
|
|||
72 | { |
||
73 | $value = request()->getContent(); |
||
74 | $key = $slot; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
75 | |||
76 | \Log::info('slot: '.$key); |
||
77 | \Log::info('data: '.$value); |
||
78 | $save = GamesSavegame::where([ |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 22 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
79 | 'user_id' => $user = \Auth::id(), |
||
80 | 'gamefile_id' => $gamefileid, |
||
81 | 'slot_id' => $key, |
||
82 | ]) |
||
83 | ->first(); |
||
84 | |||
85 | View Code Duplication | if (! $save) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
86 | $s = new GamesSavegame(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 14 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
87 | $s->save_data = $value; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
88 | $s->slot_id = $key; |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
89 | $s->gamefile_id = $gamefileid; |
||
90 | $s->user_id = \Auth::id(); |
||
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
91 | $s->save(); |
||
92 | \Log::info('created'); |
||
93 | } else { |
||
94 | $save->save_data = $value; |
||
95 | $save->save(); |
||
96 | \Log::info('updated'); |
||
97 | } |
||
98 | } |
||
99 | } |
||
100 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.