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.

protected/extensions/onflyedit/OnFlyEditAction.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
 * @author Nikita Melnikov <[email protected]>
4
 * @author Vladimir Utenkov <[email protected]>
5
 * @link https://github.com/shogodev/argilla/
6
 * @copyright Copyright &copy; 2003-2014 Shogo
7
 * @license http://argilla.ru/LICENSE
8
 */
9
/**
10
 * Класс для работы с полями из контроллера необходимо добавить в метод CController::actions()
11
 */
12
class OnFlyEditAction extends CAction
13
{
14
  /**
15
   * Объект модели
16
   *
17
   * @var BActiveRecord
18
   */
19
  protected $model;
20
21
  /**
22
   * PK записи в базе
23
   *
24
   * @var int
25
   */
26
  protected $id;
27
28
  /**
29
   * Название поля в базе / свойства модели
30
   *
31
   * @var string
32
   */
33
  protected $field;
34
35
  /**
36
   * Новое значение для свойства модели
37
   *
38
   * @var string
39
   */
40
  protected $value;
41
42
  public function run()
43
  {
44
    $request = Yii::app()->request;
45
    $id = $request->getPost('id');
46
    $field = $request->getPost('field');
47
    $value = $request->getPost('value');
48
    $gridId = Yii::app()->request->getPost('gridId');
49
50
    if( !empty($id) && !empty($field) && isset($value) )
51
    {
52
      $this->init($id, $field, $value, $gridId)->process();
53
    }
54
  }
55
56
  /**
57
   * Присваивание нового значения для выбранной модели, с заданным полем и ID
58
   *
59
   * @throws CHttpException Бросается в случае ошибки при сохранении модели.
60
   */
61
  protected function process()
62
  {
63
    $field = $this->field;
64
65
    $this->model->setAttributes(array($field => $this->value));
66
67
    if( $this->model->save() )
68
    {
69
      if( Yii::app()->request->isAjaxRequest )
70
      {
71
        echo $this->model->$field;
72
      }
73
    }
74
    else
75
    {
76
      throw new CHttpException(500, implode("; ", $this->model->getErrors($field)));
77
    }
78
  }
79
80
  /**
81
   * Инициализация свойств
82
   *
83
   * @param $id
84
   * @param $field
85
   * @param $value
86
   * @param $gridId
87
   *
88
   * @return OnFlyEditAction
89
   */
90
  protected function init($id, $field, $value, $gridId)
91
  {
92
    $this->id    = $id;
93
    $this->field = $field;
94
    $this->value = $value;
95
96
    if( !empty($gridId) )
97
    {
98
      $this->model = $this->parseGridId($gridId)->findByPk($this->id);
99
    }
100
    else
101
      $this->model = $this->controller->loadModel($this->id);
102
103
    return $this;
104
  }
105
106
  /**
107
   * @param $gridId
108
   *
109
   * @return BActiveRecord
110
   */
111 1
  protected function parseGridId($gridId)
112
  {
113 1
    $model = null;
0 ignored issues
show
$model is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
114
115 1
    if( preg_match("/(\w+)_(\w+)-(\w+)$/U", $gridId, $matches) )
116 1
    {
117 1
      $model = $matches[1];
0 ignored issues
show
Bug Compatibility introduced by
The expression $matches[1]; of type string adds the type string to the return on line 132 which is incompatible with the return type documented by OnFlyEditAction::parseGridId of type BActiveRecord.
Loading history...
118 1
      $table = $matches[2];
119 1
      $type  = $matches[3];
120
121 1
      if( $type === 'files' && isset(Yii::app()->db->schema->tables[Yii::app()->db->tablePrefix.$table]) )
122 1
      {
123 1
        $model = new UploadModel($table);
124 1
      }
125 1
    }
126
    else
127
    {
128 1
      $model = preg_replace("/-.*/", "", $gridId);
129 1
      $model = new $model;
130
    }
131
132 1
    return $model;
133
  }
134
}