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/BAbstractModelCopier.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 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.components
8
 */
9
abstract class BAbstractModelCopier
10
{
11
  /**
12
   * @param BActiveRecord $model
13
   * @param mixed $unsetAttributes
14
   * @param mixed $setAttributes
15
   *
16
   * @return BActiveRecord
17
   */
18 4
  protected function copyModel(BActiveRecord $model, $unsetAttributes = null, $setAttributes = null)
19
  {
20 4
    if( $unsetAttributes === null )
21 4
    {
22 4
      $unsetAttributes = array('visible');
23
24 4
      if( ($pk = $this->getPrimaryColumn($model)) && is_string($pk) )
25 4
        $unsetAttributes[] = $pk;
26 4
    }
27
28 4
    if( $setAttributes === null )
29 4
      $setAttributes = array();
30
31 4
    $copy = clone $model;
32 4
    $copy->isNewRecord = true;
33 4
    $this->unsetAttributes($copy, $unsetAttributes);
34 4
    $this->setAttributes($copy, $setAttributes);
35 4
    $copy->setScenario('copy');
36 4
    $copy->save(false);
37
38 4
    return $model->findByPk($copy->getPrimaryKey());
39
  }
40
41
  /**
42
   * @param BActiveRecord $model
43
   * @param array $attributes
44
   */
45 5
  protected function unsetAttributes(BActiveRecord $model, array $attributes = array())
46
  {
47 5
    foreach($model->getValidators() as $validator)
48 5
      if( $validator instanceof CUniqueValidator )
0 ignored issues
show
The class CUniqueValidator does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
49 5
        foreach($validator->attributes as $attribute)
50 5
          $model->{$attribute} = null;
51
52 5
    foreach($attributes as $attribute)
53 4
      if( isset($model->{$attribute}) )
54 5
        $model->{$attribute} = null;
55 5
  }
56
57
  /**
58
   * @param BActiveRecord $model
59
   * @param array $attributes
60
   */
61 5
  protected function setAttributes(BActiveRecord $model, $attributes = array())
62
  {
63 5
    foreach($attributes as $attribute => $value)
64 4
      if( $model->hasAttribute($attribute) )
65 4
        $model->setAttribute($attribute, $value);
66 5
  }
67
68
  /**
69
   * @param BActiveRecord $copyModel
70
   * @param BActiveRecord $originModel
71
   * @param $relationName
72
   * @return bool
73
   */
74 3
  protected function copyRelations(BActiveRecord $copyModel, BActiveRecord $originModel, $relationName)
75
  {
76 3
    $relation      = $originModel->getActiveRelation($relationName);
77 3
    $relatedModels = $originModel->getRelated($relationName);
78
79 3
    if( !is_array($relatedModels) )
80 3
      $relatedModels = array($relatedModels);
81
82
    //todo: сделать обработку для составных внешних ключей
83 3
    $fk = $relation->foreignKey;
84 3
    if( is_array($fk) )
85 3
      return false;
86
87 3
    $result = true;
88
89 3
    foreach($relatedModels as $relatedModel)
90 1
    {
91 2
      $pk = $this->getPrimaryColumn($relatedModel);
92
93 2
      $copy = $this->copyModel(
94 2
        $relatedModel,
95 2
        CMap::mergeArray(array($fk), is_array($pk) ? array() : array($pk)),
96 2
        array($fk => $copyModel->getPrimaryKey())
97 2
      );
98
99 2
      $result = $copy && $result;
100 3
    }
101
102 3
    return $result;
103
  }
104
105
  /**
106
   * @param BActiveRecord $model
107
   *
108
   * @return array|string
109
   */
110 4
  protected function getPrimaryColumn(BActiveRecord $model)
111
  {
112 4
    return $model->getMetaData()->tableSchema->primaryKey;
113
  }
114
115
  abstract public function copy();
116
}