Issues (101)

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/Migrations/Version20200214041355.php (4 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
declare(strict_types=1);
4
5
namespace DoctrineMigrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20200214041355 extends AbstractMigration
14
{
15
    protected $seasons = [
16
        ['number' => 83, 'startDate' => '2014-09-01 00:00:00', 'endDate' => '2015-07-31 23:59:59'],
17
        ['number' => 84, 'startDate' => '2015-09-01 00:00:00', 'endDate' => '2016-07-31 23:59:59'],
18
        ['number' => 85, 'startDate' => '2016-09-01 00:00:00', 'endDate' => '2017-07-31 23:59:59'],
19
        ['number' => 86, 'startDate' => '2017-09-01 00:00:00', 'endDate' => '2018-07-31 23:59:59'],
20
        ['number' => 87, 'startDate' => '2018-09-01 00:00:00', 'endDate' => '2019-07-31 23:59:59'],
21
        ['number' => 88, 'startDate' => '2019-09-01 00:00:00', 'endDate' => '2020-07-31 23:59:59'],
22
        ['number' => 89, 'startDate' => '2020-09-01 00:00:00', 'endDate' => '2021-07-31 23:59:59'],
23
        ['number' => 90, 'startDate' => '2021-09-01 00:00:00', 'endDate' => '2022-07-31 23:59:59'],
24
        ['number' => 91, 'startDate' => '2022-09-01 00:00:00', 'endDate' => '2023-07-31 23:59:59'],
25
        ['number' => 92, 'startDate' => '2023-09-01 00:00:00', 'endDate' => '2024-07-31 23:59:59'],
26
        ['number' => 93, 'startDate' => '2024-09-01 00:00:00', 'endDate' => '2025-07-31 23:59:59'],
27
        ['number' => 94, 'startDate' => '2025-09-01 00:00:00', 'endDate' => '2026-07-31 23:59:59'],
28
        ['number' => 95, 'startDate' => '2026-09-01 00:00:00', 'endDate' => '2027-07-31 23:59:59'],
29
        ['number' => 96, 'startDate' => '2027-09-01 00:00:00', 'endDate' => '2028-07-31 23:59:59'],
30
        ['number' => 97, 'startDate' => '2028-09-01 00:00:00', 'endDate' => '2029-07-31 23:59:59'],
31
        ['number' => 98, 'startDate' => '2029-09-01 00:00:00', 'endDate' => '2030-07-31 23:59:59'],
32
        ['number' => 99, 'startDate' => '2030-09-01 00:00:00', 'endDate' => '2031-07-31 23:59:59'],
33
    ];
34
35
    public function getDescription() : string
36
    {
37
        return '';
38
    }
39
40 View Code Duplication
    public function up(Schema $schema) : void
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...
41
    {
42
        // this up() migration is auto-generated, please modify it to your needs
43
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
44
45
        $this->addSql('CREATE TABLE RepertoireSeason (id INT AUTO_INCREMENT NOT NULL, startDate DATETIME NOT NULL, endDate DATETIME NOT NULL, number INT NOT NULL, UNIQUE INDEX UNIQ_C9FDBB996901F54 (number), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
46
        $this->addSql('CREATE TABLE performance_repertoireseason (performance_id INT NOT NULL, repertoireseason_id INT NOT NULL, INDEX IDX_58AE5ABFB91ADEEE (performance_id), INDEX IDX_58AE5ABFAC76615 (repertoireseason_id), PRIMARY KEY(performance_id, repertoireseason_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
47
        $this->addSql('ALTER TABLE performance_repertoireseason ADD CONSTRAINT FK_58AE5ABFB91ADEEE FOREIGN KEY (performance_id) REFERENCES performances (id) ON DELETE CASCADE');
48
        $this->addSql('ALTER TABLE performance_repertoireseason ADD CONSTRAINT FK_58AE5ABFAC76615 FOREIGN KEY (repertoireseason_id) REFERENCES RepertoireSeason (id) ON DELETE CASCADE');
49
50
        $this->insertSeasons();
51
        $this->addSeasonsToPerformances();
52
    }
53
54
    protected function addSeasonsToPerformances()
55
    {
56
        $file = __DIR__.'/data/theatreSeasons.csv';
57
        $performanceSeasons = $csv = array_map('str_getcsv', file($file));
0 ignored issues
show
$csv 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...
58
        $keys = array_shift($performanceSeasons);
0 ignored issues
show
$keys 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...
59
60
        foreach ($performanceSeasons as $performance) {
61
            $pId = array_shift($performance);
62
            $title = array_shift($performance);
0 ignored issues
show
$title 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...
63
64
            $psId = 6;
65
            while (!empty($performance)) {
66
                if (1 == array_shift($performance)) {
67
                    $this->addSql(
68
                        'INSERT INTO performance_repertoireseason (performance_id, repertoireseason_id) VALUES (:pId, :psId)',
69
                        ['pId' => $pId, 'psId' => $psId]
70
                    );
71
                }
72
                $psId--;
73
            }
74
        }
75
76
    }
77
78
    protected function insertSeasons()
79
    {
80
        foreach ($this->seasons as $season) {
81
            $this->addSql('INSERT INTO RepertoireSeason (startDate, endDate, number) VALUES (:startDate, :endDate, :number)', $season);
82
        }
83
    }
84
85
    public function down(Schema $schema) : void
86
    {
87
        // this down() migration is auto-generated, please modify it to your needs
88
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
89
90
        $this->addSql('ALTER TABLE performance_repertoireseason DROP FOREIGN KEY FK_58AE5ABFAC76615');
91
        $this->addSql('DROP TABLE RepertoireSeason');
92
        $this->addSql('DROP TABLE performance_repertoireseason');
93
    }
94
}
95