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/models/BAssociation.php (4 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]>, Sergey Glagolev <[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.models
8
 *
9
 * @method static BAssociation model(string $class = __CLASS__)
10
 *
11
 * @property string $src
12
 * @property string $src_frontend
13
 * @property integer $src_id
14
 * @property string $dst
15
 * @property string $dst_frontend
16
 * @property integer $dst_id
17
 */
18
class BAssociation extends BActiveRecord
19
{
20
  /**
21
   * @return string
22
   */
23 3
  public function tableName()
24
  {
25 3
    return '{{association}}';
26
  }
27
28
  /**
29
   * @param BActiveRecord $model
30
   * @param string        $dst
31
   * @param array         $ids
32
   * @param bool          $deleteAssociations
33
   */
34 3
  public function updateAssociations(BActiveRecord $model, $dst, array $ids, $deleteAssociations = true)
35
  {
36
    if( $deleteAssociations )
37 3
      self::model()->deleteAssociations($model, $dst);
38
39 3
    foreach($ids as $id)
40
    {
41 3
      $association         = new BAssociation();
42 3
      $association->src    = $this->getSrc($model);
43 3
      $association->src_id = $model->getPrimaryKey();
44 3
      $association->dst    = $dst;
45 3
      $association->dst_id = $id;
46
47 3
      if( $model instanceof IHasFrontendModel )
48 3
        $association->src_frontend = $model->getFrontendModelName();
49
50 3
      $dstModel = new $dst();
51 3
      if( $dstModel instanceof IHasFrontendModel )
52 3
        $association->dst_frontend = $dstModel->getFrontendModelName();
53
54 3
      $association->save();
55 3
    }
56 3
  }
57
58
  /**
59
   * @param BActiveRecord $model
60
   * @param null|string   $dst
61
   * @param null|string   $dstId
62
   */
63 3
  public function deleteAssociations(BActiveRecord $model, $dst = null, $dstId = null)
64
  {
65 3
    $src   = $this->getSrc($model);
66 3
    $srcId = $model->getPrimaryKey();
67
68 3
    $criteria = new CDbCriteria();
69 3
    $criteria->compare('src', $src);
70 3
    $criteria->compare('src_id', $srcId);
71
72
    if( $dst )
0 ignored issues
show
Bug Best Practice introduced by
The expression $dst of type null|string is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
73 3
      $criteria->compare('dst', $dst);
74
75
    if( $dstId )
0 ignored issues
show
Bug Best Practice introduced by
The expression $dstId of type null|string is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
76 3
      $criteria->compare('dst_id', $dstId);
77
78 3
    $this->deleteAll($criteria);
79 3
  }
80
81
  /**
82
   * @param BActiveRecord $model
83
   *
84
   * @return string
85
   */
86 5
  public function getSrc(BActiveRecord $model)
87
  {
88 5
    return get_class($model);
89
  }
90
91
  public function getChecked($parameters)
92
  {
93
    $criteria = new CDbCriteria();
94
95
    foreach($parameters as $key => $value)
96
      $criteria->compare($key, $value);
97
98
    return $this->count($criteria) ? true : false;
99
  }
100
101
  public function getAssociatedKeys($data = null)
102
  {
103 View Code Duplication
    if( !isset($data) )
0 ignored issues
show
This code seems to be duplicated across 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...
104
    {
105
      $data = Arr::extract($_GET, array('src', 'dst', 'srcId'));
106
    }
107
108
    if( isset($data['srcId']) )
109
    {
110
      $data['src_id'] = Arr::cut($data, 'srcId');
0 ignored issues
show
Are you sure the assignment to $data['src_id'] is correct as \Arr::cut($data, 'srcId') (which targets Arr::cut()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
111
    }
112
113
    return CHtml::listData(self::model()->findAllByAttributes($data), 'dst_id', 'dst_id');
114
  }
115
}