GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (174)

Security Analysis    not enabled

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/app/BackProjectServiceProvider.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 Afrittella\BackProject;
4
5
use Afrittella\BackProject\Models\Attachment;
6
use Afrittella\BackProject\Models\Observers\RemoveAttachableWheDeletingAttachment;
7
use Afrittella\BackProject\Models\Observers\RemoveFileWhenDeletingAttachment;
8
use Afrittella\BackProject\Models\Observers\SaveFileWhenAddingAttachment;
9
use Afrittella\BackProject\Services\MediaManager;
10
use Afrittella\BackProject\Services\BackProject;
11
use Afrittella\BackProject\Services\SlugGenerator;
12
use Illuminate\Support\ServiceProvider;
13
use Illuminate\Routing\Router;
14
use function Symfony\Component\HttpKernel\Tests\controller_func;
15
16
17
class BackProjectServiceProvider extends ServiceProvider
18
{
19
20
    protected $defer = false;
21
22
    protected $migrations = [
23
        'ModifyUsersTable' => 'modify_users_table',
24
        'CreateMenusTable' => 'create_menus_table',
25
        'CreateAttachmentsTable' => 'create_attachments_table',
26
        'CreateSocialAccountsTable' => 'create_social_accounts_table',
27
        'UsersAddSocial' => 'users_add_social'
28
    ];
29
30
    protected $helpers = [
31
        'icons'
32
    ];
33
34
    public function boot()
35
    {
36
        // LOAD THE VIEWS
37
        // - first the published views (in case they have any changes)
38
        $this->loadViewsFrom(resource_path('views/vendor/back-project/base'), 'back-project');
39
        // - then the stock views that come with the package, in case a published view might be missing
40
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'back-project');
41
        // Load Translations
42
        $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'back-project');
43
44
        // use the vendor configuration file as fallback
45
        $this->mergeConfigFrom(
46
            __DIR__ . '/../config/config.php', 'back-project'
47
        );
48
49
        $this->routes();
50
51
        $this->publishFiles();
52
53
        //$this->handleMigrations();
0 ignored issues
show
Unused Code Comprehensibility introduced by
84% 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...
54
        $this->loadMigrationsFrom(realpath(__DIR__.'/../database/migrations'));
55
56
        $this->registerEvents();
57
58
        $this->registerCommands();
59
60
        $this->registerViewComposers();
61
    }
62
63
    public function register()
64
    {
65
        $this->app->singleton('media-manager', 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...
66
            return new MediaManager();
67
        });
68
69
        // TODO
70
        /*$this->app->singleton('back-project', function ($app) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% 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...
71
            return new BackProject();
72
        });
73
74
        $this->app->singleton('slug-generator', function ($app) {
75
            return new SlugGenerator();
76
        });*/
77
78
        // register dependencies
79
        $this->app->register(\Prologue\Alerts\AlertsServiceProvider::class);
80
        $this->app->register(\Spatie\Permission\PermissionServiceProvider::class);
81
        $this->app->register(\PendoNL\LaravelFontAwesome\LaravelFontAwesomeServiceProvider::class);
82
        $this->app->register(\Collective\Html\HtmlServiceProvider::class);
83
        $this->app->register(\Laravolt\Avatar\ServiceProvider::class);
84
        $this->app->register(\Intervention\Image\ImageServiceProvider::class);
85
        $this->app->register(\Laravel\Socialite\SocialiteServiceProvider::class);
86
87
        // register their aliases
88
        $loader = \Illuminate\Foundation\AliasLoader::getInstance();
89
        $loader->alias('Alert', \Prologue\Alerts\Facades\Alert::class);
90
        $loader->alias('FontAwesome', \PendoNL\LaravelFontAwesome\Facade::class);
91
        $loader->alias('Form', \Collective\Html\FormFacade::class);
92
        $loader->alias('Html', \Collective\Html\HtmlFacade::class);
93
        $loader->alias('Avatar', \Laravolt\Avatar\Facade::class);
94
        $loader->alias('MediaManager', \Afrittella\BackProject\Facades\MediaManager::class);
95
        $loader->alias('SlugGenerator', \Afrittella\BackProject\Facades\SlugGenerator::class);
