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.
1 | <?php |
||||
2 | |||||
3 | namespace Bantenprov\LaravelOpd; |
||||
4 | |||||
5 | use Bantenprov\LaravelOpd\Models\LaravelOpdModel; |
||||
6 | use Illuminate\Http\Request; |
||||
0 ignored issues
–
show
|
|||||
7 | /** |
||||
8 | * The LaravelOpd class. |
||||
9 | * |
||||
10 | * @package Bantenprov\LaravelOpd |
||||
11 | * @author bantenprov <[email protected]> |
||||
12 | */ |
||||
13 | class LaravelOpd |
||||
14 | { |
||||
15 | protected $opd_model; |
||||
16 | |||||
17 | public function __construct() |
||||
18 | { |
||||
19 | $this->opd_model = new LaravelOpdModel(); |
||||
20 | } |
||||
21 | |||||
22 | public function welcome() |
||||
23 | { |
||||
24 | return 'Welcome to Bantenprov\LaravelOpd package'; |
||||
25 | } |
||||
26 | |||||
27 | public function index() |
||||
28 | { |
||||
29 | return $opds = LaravelOpdModel::all(); |
||||
0 ignored issues
–
show
|
|||||
30 | |||||
31 | //return view('unit_kerja.index',compact('opds')); |
||||
32 | |||||
33 | } |
||||
34 | |||||
35 | public function tree() |
||||
36 | { |
||||
37 | $nodes = LaravelOpdModel::get()->toTree(); |
||||
38 | |||||
39 | View Code Duplication | $traverse = function ($categories, $prefix = '-') use (&$traverse) { |
|||
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. ![]() |
|||||
40 | foreach ($categories as $category) { |
||||
41 | echo $prefix.' '.$category->kunker.' - '.$category->name.'<br>'; |
||||
42 | |||||
43 | $traverse($category->children, $prefix.'-'); |
||||
44 | } |
||||
45 | }; |
||||
46 | |||||
47 | return $traverse($nodes); |
||||
48 | } |
||||
49 | |||||
50 | public function createRoot() |
||||
51 | { |
||||
52 | |||||
53 | return view('unit_kerja.create-root'); |
||||
0 ignored issues
–
show
The function
view was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
54 | } |
||||
55 | |||||
56 | public function createChild() |
||||
57 | { |
||||
58 | return $unit_kerjas = LaravelOpdModel::all(); |
||||
0 ignored issues
–
show
|
|||||
59 | |||||
60 | //return view('unit_kerja.create-child',compact('unit_kerjas')); |
||||
61 | } |
||||
62 | |||||
63 | public function addChild($id) |
||||
64 | { |
||||
65 | return $unit_kerja = LaravelOpdModel::where('id',$id)->first(); |
||||
0 ignored issues
–
show
|
|||||
66 | |||||
67 | //return view('unit_kerja.add-child',compact('unit_kerja')); |
||||
68 | } |
||||
69 | |||||
70 | View Code Duplication | public function storeRoot($request = array()) |
|||
0 ignored issues
–
show
This method seems to be duplicated in 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. ![]() |
|||||
71 | { |
||||
72 | $check_root = LaravelOpdModel::where('id',$request->root); |
||||
73 | |||||
74 | if($check_root->first()->isEmpty()) |
||||
75 | { |
||||
76 | |||||
77 | $unit_kerja = LaravelOpdModel::create([ |
||||
0 ignored issues
–
show
|
|||||
78 | 'kunker' => $request->kunker, |
||||
79 | 'kunker_simral' => '', |
||||
80 | 'name' => $request->name, |
||||
81 | 'levelunker' => $request->levelunker, |
||||
82 | ]); |
||||
83 | } |
||||
84 | else |
||||
85 | { |
||||
86 | return redirect()->back(); |
||||
0 ignored issues
–
show
The function
redirect was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
87 | } |
||||
88 | |||||
89 | |||||
90 | |||||
91 | return redirect()->back(); |
||||
92 | } |
||||
93 | |||||
94 | View Code Duplication | public function storeChild($request = array()) |
|||
0 ignored issues
–
show
This method seems to be duplicated in 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. ![]() |
|||||
95 | { |
||||
96 | $check_root = LaravelOpdModel::where('id',$request->root); |
||||
97 | |||||
98 | $check_root->first()->children()->create([ |
||||
99 | 'kunker' => $request->c_kunker, |
||||
100 | 'kunker_simral' => '', |
||||
101 | 'name' => $request->c_name, |
||||
102 | 'levelunker' => $request->c_levelunker, |
||||
103 | ]); |
||||
104 | |||||
105 | return redirect()->back(); |
||||
0 ignored issues
–
show
The function
redirect was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
106 | } |
||||
107 | } |
||||
108 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths