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/components/BBreadcrumbsManager.php (1 issue)

Labels
Severity

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
 * @link https://github.com/shogodev/argilla/
5
 * @copyright Copyright &copy; 2003-2014 Shogo
6
 * @license http://argilla.ru/LICENSE
7
 * @package backend.components
8
 *
9
 * Для использования необходимо в шаблоне вызвать метод show().
10
 * Хлебные крошки автоматически сформируются в зависимости от модуля, контроллера, действия и модели
11
 *
12
 * Пример:
13
 * <pre>
14
 *   Yii::app()->breadcrumbs->show();
15
 * </pre>
16
 */
17
class BBreadcrumbsManager
18
{
19
  /**
20
   * @var string
21
   */
22
  public static $indexName = 'index';
23
24
  /**
25
   * @var BModule
26
   */
27
  private $module;
28
29
  /**
30
   * @var BController
31
   */
32
  private $controller;
33
34
  /**
35
   * @var BController
36
   */
37
  private $defaultModuleController;
38
39
  /**
40
   * @var array
41
   */
42
  private $breadcrumbs = array();
43
44
  /**
45
   * Есть ли возможность вырезать ссылку на стандартный контроллер,
46
   * ставится в true только, если появляются похожие части хлебных крошек
47
   * (одинаковое название DefaultController::Controller)
48
   *
49
   * @var boolean
50
   */
51
  private $canCutDefaultControllerLink = false;
52
53
  public function init()
54
  {
55
    try
56
    {
57
      if( !(Yii::app()->controller->module instanceof BModule) )
58
        return;
59
60
      $this->controller = Yii::app()->controller;
61
62
      $this->initModel();
63
      $this->initDefaultController();
64
      $this->initBreadcrumbs();
65
    }
66
    catch( Exception $e )
67
    {
68
      Yii::log($e->getMessage(), CLogger::LEVEL_ERROR, 'Breadcrumbs');
69
    }
70
  }
71
72
  /**
73
   * Присваивание текущему контроллеру приложения сформированных хлебных крошек
74
   */
75
  public function show()
76
  {
77
    Yii::app()->controller->breadcrumbs = $this->breadcrumbs;
78
  }
79
80
  protected function initModel()
81
  {
82
    $params = $this->controller->getActionParams();
83
84
    if( $this->controller->action->id === self::$indexName )
85
      $this->model = null;
0 ignored issues
show
The property model does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
86
    elseif( !empty($params['id']) )
87
      $this->model = $this->controller->loadModel($params['id']);
88
    else
89
    {
90
      $modelName   = $this->controller->modelClass;
91
      $this->model = new $modelName;
92
    }
93
  }
94
95
  /**
96
   * @throws BBreadcrumbsManagerException
97
   */
98
  protected function initDefaultController()
99
  {
100
    $controllerName  = Yii::app()->controller->module->defaultController;
101
    $controllerClass = ucfirst($controllerName).'Controller';
102
103
    $this->defaultModuleController = new $controllerClass($controllerName);
104
  }
105
106
  protected function initBreadcrumbs()
107
  {
108
    if( empty($this->model) )
109
      $this->initBreadcumbsWithotModel();
110
    elseif( empty($this->model->id) )
111
      $this->initBreadcrumbsWithNewModel();
112
    else
113
      $this->initBreadcrumbsWithExistingModel();
114
115
    if( !$this->checkControllersNameDiff() && $this->canCutDefaultControllerLink )
116
      unset($this->breadcrumbs[$this->controller->name]);
117
  }
118
119
  /**
120
   * Инициализация хлебных крошек без участия модели (actionIndex)
121
   */
122
  protected function initBreadcumbsWithotModel()
123
  {
124
    $this->canCutDefaultControllerLink = true;
125
126
    $this->breadcrumbs[] = $this->controller->name;
127
  }
128
129
  /**
130
   * Инициализация хлебных крошек с новой записью
131
   */
132
  protected function initBreadcrumbsWithNewModel()
133
  {
134
    $this->breadcrumbs[$this->controller->name] = self::$indexName;
135
    $this->breadcrumbs[] = 'Создание';
136
  }
137
138
  /**
139
   * Инициализация хлебных крошек с существующей записью
140
   */
141
  protected function initBreadcrumbsWithExistingModel()
142
  {
143
    $this->breadcrumbs[$this->controller->name] = self::$indexName;
144
145
    if( $this->model instanceof BProduct && !empty($this->model->parent) )
146
    {
147
      $this->breadcrumbs['Родительский продукт'] = Yii::app()->createUrl('/product/product/update', array('id' => $this->model->parent));
148
      $this->breadcrumbs[] = '[Модификация] '.$this->prepareItemName();
149
    }
150
    else
151
    {
152
      $this->breadcrumbs[] = $this->prepareItemName();
153
    }
154
  }
155
156
  /**
157
   * проверка на совпадение имени стандартного и текущего контроллера
158
   *
159
   * @return boolean
160
   */
161
  protected function checkControllersNameDiff()
162
  {
163
    return $this->controller->id !== $this->defaultModuleController->id;
164
  }
165
166
  /**
167
   * Получение названия записи
168
   * Приоритет по полям:
169
   *  1) name
170
   *  2) title
171
   *  3) id
172
   *
173
   * @return string
174
   */
175
  protected function prepareItemName()
176
  {
177
    if( !empty($this->model->name) )
178
      return $this->model->name;
179
    elseif( !empty($this->model->title) )
180
      return $this->model->title;
181
    else
182
      return $this->model->id;
183
  }
184
}
185
186
/**
187
 * @author Nikita Melnikov <[email protected]>
188
 * @link https://github.com/shogodev/argilla/
189
 * @copyright Copyright &copy; 2003-2014 Shogo
190
 * @license http://argilla.ru/LICENSE
191
 * @package backend.components
192
 */
193
class BBreadcrumbsManagerException extends CException
194
{
195
196
}