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

Security Analysis    no request data  

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.

src/Highcharts.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
/**
4
 * Highcharts class file.
5
 *
6
 * @author Milo Schuman <[email protected]>
7
 * @link https://github.com/miloschuman/yii2-highcharts/
8
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
9
 */
10
11
namespace miloschuman\highcharts;
12
13
use yii\base\Widget;
14
use yii\helpers\ArrayHelper;
15
use yii\helpers\Html;
16
use yii\helpers\Json;
17
use yii\web\View;
18
19
/**
20
 * Highcharts encapsulates the {@link http://www.highcharts.com/ Highcharts}
21
 * charting library's Chart object.
22
 *
23
 * To use this widget, you can insert the following code in a view:
24
 * ```php
25
 * echo \miloschuman\highcharts\Highcharts::widget([
26
 *     'options' => [
27
 *         'title' => ['text' => 'Fruit Consumption'],
28
 *         'xAxis' => [
29
 *             'categories' => ['Apples', 'Bananas', 'Oranges']
30
 *         ],
31
 *         'yAxis' => [
32
 *             'title' => ['text' => 'Fruit eaten']
33
 *         ],
34
 *         'series' => [
35
 *             ['name' => 'Jane', 'data' => [1, 0, 4]],
36
 *             ['name' => 'John', 'data' => [5, 7, 3]]
37
 *         ]
38
 *     ]
39
 * ]);
40
 * ```
41
 *
42
 * By configuring the {@link $options} property, you may specify the options
43
 * that need to be passed to the Highcharts JavaScript object. Please refer to
44
 * the demo gallery and documentation on the {@link https://www.highcharts.com/
45
 * Highcharts website} for possible options.
46
 *
47
 * Note: You do not need to specify the <code>chart->renderTo</code> option as
48
 * is shown in many of the examples on the Highcharts website. This value is
49
 * automatically populated with the id of the widget's container element. If you
50
 * wish to use a different container, feel free to specify a custom value.
51
 */
52
class Highcharts extends Widget
53
{
54
55
    protected $constr = 'Chart';
56
    protected $baseScript = 'highcharts';
57
    public $options = [];
58
    public $htmlOptions = [];
59
    public $setupOptions = [];
60
    public $scripts = [];
61
    public $callback = false;
62
63
    /**
64
     * Renders the widget.
65
     */
66
    public function run()
67
    {
68
        // determine the ID of the container element
69
        if (isset($this->htmlOptions['id'])) {
70
            $this->id = $this->htmlOptions['id'];
71
        } else {
72
            $this->id = $this->htmlOptions['id'] = $this->getId();
73
        }
74
75
        // render the container element
76
        echo Html::tag('div', '', $this->htmlOptions);
77
78
        // check if options parameter is a json string
79
        if (is_string($this->options)) {
80
            $this->options = Json::decode($this->options);
0 ignored issues
show
Documentation Bug introduced by
It seems like \yii\helpers\Json::decode($this->options) of type * is incompatible with the declared type array of property $options.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
81
        }
82
83
        // merge options with default values
84
        $defaultOptions = ['chart' => ['renderTo' => $this->id]];
85
        $this->options = ArrayHelper::merge($defaultOptions, $this->options);
86
        array_unshift($this->scripts, $this->baseScript);
87
88
        $this->registerAssets();
89
90
        parent::run();
91
    }
92
93
    /**
94
     * Registers required assets and the executing code block with the view
95
     */
96
    protected function registerAssets()
97
    {
98
        // register the necessary script files
99
        HighchartsAsset::register($this->view)->withScripts($this->scripts);
100
101
        // prepare and register JavaScript code block
102
        $jsOptions = Json::encode($this->options);
103
        $setupOptions = Json::encode($this->setupOptions);
104
        $js = "Highcharts.setOptions($setupOptions); new Highcharts.{$this->constr}($jsOptions);";
105
        $key = __CLASS__ . '#' . $this->id;
106
        if (is_string($this->callback)) {
107
            $js = "function {$this->callback}(data) {{$js}}";
108
        }
109
110
        $this->view->registerJs($js, View::POS_READY, $key);
111
    }
112
113
}
114