Issues (37)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/ProgramKeahlianServiceProvider.php (6 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Bantenprov\ProgramKeahlian;
4
5
use Illuminate\Support\ServiceProvider;
6
use Bantenprov\ProgramKeahlian\Console\Commands\ProgramKeahlianCommand;
7
8
/**
9
 * The ProgramKeahlianServiceProvider class
10
 *
11
 * @package Bantenprov\ProgramKeahlian
12
 * @author  bantenprov <[email protected]>
13
 */
14
class ProgramKeahlianServiceProvider extends ServiceProvider
15
{
16
    /**
17
     * Indicates if loading of the provider is deferred.
18
     *
19
     * @var bool
20
     */
21
    protected $defer = false;
22
23
    /**
24
     * Bootstrap the application events.
25
     *
26
     * @return void
27
     */
28
    public function boot()
29
    {
30
        $this->routeHandle();
31
        $this->configHandle();
32
        $this->langHandle();
33
        $this->viewHandle();
34
        $this->assetHandle();
35
        $this->migrationHandle();
36
        $this->publicHandle();
37
        $this->seedHandle();
38
        $this->publishHandle();
39
    }
40
41
    /**
42
     * Register the service provider.
43
     *
44
     * @return void
45
     */
46
    public function register()
47
    {
48
        $this->app->singleton('program-keahlian', function ($app) {
0 ignored issues
show
The parameter $app is not used and could be removed.

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

Loading history...
49
            return new ProgramKeahlian;
50
        });
51
52
        $this->app->singleton('command.program-keahlian', function ($app) {
0 ignored issues
show
The parameter $app is not used and could be removed.

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

Loading history...
53
            return new ProgramKeahlianCommand;
54
        });
55
56
        $this->commands('command.program-keahlian');
57
    }
58
59
    /**
60
     * Get the services provided by the provider.
61
     *
62
     * @return array
63
     */
64
    public function provides()
65
    {
66
        return [
67
            'program-keahlian',
68
            'command.program-keahlian',
69
        ];
70
    }
71
72
    /**
73
     * Loading and publishing package's config
74
     *
75
     * @return void
76
     */
77
    protected function configHandle($publish = '')
78
    {
79
        $packageConfigPath = __DIR__.'/config';
80
        $appConfigPath     = config_path('bantenprov/program-keahlian');
81
82
        $this->mergeConfigFrom($packageConfigPath.'/program-keahlian.php', 'program-keahlian');
83
84
        $this->publishes([
85
            $packageConfigPath.'/program-keahlian.php' => $appConfigPath.'/program-keahlian.php',
86
        ], $publish ? $publish : 'program-keahlian-config');
87
    }
88
89
    /**
90
     * Loading package routes
91
     *
92
     * @return void
93
     */
94
    protected function routeHandle()
95
    {
96
        $this->loadRoutesFrom(__DIR__.'/routes/routes.php');
97
    }
98
99
    /**
100
     * Loading and publishing package's translations
101
     *
102
     * @return void
103
     */
104 View Code Duplication
    protected function langHandle($publish = '')
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.

Loading history...
105
    {
106
        $packageTranslationsPath = __DIR__.'/resources/lang';
107
108
        $this->loadTranslationsFrom($packageTranslationsPath, 'program-keahlian');
109
110
        $this->publishes([
111
            $packageTranslationsPath => resource_path('lang/vendor/program-keahlian'),
112
        ], $publish ? $publish : 'program-keahlian-lang');
113
    }
114
115
    /**
116
     * Loading and publishing package's views
117
     *
118
     * @return void
119
     */
120 View Code Duplication
    protected function viewHandle($publish = '')
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.

Loading history...
121
    {
122
        $packageViewsPath = __DIR__.'/resources/views';
123
124
        $this->loadViewsFrom($packageViewsPath, 'program-keahlian');
125
126
        $this->publishes([
127
            $packageViewsPath => resource_path('views/vendor/program-keahlian'),
128
        ], $publish ? $publish : 'program-keahlian-views');
129
    }
130
131
    /**
132
     * Publishing package's assets (JavaScript, CSS, images...)
133
     *
134
     * @return void
135
     */
136
    protected function assetHandle($publish = '')
137
    {
138
        $packageAssetsPath = __DIR__.'/resources/assets';
139
140
        $this->publishes([
141
            $packageAssetsPath => resource_path('assets'),
142
        ], $publish ? $publish : 'program-keahlian-assets');
143
    }
144
145
    /**
146
     * Publishing package's migrations
147
     *
148
     * @return void
149
     */
150
    protected function migrationHandle($publish = '')
151
    {
152
        $packageMigrationsPath = __DIR__.'/database/migrations';
153
154
        $this->loadMigrationsFrom($packageMigrationsPath);
155
156
        $this->publishes([
157
            $packageMigrationsPath => database_path('migrations')
158
        ], $publish ? $publish : 'program-keahlian-migrations');
159
    }
160
161
    /**
162
     * Publishing package's publics (JavaScript, CSS, images...)
163
     *
164
     * @return void
165
     */
166
    public function publicHandle($publish = '')
167
    {
168
        $packagePublicPath = __DIR__.'/public';
169
170
        $this->publishes([
171
            $packagePublicPath => base_path('public')
172
        ], $publish ? $publish : 'program-keahlian-public');
173
    }
174
175
    /**
176
     * Publishing package's seeds
177
     *
178
     * @return void
179
     */
180
    public function seedHandle($publish = '')
181
    {
182
        $packageSeedPath = __DIR__.'/database/seeds';
183
184
        $this->publishes([
185
            $packageSeedPath => base_path('database/seeds')
186
        ], $publish ? $publish : 'program-keahlian-seeds');
187
    }
188
189
    /**
190
     * Publishing package's all files
191
     *
192
     * @return void
193
     */
194
    public function publishHandle()
195
    {
196
        $publish = 'program-keahlian-publish';
197
198
        $this->routeHandle($publish);
0 ignored issues
show
The call to ProgramKeahlianServiceProvider::routeHandle() has too many arguments starting with $publish.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
199
        $this->configHandle($publish);
200
        $this->langHandle($publish);
201
        $this->viewHandle($publish);
202
        $this->assetHandle($publish);
203
        // $this->migrationHandle($publish);
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
204
        $this->publicHandle($publish);
205
        $this->seedHandle($publish);
206
    }
207
}
208