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/ViewObject.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 Yii;
6
use yii\caching\TagDependency;
7
use yii\db\ActiveRecord;
8
9
/**
10
 * This is the model class for table "view_object".
11
 *
12
 * @property integer $id
13
 * @property integer $object_id
14
 * @property integer $object_model_id
15
 * @property integer $view_id
16
 * @property integer $child_view_id
17
 */
18
class ViewObject extends ActiveRecord
19
{
20
    /**
21
     * @inheritdoc
22
     */
23
    public static function tableName()
24
    {
25
        return '{{%view_object}}';
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31
    public function rules()
32
    {
33
        return [
34
            [['view_id', 'child_view_id'], 'default', 'value' => 1],
35
            [['object_id', 'object_model_id', 'view_id', 'child_view_id'], 'required'],
36
            [['object_id', 'object_model_id', 'view_id', 'child_view_id'], 'integer']
37
        ];
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function attributeLabels()
44
    {
45
        return [
46
            'id' => Yii::t('app', 'ID'),
47
            'object_id' => Yii::t('app', 'Object ID'),
48
            'object_model_id' => Yii::t('app', 'Object Model ID'),
49
            'view_id' => Yii::t('app', 'View'),
50
            'child_view_id' => Yii::t('app', 'Child view')
51
        ];
52
    }
53
54
    /**
55
     * Поиск представления по модели
56
     *
57
     * @param BaseObject $model
0 ignored issues
show
Should the type for parameter $model not be BaseObject|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
58
     * @return string|null Возвращает имя файла или null, если ничего не найдено
59
     */
60
    public static function getViewByModel($model = null, $childView = false)
61
    {
62
        if ((null === $model) || !is_object($model)) {
63
            return null;
64
        }
65
66
        if (null === $object = BaseObject::getForClass($model::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...
67
            return null;
68
        }
69
70
        $cacheKey = "View:Object:ModelId" . $object->id . ":" . $model->id;
71
        $viewObject = Yii::$app->cache->get($cacheKey);
72
        if ($viewObject === false) {
73
74
            $viewObject = static::find()
75
                ->where(
76
                    [
77
                        'object_id' => $object->id,
78
                        'object_model_id' => $model->id,
79
                    ]
80
                )->one();
81
82
        }
83
        if ($viewObject !== null) {
84
            Yii::$app->cache->set(
85
                $cacheKey,
86
                $viewObject,
87
                86400,
88
                new TagDependency([
89
                    'tags' => [
90
                        \devgroup\TagDependencyHelper\ActiveRecordHelper::getObjectTag($viewObject, $viewObject->id),
91
                        \devgroup\TagDependencyHelper\ActiveRecordHelper::getObjectTag($object, $object->id),
92
                        \devgroup\TagDependencyHelper\ActiveRecordHelper::getObjectTag($model, $model->id)
93
                    ]
94
                ])
95
            );
96
            return View::getViewById($childView ? $viewObject->child_view_id : $viewObject->view_id);
97
        } else {
98
            return null;
99
        }
100
101
    }
102
103
    /**
104
     * Поиск связи по модели
105
     *
106
     * @param \yii\db\ActiveRecord $model
0 ignored issues
show
Should the type for parameter $model not be ActiveRecord|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
107
     * @param boolean $forceDefault Флаг для принудительного возврата модели
108
     * @return \yii\db\ActiveRecord|null Возвращает модель или null, если ничего не найдено
0 ignored issues
show
Should the return type not be null|ActiveRecord|array? Also, consider making the array more specific, something like array<String>, or 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.

If the return type contains the type array, this check recommends the use of a more specific type like String[] or array<String>.

Loading history...
109
     */
110
    public static function getByModel($model = null, $forceDefault = false)
111
    {
112
        if ((null === $model) || !is_object($model)) {
113
            return null;
114
        }
115
116
        if (null === $object = BaseObject::getForClass($model::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...
117
            return null;
118
        }
119
120
        if (
121
            null === $result = static::find()->where(
122
                [
123
                    'object_id' => $object->id,
124
                    'object_model_id' => $model->id,
125
                ]
126
            )->one()
127
        ) {
128
            if ($forceDefault) {
129
                $result = new static;
130
                $result->object_id = $object->id;
131
                $result->object_model_id = $model->id;
132
                $result->view_id = 1;
133
                $result->child_view_id = 1;
134
            }
135
        }
136
137
        return $result;
138
    }
139
140
    public static function deleteByViewId($view_id = null)
141
    {
142
        if (null === $view_id) {
143
            return null;
144
        }
145
146
        return static::deleteAll(['view_id' => $view_id]);
147
    }
148
}
149