Issues (141)

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.

formats/jqplot/SRF_jqPlot.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
/**
4
 * Abstract class to hold common functionality for the jqPlot result printers.
5
 *
6
 * @since 1.8
7
 *
8
 * @licence GNU GPL v2+
9
 * @author mwjames
10
 * @author Jeroen De Dauw < [email protected] >
11
 * @author Yaron Koren
12
 * @author Sanyam Goyal
13
 */
14
abstract class SRFjqPlot extends SMWAggregatablePrinter {
15
16
	public static function getCommonParams() {
17
18
		$params = [];
19
20
		$params['min'] = [
21
			'type' => 'integer',
22
			'message' => 'srf-paramdesc-minvalue',
23
			'default' => false,
24
			'manipulatedefault' => false,
25
		];
26
27
		$params['direction'] = [
28
			'message' => 'srf-paramdesc-direction',
29
			'default' => 'vertical',
30
			'values' => [ 'horizontal', 'vertical' ],
31
		];
32
33
		$params['charttitle'] = [
34
			'message' => 'srf_paramdesc_charttitle',
35
			'default' => '',
36
		];
37
38
		$params['charttext'] = [
39
			'message' => 'srf-paramdesc-charttext',
40
			'default' => '',
41
		];
42
43
		$params['numbersaxislabel'] = [
44
			'message' => 'srf_paramdesc_barnumbersaxislabel',
45
			'default' => '',
46
		];
47
48
		$params['labelaxislabel'] = [
49
			'message' => 'srf-paramdesc-labelaxislabel',
50
			'default' => '',
51
		];
52
53
		$params['height'] = [
54
			'type' => 'integer',
55
			'message' => 'srf_paramdesc_chartheight',
56
			'default' => 400,
57
			'lowerbound' => 1,
58
		];
59
60
		// TODO: this is a string to allow for %, but better handling would be nice
61
		$params['width'] = [
62
			'message' => 'srf_paramdesc_chartwidth',
63
			'default' => '100%',
64
		];
65
66
		$params['smoothlines'] = [
67
			'type' => 'boolean',
68
			'message' => 'srf-paramdesc-smoothlines',
69
			'default' => false,
70
		];
71
72
		// %.2f round number to 2 digits after decimal point e.g.  EUR %.2f, $ %.2f
73
		// %d a signed integer, in decimal
74
		$params['valueformat'] = [
75
			'message' => 'srf-paramdesc-valueformat',
76
			'default' => '%d',
77
		];
78
79
		$params['ticklabels'] = [
80
			'type' => 'boolean',
81
			'message' => 'srf-paramdesc-ticklabels',
82
			'default' => true,
83
		];
84
85
		$params['highlighter'] = [
86
			'type' => 'boolean',
87
			'message' => 'srf-paramdesc-highlighter',
88
			'default' => false,
89
		];
90
91
		$params['theme'] = [
92
			'message' => 'srf-paramdesc-theme',
93
			'default' => '',
94
			'values' => [ '', 'vector', 'simple' ],
95
		];
96
97
		$params['filling'] = [
98
			'type' => 'boolean',
99
			'message' => 'srf-paramdesc-filling',
100
			'default' => true,
101
		];
102
103
		$params['chartlegend'] = [
104
			'message' => 'srf-paramdesc-chartlegend',
105
			'default' => 'none',
106
			'values' => [ 'none', 'nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w' ],
107
		];
108
109
		$params['datalabels'] = [
110
			'message' => 'srf-paramdesc-datalabels',
111
			'default' => 'none',
112
			'values' => [ 'none', 'value', 'label', 'percent' ],
113
		];
114
115
		$params['colorscheme'] = [
116
			'message' => 'srf-paramdesc-colorscheme',
117
			'default' => '',
118
			'values' => $GLOBALS['srfgColorScheme'],
119
		];
120
121
		$params['chartcolor'] = [
122
			'message' => 'srf-paramdesc-chartcolor',
123
			'default' => '',
124
		];
125
126
		$params['class'] = [
127
			'message' => 'srf-paramdesc-class',
128
			'default' => '',
129
		];
130
131
		return $params;
132
	}
133
134
	/**
135
	 * Prepare jqplot specific numbers ticks
136
	 *
137
	 * @since 1.8
138
	 *
139
	 * @param array $data
0 ignored issues
show
There is no parameter named $data. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
140
	 * @param $minValue
141
	 * @param $maxValue
142
	 *
143
	 * @return array
144
	 */
145
	public static function getNumbersTicks( $minValue, $maxValue ) {
146
		$numbersticks = [];
147
148
		// Calculate the tick values for the numbers, based on the
149
		// lowest and highest number. jqPlot has its own option for
150
		// calculating ticks automatically - "autoscale" - but it
151
		// currently (September 2010, it also fails with the jpPlot 1.00b 2012)
152
		// fails for numbers less than 1, and negative numbers.
153
		// If both max and min are 0, just escape now.
154
		if ( $maxValue == 0 && $minValue == 0 ) {
155
			return null;
156
		}
157
158
		// Make the max and min slightly larger and bigger than the
159
		// actual max and min, so that the bars don't directly touch
160
		// the top and bottom of the graph
161
		if ( $maxValue > 0 ) {
162
			$maxValue += .001;
163
		}
164
165
		if ( $minValue < 0 ) {
166
			$minValue -= .001;
167
		}
168
169
		if ( $maxValue == 0 ) {
170
			$multipleOf10 = 0;
171
			$maxAxis = 0;
172
		} else {
173
			$multipleOf10 = pow( 10, floor( log( $maxValue, 10 ) ) );
174
			$maxAxis = ceil( $maxValue / $multipleOf10 ) * $multipleOf10;
175
		}
176
177
		if ( $minValue == 0 ) {
178
			$negativeMultipleOf10 = 0;
179
			$minAxis = 0;
180
		} else {
181
			$negativeMultipleOf10 = -1 * pow( 10, floor( log( ( abs( $minValue ) ), 10 ) ) );
182
			$minAxis = ceil( $minValue / $negativeMultipleOf10 ) * $negativeMultipleOf10;
183
		}
184
185
		$biggerMultipleOf10 = max( $multipleOf10, -1 * $negativeMultipleOf10 );
186
		$lowestTick = floor( $minAxis / $biggerMultipleOf10 + .001 );
187
		$highestTick = ceil( $maxAxis / $biggerMultipleOf10 - .001 );
188
189
		for ( $i = $lowestTick; $i <= $highestTick; $i++ ) {
190
			$numbersticks[] = ( $i * $biggerMultipleOf10 );
191
		}
192
193
		return $numbersticks;
194
	}
195
}