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

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.

application/models/Submission.php (5 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 app\models;
4
5
use app\properties\AbstractModel;
6
use app\properties\HasProperties;
7
use Yii;
8
use yii\data\ActiveDataProvider;
9
use yii\helpers\ArrayHelper;
10
11
/**
12
 * This is the model class for table "submission".
13
 * @property integer $id
14
 * @property integer $form_id
15
 * @property string $date_received
16
 * @property string $ip
17
 * @property string $user_agent
18
 * @property string $piwik_visitor_id
19
 * @property string $additional_information
20
 * @property string $date_viewed
21
 * @property string $date_processed
22
 * @property integer $processed_by_user_id
23
 * @property integer $processed
24
 * @property string $internal_comment
25
 * @property string $submission_referrer
26
 * @property string $visitor_referrer
27
 * @property string $visitor_landing
28
 * @property string $visit_start_date
29
 * @property integer $form_fill_time
30
 * @property integer $is_deleted
31
 * @property bool $spam
32
 * @property int $sending_status
33
 * @property AbstractModel $abstractModel
34
 * @property Form $form
35
 */
36
class Submission extends \yii\db\ActiveRecord
37
{
38
    const STATUS_NEW = 0;
39
    const STATUS_SUCCESS = 1;
40
    const STATUS_ERROR = -1;
41
    const STATUS_HOPELESS_ERROR = -2;
42
    const STATUS_FATAL_ERROR = -3;
43
44
    protected $subject = null;
45
46
    /**
47
     * @return null
0 ignored issues
show
Should the return type not be string?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
48
     */
49
    public function getSubject()
50
    {
51
        $message = $this->form->subject_template;
52
        $params = array_reduce(
53
            array_keys($this->abstractModel->getAttributes()),
54
            function ($arr, $i) {
55
                $arr['{'.$i.'}'] = $this->property($i);
0 ignored issues
show
The method property() does not exist on app\models\Submission. Did you maybe mean canGetProperty()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
56
                return $arr;
57
            },
58
            []
59
        );
60
        $params['{id}'] = $this->id;
61
        $params['{form_name}'] = $this->form->name;
62
        return strtr($message, $params);
63
64
    }
65
66
    /**
67
     * @param null $subject
68
     */
69
    public function setSubject($subject)
70
    {
71
        $this->subject = $subject;
72
    }
73
74
    /**
75
     * @inheritdoc
76
     */
77
    public static function tableName()
78
    {
79
        return '{{%submission}}';
80
    }
81
82
    /**
83
     * @inheritdoc
84
     */
85
    public function rules()
86
    {
87
        return [
88
            [['form_id'], 'required'],
89
            [
90
                ['form_id', 'processed_by_user_id', 'processed', 'form_fill_time', 'is_deleted', 'sending_status'],
91
                'integer'
92
            ],
93
            [['date_received', 'date_viewed', 'date_processed', 'visit_start_date'], 'safe'],
94
            [
95
                [
96
                    'ip',
97
                    'user_agent',
98
                    'piwik_visitor_id',
99
                    'additional_information',
100
                    'internal_comment',
101
                    'submission_referrer',
102
                    'visitor_referrer',
103
                    'visitor_landing'
104
                ],
105
                'string'
106
            ],
107
            [['spam'], 'integer']
108
        ];
109
    }
110
111
    public function behaviors()
112
    {
113
        return [
114
            [
115
                'class' => HasProperties::className(),
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
116
            ],
117
            [
118
                'class' => \devgroup\TagDependencyHelper\ActiveRecordHelper::className(),
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
119
            ],
120
        ];
121
    }
122
123
    /**
124
     * @inheritdoc
125
     */
126
    public function attributeLabels()
127
    {
128
        return [
129
            'id' => Yii::t('app', 'ID'),
130
            'form_id' => Yii::t('app', 'Form ID'),
131
            'date_received' => Yii::t('app', 'Date Received'),
132
            'ip' => Yii::t('app', 'Ip'),
133
            'user_agent' => Yii::t('app', 'User Agent'),
134
            'piwik_visitor_id' => Yii::t('app', 'Piwik Visitor ID'),
135
            'additional_information' => Yii::t('app', 'Additional Information'),
136
            'date_viewed' => Yii::t('app', 'Date Viewed'),
137
            'date_processed' => Yii::t('app', 'Date Processed'),
138
            'processed_by_user_id' => Yii::t('app', 'Processed By User ID'),
139
            'processed' => Yii::t('app', 'Processed'),
140
            'internal_comment' => Yii::t('app', 'Internal Comment'),
141
            'submission_referrer' => Yii::t('app', 'Submission Referrer'),
142
            'visitor_referrer' => Yii::t('app', 'Visitor Referrer'),
143
            'visitor_landing' => Yii::t('app', 'Visitor Landing'),
144
            'visit_start_date' => Yii::t('app', 'Visit Start Date'),
145
            'form_fill_time' => Yii::t('app', 'Form Fill Time'),
146
            'spam' => Yii::t('app', 'Spam Info'),
147
            'is_deleted' => Yii::t('app', 'Is deleted'),
148
            'sending_status' => Yii::t('app', 'Sending status'),
149
        ];
150
    }
151
152
    public function search($params, $form_id = null, $show_deleted = 0)
153
    {
154
        /* @var $query \yii\db\ActiveQuery */
155
        $query = self::find();
156
        if ($form_id != null) {
157
            $query->andWhere('form_id = :form_id', [':form_id' => $form_id]);
158
        }
159
160
        $query->andFilterWhere(['is_deleted' => $show_deleted]);
161
162
        $dataProvider = new ActiveDataProvider(
163
            [
164
                'query' => $query,
165
                'pagination' => [
166
                    'pageSize' => 10,
167
                ],
168
            ]
169
        );
170
        if (!($this->load($params))) {
171
            return $dataProvider;
172
        }
173
        $query->andFilterWhere(['id' => $this->id]);
174
        $query->andFilterWhere(['like', 'ip', $this->ip]);
175
        $query->andFilterWhere(['like', 'user_agent', $this->user_agent]);
176
        return $dataProvider;
177
    }
178
179
    public function getForm()
180
    {
181
        return $this->hasOne(Form::className(), ['id' => 'form_id']);
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
182
    }
183
184 View Code Duplication
    public static function getStatuses()
185
    {
186
        return [
187
            self::STATUS_NEW => Yii::t('app', 'New'),
188
            self::STATUS_SUCCESS => Yii::t('app', 'Success'),
189
            self::STATUS_ERROR => Yii::t('app', 'Error'),
190
            self::STATUS_FATAL_ERROR => Yii::t('app', 'Fatal error'),
191
            self::STATUS_HOPELESS_ERROR => Yii::t('app', 'Hopeless error'),
192
        ];
193
    }
194
}
195