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 (46)

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/Console/Commands/ModuleSeedCommand.php (3 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 Caffeinated\Modules\Console\Commands;
4
5
use Caffeinated\Modules\Modules;
6
use Illuminate\Console\Command;
7
use Symfony\Component\Console\Input\InputArgument;
8
use Symfony\Component\Console\Input\InputOption;
9
10
class ModuleSeedCommand extends Command
11
{
12
    /**
13
     * The console command name.
14
     *
15
     * @var string
16
     */
17
    protected $name = 'module:seed';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Seed the database with records for a specific or all modules';
25
26
    /**
27
     * @var Modules
28
     */
29
    protected $module;
30
31
    /**
32
     * Create a new command instance.
33
     *
34
     * @param Modules $module
35
     */
36
    public function __construct(Modules $module)
37
    {
38
        parent::__construct();
39
40
        $this->module = $module;
41
    }
42
43
    /**
44
     * Execute the console command.
45
     *
46
     * @return mixed
47
     */
48 View Code Duplication
    public function fire()
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...
49
    {
50
        $slug = $this->argument('slug');
51
52
        if (isset($slug)) {
53
            if (!$this->module->exists($slug)) {
54
                return $this->error('Module does not exist.');
55
            }
56
57
            if ($this->module->isEnabled($slug)) {
58
                $this->seed($slug);
59
            } elseif ($this->option('force')) {
60
                $this->seed($slug);
61
            }
62
63
            return;
64
        } else {
65
            if ($this->option('force')) {
66
                $modules = $this->module->all();
67
            } else {
68
                $modules = $this->module->enabled();
69
            }
70
71
            foreach ($modules as $module) {
72
                $this->seed($module['slug']);
73
            }
74
        }
75
    }
76
77
    /**
78
     * Seed the specific module.
79
     *
80
     * @param string $module
0 ignored issues
show
There is no parameter named $module. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
81
     *
82
     * @return array
83
     */
84
    protected function seed($slug)
85
    {
86
        $module        = $this->module->where('slug', $slug)->first();
87
        $params        = [];
88
        $namespacePath = $this->module->getNamespace();
89
        $rootSeeder    = $module['namespace'].'DatabaseSeeder';
90
        $fullPath      = $namespacePath.'\\'.$module['namespace'].'\Database\Seeds\\'.$rootSeeder;
91
92
        if (class_exists($fullPath)) {
93
            if ($this->option('class')) {
94
                $params['--class'] = $this->option('class');
95
            } else {
96
                $params['--class'] = $fullPath;
97
            }
98
99
            if ($option = $this->option('database')) {
100
                $params['--database'] = $option;
101
            }
102
103
            if ($option = $this->option('force')) {
104
                $params['--force'] = $option;
105
            }
106
107
            $this->call('db:seed', $params);
108
        }
109
    }
110
111
    /**
112
     * Get the console command arguments.
113
     *
114
     * @return array
115
     */
116
    protected function getArguments()
117
    {
118
        return [['slug', InputArgument::OPTIONAL, 'Module slug.']];
119
    }
120
121
    /**
122
     * Get the console command options.
123
     *
124
     * @return array
125
     */
126 View Code Duplication
    protected function getOptions()
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...
127
    {
128
        return [
129
            ['class', null, InputOption::VALUE_OPTIONAL, 'The class name of the module\'s root seeder.'],
130
            ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to seed.'],
131
            ['force', null, InputOption::VALUE_NONE, 'Force the operation to run while in production.'],
132
        ];
133
    }
134
}
135