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/backend/components/ActionColumn.php (2 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\backend\components;
4
5
use Closure;
6
use kartik\icons\Icon;
7
use Yii;
8
use yii\grid\Column;
9
use yii\helpers\ArrayHelper;
10
use yii\helpers\Html;
11
use yii\helpers\Url;
12
use app\backend\components\Helper;
13
14
class ActionColumn extends Column
15
{
16
    public $buttons;
17
18
    private $defaultButtons = [];
19
20
    private $callbackButtons;
21
22
    /**
23
     * @var string the ID of the controller that should handle the actions specified here.
24
     * If not set, it will use the currently active controller. This property is mainly used by
25
     * [[urlCreator]] to create URLs for different actions. The value of this property will be prefixed
26
     * to each action name to form the route of the action.
27
     */
28
    public $controller;
29
    /**
30
     * @var callable a callback that creates a button URL using the specified model information.
31
     * The signature of the callback should be the same as that of [[createUrl()]].
32
     * If this property is not set, button URLs will be created using [[createUrl()]].
33
     */
34
    public $urlCreator;
35
36
    public $url_append = '';
37
38
    public $appendReturnUrl = true;
39
40
    public function init()
41
    {
42
        parent::init();
43
44
        $this->defaultButtons = [
45
            [
46
                'url' => 'edit',
47
                'icon' => 'pencil',
48
                'class' => 'btn-primary',
49
                'label' => Yii::t('app', 'Edit'),
50
            ],
51
            [
52
                'url' => 'delete',
53
                'icon' => 'trash-o',
54
                'class' => 'btn-danger',
55
                'label' => Yii::t('app', 'Delete'),
56
                'options' => [
57
                    'data-action' => 'delete',
58
                ],
59
            ]
60
        ];
61
62
63
        if (null === $this->buttons) {
64
            $this->buttons = $this->defaultButtons;
65
        } elseif ($this->buttons instanceof Closure) {
66
            $this->callbackButtons = $this->buttons;
67
        }
68
    }
69
70
    /**
71
     * Creates a URL for the given action and model.
72
     * This method is called for each button and each row.
73
     * @param string $action the button name (or action ID)
74
     * @param \yii\db\ActiveRecord $model the data model
75
     * @param mixed $key the key associated with the data model
76
     * @param integer $index the current row index
77
     * @param bool $appendReturnUrl custom return url for each button
0 ignored issues
show
Should the type for parameter $appendReturnUrl not be boolean|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...
78
     * @param string $url_append custom append url for each button
0 ignored issues
show
Should the type for parameter $url_append not be string|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...
79
     * @param string $keyParam custom param if $key is string
80
     * @param array $attrs list of model attributes used in route params
81
     * @return string the created URL
82
     */
83
    public function createUrl(
84
        $action,
85
        $model,
86
        $key,
87
        $index,
88
        $appendReturnUrl = null,
89
        $url_append = null,
90
        $keyParam = 'id',
91
        $attrs = []
92
    ) {
93
        if ($this->urlCreator instanceof Closure) {
94
            return call_user_func($this->urlCreator, $action, $model, $key, $index);
95
        } else {
96
            $params = [];
97
            if (is_array($key)) {
98
                $params = $key;
99
            } else {
100
                if (is_null($keyParam) === false) {
101
                    $params = [$keyParam => (string)$key];
102
                }
103
            }
104
            $params[0] = $this->controller ? $this->controller . '/' . $action : $action;
105
            foreach ($attrs as $attrName) {
106
                if ($attrName === 'model') {
107
                    $params['model'] = $model;
108
                } elseif ($attrName === 'mainCategory.category_group_id' && $model->getMainCategory()) {
109
                    $params['category_group_id'] = $model->getMainCategory()->category_group_id;
110
                } else {
111
                    $params[$attrName] = $model->getAttribute($attrName);
112
                }
113
            }
114
            if (is_null($appendReturnUrl) === true) {
115
                $appendReturnUrl = $this->appendReturnUrl;
116
            }
117
            if (is_null($url_append) === true) {
118
                $url_append = $this->url_append;
119
            }
120
            if ($appendReturnUrl) {
121
                $params['returnUrl'] = Helper::getReturnUrl();
122
            }
123
            return Url::toRoute($params) . $url_append;
124
        }
125
    }
126
127
128
    protected function renderDataCellContent($model, $key, $index)
129
    {
130
        if ($this->callbackButtons instanceof Closure) {
131
            $btns = call_user_func($this->callbackButtons, $model, $key, $index, $this);
132
            if (null === $btns) {
133
                $this->buttons = $this->defaultButtons;
134
            } else {
135
                $this->buttons = $btns;
136
            }
137
        }
138
        $min_width = count($this->buttons) * 34; //34 is button-width
139
        $data = Html::beginTag('div', ['class' => 'btn-group', 'style' => 'min-width: ' . $min_width . 'px']);
140
        foreach ($this->buttons as $button) {
141
            $appendReturnUrl = ArrayHelper::getValue($button, 'appendReturnUrl', $this->appendReturnUrl);
142
            $url_append = ArrayHelper::getValue($button, 'url_append', $this->url_append);
143
            $keyParam = ArrayHelper::getValue($button, 'keyParam', 'id');
144
            $attrs = ArrayHelper::getValue($button, 'attrs', []);
145
            Html::addCssClass($button, 'btn');
146
            Html::addCssClass($button, 'btn-sm');
147
            $buttonText = isset($button['text']) ? ' ' . $button['text'] : '';
148
            $data .= Html::a(
149
                    Icon::show($button['icon']) . $buttonText,
150
                    $url = $this->createUrl(
151
                        $button['url'],
152
                        $model,
153
                        $key,
154
                        $index,
155
                        $appendReturnUrl,
156
                        $url_append,
157
                        $keyParam,
158
                        $attrs
159
                    ),
160
                    ArrayHelper::merge(
161
                        isset($button['options']) ? $button['options'] : [],
162
                        [
163
                            'class' => $button['class'],
164
                            'title' => $button['label'],
165
                        ]
166
                    )
167
                ) . ' ';
168
        }
169
        $data .= '</div>';
170
        return $data;
171
    }
172
}
173