Issues (2366)

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.

generatortemplate/MigrationVersionSupport.php (8 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
/*
4
 * This file is part of the [code]
5
 *
6
 * Copyright (C) [year] [author]
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace DoctrineMigrations;
13
14
use Doctrine\DBAL\Migrations\AbstractMigration;
15
use Doctrine\DBAL\Schema\Schema;
16
use Doctrine\ORM\EntityManager;
17
use Doctrine\ORM\Tools\SchemaTool;
18
use Eccube\Application;
19
use Eccube\Common\Constant;
20
21
class Version[datetime] extends AbstractMigration
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '[', expecting '{'
Loading history...
Missing class doc comment
Loading history...
This class is not in CamelCase format.

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
Expected 0 spaces between "datetime" and comma; 1 found
Loading history...
22
{
23
    protected $entities = array(
0 ignored issues
show
Add a comma after each item in a multi-line array
Loading history...
24
[entityList]
25
    );
26
27
    /**
28
     * @param Schema $schema
29
     */
30
    public function up(Schema $schema)
31
    {
32
        // this up() migration is auto-generated, please modify it to your needs
33
34
        if (version_compare(Constant::VERSION, '3.0.9', '>=')) {
35
            // 3.0.9 以降の場合、dcm.ymlの定義からテーブル生成を行う.
36
            $app = Application::getInstance();
37
            $meta = $this->getMetadata($app['orm.em']);
38
            $tool = new SchemaTool($app['orm.em']);
39
            $tool->createSchema($meta);
40
        } else {
41
            // 3.0.0 - 3.0.8
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
50% 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...
42
[createTable]
43
        }
44
    }
45
46
    /**
47
     * @param Schema $schema
48
     */
49
    public function down(Schema $schema)
50
    {
51
        // this down() migration is auto-generated, please modify it to your needs
52
53
        if (version_compare(Constant::VERSION, '3.0.9', '>=')) {
54
            // 3.0.9 以降の場合、dcm.ymlの定義からテーブル/シーケンスの削除を行う
55
            $app = Application::getInstance();
56
            $meta = $this->getMetadata($app['orm.em']);
57
58
            $tool = new SchemaTool($app['orm.em']);
59
            $schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
60
61
            // テーブル削除
62
            foreach ($schemaFromMetadata->getTables() as $table) {
63
                if ($schema->hasTable($table->getName())) {
64
                    $schema->dropTable($table->getName());
65
                }
66
            }
67
68
            // シーケンス削除
69
            foreach ($schemaFromMetadata->getSequences() as $sequence) {
70
                if ($schema->hasSequence($sequence->getName())) {
71
                    $schema->dropSequence($sequence->getName());
72
                }
73
            }
74
        } else {
75
            // 3.0.0 - 3.0.8
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
50% 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...
76
[dropTable]
77
        }
78
    }
79
80
    /**
81
     * @param EntityManager $em
82
     * @return array
83
     * @throws \Doctrine\Common\Persistence\Mapping\MappingException
84
     */
85
    protected function getMetadata(EntityManager $em)
86
    {
87
        $meta = array();
88
        foreach ($this->entities as $entity) {
89
            $meta[] = $em->getMetadataFactory()->getMetadataFor($entity);
90
        }
91
92
        return $meta;
93
    }
94
95
[createFunction]
0 ignored issues
show
Space found before square bracket; expected "}[" but found "}

["
Loading history...
96
}
97