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/ServiceProvider.php (14 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 Plugin\[code]\ServiceProvider;
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '[', expecting T_STRING
Loading history...
13
14
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
15
use Monolog\Handler\FingersCrossedHandler;
16
use Monolog\Handler\RotatingFileHandler;
17
use Monolog\Logger;
18
use Plugin\[code]\Form\Type\[code]ConfigType;
19
use Silex\Application as BaseApplication;
20
use Silex\ServiceProviderInterface;
21
22
class [code]ServiceProvider implements ServiceProviderInterface
0 ignored issues
show
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...
23
{
24
25
    public function register(BaseApplication $app)
0 ignored issues
show
Missing function doc comment
Loading history...
26
    {
27
        // プラグイン用設定画面
28
        $app->match('/'.$app['config']['admin_route'].'/plugin/[code]/config', 'Plugin\[code]\Controller\ConfigController::index')->bind('plugin_[code]_config');
29
30
        // 独自コントローラ
31
        $app->match('/plugin/[lower_code]/hello', 'Plugin\[code]\Controller\[code]Controller::index')->bind('plugin_[code]_hello');
32
33
        // Form
34
        $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) {
35
            $types[] = new [code]ConfigType();
0 ignored issues
show
Use parentheses when instantiating classes
Loading history...
36
37
            return $types;
38
        }));
39
40
        // Repository
41
42
        // Service
43
44
        // メッセージ登録
45
        // $file = __DIR__ . '/../Resource/locale/message.' . $app['locale'] . '.yml';
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
41% 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...
46
        // $app['translator']->addResource('yaml', $file, $app['locale']);
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
80% 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...
47
48
        // load config
49
        // プラグイン独自の定数はconfig.ymlの「const」パラメータに対して定義し、$app['[lower_code]config']['定数名']で利用可能
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
59% 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...
50
        // if (isset($app['config']['[code]']['const'])) {
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
85% 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...
51
        //     $config = $app['config'];
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
60% 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...
52
        //     $app['[lower_code]config'] = $app->share(function () use ($config) {
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
63% 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...
53
        //         return $config['[code]']['const'];
0 ignored issues
show
Unused Code Comprehensibility introduced by アルベルト
82% 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
        //     });
55
        // }
56
57
        // ログファイル設定
58
        $app['monolog.logger.[lower_code]'] = $app->share(function ($app) {
59
60
            $logger = new $app['monolog.logger.class']('[lower_code]');
0 ignored issues
show
Use parentheses when instantiating classes
Loading history...
61
62
            $filename = $app['config']['root_dir'].'/app/log/[lower_code].log';
63
            $RotateHandler = new RotatingFileHandler($filename, $app['config']['log']['max_files'], Logger::INFO);
64
            $RotateHandler->setFilenameFormat(
65
                '[lower_code]_{date}',
66
                'Y-m-d'
67
            );
68
69
            $logger->pushHandler(
70
                new FingersCrossedHandler(
71
                    $RotateHandler,
72
                    new ErrorLevelActivationStrategy(Logger::ERROR),
73
                    0,
74
                    true,
75
                    true,
76
                    Logger::INFO
77
                )
78
            );
79
80
            return $logger;
81
        });
82
83
    }
84
85
    public function boot(BaseApplication $app)
0 ignored issues
show
Missing function doc comment
Loading history...
86
    {
87
    }
88
89
}
90