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

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.

backend/protected/widgets/RowGridWidget.php (1 issue)

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
 * @author Alexey Tatarinov <[email protected]>
4
 * @link https://github.com/shogodev/argilla/
5
 * @copyright Copyright &copy; 2003-2014 Shogo
6
 * @license http://argilla.ru/LICENSE
7
 */
8
9
/**
10
 * Class RowGridWidget
11
 */
12
abstract class RowGridWidget extends CWidget
13
{
14
  public $modelName;
15
16
  public $modelId;
17
18
  public $modelAttribute;
19
20
  public $urlRoute;
21
22
  public $header = 'Заголовок';
23
24
  public $templateButtonColumn = '{update} {delete}';
25
26
  public $urlCreate;
27
28
  public $urlEdit;
29
30
  public $urlDelete;
31
32
  private $updateSelectors = array();
33
34
  /**
35
   * @return array
36
   */
37
  abstract protected function getColumns();
38
39
  public function init()
40
  {
41
    if( is_null($this->modelName) )
42
      throw new CHttpException(500, 'Укажите свойство modelName для виджета '.__CLASS__);
43
44
    if( is_null($this->modelAttribute) )
45
      throw new CHttpException(500, 'Укажите свойство modelAttribute для виджета '.__CLASS__);
46
47
    if( is_null($this->urlRoute) && (is_null($this->urlCreate) || is_null($this->urlEdit) || is_null($this->urlDelete)) )
48
      throw new CHttpException(500, 'Укажите свойство urlRoute для виджета '.__CLASS__);
49
    else
50
    {
51
      if( is_null($this->urlCreate) )
52
        $this->urlCreate = $this->controller->createUrl($this->urlRoute.'/create', array('model_id' => $this->modelId, 'popup' => true));
53
54
      if( is_null($this->urlEdit) )
55
        $this->urlEdit = 'Yii::app()->controller->createUrl("'.$this->urlRoute.'/update", array("id" => $data->primaryKey, "popup" => true))';
56
57
      if( is_null($this->urlDelete) )
58
        $this->urlDelete = 'Yii::app()->controller->createUrl("'.$this->urlRoute.'/delete", array("id" => $data->primaryKey))';
59
    }
60
  }
61
62 View Code Duplication
  public function run()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
63
  {
64
    if( !$this->isAvailable() )
65
      return;
66
67
    echo '<tr><th><label>'.$this->header.'</label></th><td>';
68
    $this->renderButton();
69
    $this->renderGrid();
70
    echo '</td></tr>';
71
  }
72
73
  /**
74
   * @return BActiveRecord $model
75
   */
76
  protected function getModel()
77
  {
78
    /**
79
     * @var BActiveRecord $model
80
     */
81
    $modelName = $this->modelName;
82
    $model = $modelName::model();
83
    $model->setAttribute($this->modelAttribute, $this->modelId);
84
85
    return $model;
86
  }
87
88
  private function renderButton()
89
  {
90
    $buttonId = $this->getId().'_add_button';
91
92
    echo CHtml::openTag('div', array('class' => 's-buttons s-buttons-top'));
93
    $this->widget('BButton', array(
94
      'htmlOptions' => array('id' => $buttonId),
95
      'label' => 'Добавить',
96
      'url' => $this->urlCreate,
97
      'type' => 'info',
98
      'popupDepended' => true,
99
    ));
100
    echo CHtml::closeTag('div');
101
102
    $this->addUpdateSelector('#'.$buttonId);
103
  }
104
105
  private function renderGrid()
106
  {
107
    $this->controller->widget('BGridView', array(
108
      'id' => $this->getId(),
109
      'dataProvider' => $this->getModel()->search(),
110
      'template' => "{items}\n{pager}\n{scripts}",
111
      'filter' => $this->getModel(),
112
      'columns' => CMap::mergeArray($this->getColumns(), $this->getColumnButtons())
113
    ));
114
115
    $this->registerUpdateScript();
116
  }
117
118
  /**
119
   * @return array
120
   */
121
  protected function getColumnButtons()
122
  {
123
    $updateButtonClass = $this->getId().'_update_button';
124
    $this->addUpdateSelector('.'.$updateButtonClass);
125
126
    return array(
127
      array(
128
        'class' => 'BButtonColumn',
129
        'template' => $this->templateButtonColumn,
130
        'updateButtonUrl' => $this->urlEdit,
131
        'updateButtonOptions' => array('class' => 'update '.$updateButtonClass),
132
        'deleteButtonUrl' => $this->urlDelete
133
      )
134
    );
135
  }
136
137
  private function registerUpdateScript()
138
  {
139
    Yii::app()->clientScript->registerScript($this->getId().'_grid_update_script', "
140
      jQuery(document).on('click', '".implode(', ', $this->updateSelectors)."', function(e) {
141
        e.preventDefault();
142
        assigner.open(this.href, {'updateGridId' : '{$this->getId()}'});
143
      });
144
    ");
145
  }
146
147
  private function addUpdateSelector($selector)
148
  {
149
    $this->updateSelectors[$selector] = $selector;
150
  }
151
152
  private function isAvailable()
153
  {
154
    return !$this->controller->popup && $this->controller->isUpdate();
155
  }
156
}