96
        $loader->alias('Image', \Intervention\Image\Facades\Image::class);
97
        $loader->alias('Socialite', \Laravel\Socialite\Facades\Socialite::class);
98
99
        $this->loadHelpers();
100
101
    }
102
103
    /*** Internal function ***/
104
105
    public function publishFiles()
106
    {
107
        // publish config file
108
        $this->publishes([__DIR__ . '/../config/config.php' => config_path() . '/back-project.php'], 'config');
109
        // publish lang files
110
        $this->publishes([__DIR__ . '/../resources/lang' => resource_path('lang/vendor/back-project')], 'lang');
111
        // publish public BackProject assets
112
        $this->publishes([__DIR__ . '/../public' => public_path('vendor/back-project')], 'public');
113
        // publish views
114
        $this->publishes([__DIR__ . '/../resources/views' => resource_path('views/vendor/back-project')], 'views');
115
        // publish error views
116
        $this->publishes([__DIR__ . '/../resources/error_views' => resource_path('views/errors')], 'errors');
117
        // publish public AdminLTE assets
118
        $this->publishes(['vendor/almasaeed2010/adminlte/bower_components/bootstrap/dist' => public_path('vendor/adminlte/bootstrap')], 'adminlte');
119
        $this->publishes(['vendor/almasaeed2010/adminlte/dist' => public_path('vendor/adminlte/dist')], 'adminlte');
120
        $this->publishes(['vendor/almasaeed2010/adminlte/plugins' => public_path('vendor/adminlte/plugins')], 'adminlte');
121
    }
122
123
    public function routes()
124
    {
125
        // Register Middleware
126
        $router = app('router');
0 ignored issues
show
$router is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
127
128
        //$router->aliasMiddleware('admin', \Afrittella\BackProject\Http\Middleware\Admin::class);
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% 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...
129
        //$router->aliasMiddleware('role', \Afrittella\BackProject\Http\Middleware\Role::class);
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% 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...
130
131
        $this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
132
    }
133
134
    public function handleMigrations()
135
    {
136
        foreach ($this->migrations as $class => $file) {
137
            if (!class_exists($class)) {
138
                $timestamp = date('Y_m_d_His', time());
139
140
                $this->publishes([
141
                    __DIR__ . '/../database/migrations/' . $file . '.php' =>
142
                        database_path('migrations/' . $timestamp . '_' . $file . '.php')
143
                ], 'migrations');
144
            }
145
        }
146
    }
147
148
    public function registerEvents()
149
    {
150
        // User notification can use queues or not
151
        if (config('back-project.use_queue')) {
152
            \Event::listen('Afrittella\BackProject\Events\UserRegistered', 'Afrittella\BackProject\Listeners\SendRegistrationEmail');
153
        } else {
154
            \Event::listen('Afrittella\BackProject\Events\UserRegistered', 'Afrittella\BackProject\Listeners\SendRegistrationEmailNoQueue');
155
        }
156
157
        // Register Observers
158
        Attachment::observe(SaveFileWhenAddingAttachment::class);
159
        Attachment::observe(RemoveFileWhenDeletingAttachment::class);
160
        Attachment::observe(RemoveAttachableWheDeletingAttachment::class);
161
    }
162
163
    public function registerCommands()
164
    {
165
        if ($this->app->runningInConsole()) {
166
            $this->commands([
167
                \Afrittella\BackProject\Console\Commands\SeedDefaultMenus::class,
168
                \Afrittella\BackProject\Console\Commands\SeedPermissions::class
169
            ]);
170
        }
171
    }
172
173
    public function registerViewComposers()
174
    {
175
        \View::composer(['back-project::layouts.admin'], 'Afrittella\BackProject\Http\ViewComposers\AdminMenuComposer');
176
        \View::composer(['back-project::layouts.admin'], 'Afrittella\BackProject\Http\ViewComposers\UserComposer');
177
    }
178
179
    public function loadHelpers()
180
    {
181
        foreach ($this->helpers as $helper):
182
            $file = __DIR__ . '/Helpers/' . $helper . '.php';
183
184
            if (file_exists($file)) {
185
                require_once($file);
186
            }
187
        endforeach;
188
    }
189
190
}
191