Issues (233)

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.

src/API/DatacubeApi.php (17 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
namespace Wechat\API;
3
4
/**
5
 * 分析数据接口.
6
 *
7
 * 最大时间跨度是指一次接口调用时最大可获取数据的时间范围,如最大时间跨度为7是指最多一次性获取7天的数据。access_token的实际值请通过“获取access_token”来获取。
8
 *
9
 *关于周数据与月数据,请注意:每个月/周的周期数据的数据标注日期在当月/当周的第一天(当月1日或周一)。在某一月/周过后去调用接口,才能获取到该周期的数据。比如,在12月1日以(11月1日-11月5日)作为(begin_date和end_date)调用获取月数据接口,可以获取到11月1日的月数据(即11月的月数据)。
10
 *
11
 * @author Tian.
12
 */
13
class DatacubeApi extends BaseApi
14
{
15
16
    /**
17
     * 用户分析数据接口
18
     */
19
20
    /**
21
     * 获取用户增减数据 (最大时间跨度 7 天)
22
     *
23
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
24
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
25
     *
26
     * @return array
27
     */
28 View Code Duplication
    public function getusersummary($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
29
    {
30
        $this->apitype = 'datacube';
31
        $this->module  = 'getusersummary';
32
33
        $queryStr = [
34
            'begin_date' => $begin_date,
35
            'end_date'   => $end_date,
36
        ];
37
38
        $res = $this->_post('', $queryStr);
39
40
        return $res;
41
    }
42
43
    /**
44
     * 获取累计用户数据 (最大时间跨度 7 天)
45
     *
46
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
47
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
48
     *
49
     * @return array
50
     */
51 View Code Duplication
    public function getusercumulate($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
52
    {
53
        $this->apitype = 'datacube';
54
        $this->module  = 'getusercumulate';
55
56
        $queryStr = [
57
            'begin_date' => $begin_date,
58
            'end_date'   => $end_date,
59
        ];
60
61
        $res = $this->_post('', $queryStr);
62
63
        return $res;
64
    }
65
66
    /**
67
     * 图文分析数据接口
68
     */
69
70
    /**
71
     * 获取图文群发每日数据 (最大时间跨度 1 天)
72
     *
73
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
74
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
75
     *
76
     * @return array
77
     */
78 View Code Duplication
    public function getarticlesummary($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
79
    {
80
        $this->apitype = 'datacube';
81
        $this->module  = 'getarticlesummary';
82
83
        $queryStr = [
84
            'begin_date' => $begin_date,
85
            'end_date'   => $end_date,
86
        ];
87
88
        $res = $this->_post('', $queryStr);
89
90
        return $res;
91
    }
92
93
    /**
94
     * 获取图文群发总数据 (最大时间跨度 1 天)
95
     *
96
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
97
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
98
     *
99
     * @return array
100
     */
101 View Code Duplication
    public function getarticletotal($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
102
    {
103
        $this->apitype = 'datacube';
104
        $this->module  = 'getarticletotal';
105
106
        $queryStr = [
107
            'begin_date' => $begin_date,
108
            'end_date'   => $end_date,
109
        ];
110
111
        $res = $this->_post('', $queryStr);
112
113
        return $res;
114
    }
115
116
    /**
117
     * 获取图文统计数据 (最大时间跨度 3 天)
118
     *
119
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
120
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
121
     *
122
     * @return array
123
     */
124 View Code Duplication
    public function getuserread($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
125
    {
126
        $this->apitype = 'datacube';
127
        $this->module  = 'getuserread';
128
129
        $queryStr = [
130
            'begin_date' => $begin_date,
131
            'end_date'   => $end_date,
132
        ];
133
134
        $res = $this->_post('', $queryStr);
135
136
        return $res;
137
    }
138
139
    /**
140
     * 获取图文统计分时数据 (最大时间跨度 1 天)
141
     *
142
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
143
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
144
     *
145
     * @return array
146
     */
147 View Code Duplication
    public function getuserreadhour($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
148
    {
149
        $this->apitype = 'datacube';
150
        $this->module  = 'getuserreadhour';
151
152
        $queryStr = [
153
            'begin_date' => $begin_date,
154
            'end_date'   => $end_date,
155
        ];
156
157
        $res = $this->_post('', $queryStr);
158
159
        return $res;
160
    }
161
162
    /**
163
     * 获取图文分享转发数据 (最大时间跨度 7 天)
164
     *
165
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
166
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
167
     *
168
     * @return array
169
     */
170 View Code Duplication
    public function getusershare($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
171
    {
172
        $this->apitype = 'datacube';
173
        $this->module  = 'getusershare';
174
175
        $queryStr = [
176
            'begin_date' => $begin_date,
177
            'end_date'   => $end_date,
178
        ];
179
180
        $res = $this->_post('', $queryStr);
181
182
        return $res;
183
    }
184
185
    /**
186
     * 获取图文分享转发分时数据 (最大时间跨度 1 天)
187
     *
188
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
189
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
190
     *
191
     * @return array
192
     */
193 View Code Duplication
    public function getusersharehour($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
194
    {
195
        $this->apitype = 'datacube';
196
        $this->module  = 'getusersharehour';
197
198
        $queryStr = [
199
            'begin_date' => $begin_date,
200
            'end_date'   => $end_date,
201
        ];
202
203
        $res = $this->_post('', $queryStr);
204
205
        return $res;
206
    }
207
208
    /**
209
     * 消息分析数据接口
210
     */
211
212
    /**
213
     * 获取消息发送概况数据 (最大时间跨度 7 天)
214
     *
215
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
216
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
217
     *
218
     * @return array
219
     */
220 View Code Duplication
    public function getupstreammsg($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
221
    {
222
        $this->apitype = 'datacube';
223
        $this->module  = 'getupstreammsg';
224
225
        $queryStr = [
226
            'begin_date' => $begin_date,
227
            'end_date'   => $end_date,
228
        ];
229
230
        $res = $this->_post('', $queryStr);
231
232
        return $res;
233
    }
234
235
    /**
236
     * 获取消息分送分时数据 (最大时间跨度 1 天)
237
     *
238
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
239
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
240
     *
241
     * @return array
242
     */
243 View Code Duplication
    public function getupstreammsghour($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
244
    {
245
        $this->apitype = 'datacube';
246
        $this->module  = 'getupstreammsghour';
247
248
        $queryStr = [
249
            'begin_date' => $begin_date,
250
            'end_date'   => $end_date,
251
        ];
252
253
        $res = $this->_post('', $queryStr);
254
255
        return $res;
256
    }
257
258
    /**
259
     * 获取消息发送周数据 (最大时间跨度 30 天)
260
     *
261
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
262
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
263
     *
264
     * @return array
265
     */
266 View Code Duplication
    public function getupstreammsgweek($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
267
    {
268
        $this->apitype = 'datacube';
269
        $this->module  = 'getupstreammsgweek';
270
271
        $queryStr = [
272
            'begin_date' => $begin_date,
273
            'end_date'   => $end_date,
274
        ];
275
276
        $res = $this->_post('', $queryStr);
277
278
        return $res;
279
    }
280
281
    /**
282
     * 获取消息发送月数据 (最大时间跨度 30 天)
283
     *
284
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
285
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
286
     *
287
     * @return array
288
     */
289 View Code Duplication
    public function getupstreammsgmonth($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
290
    {
291
        $this->apitype = 'datacube';
292
        $this->module  = 'getupstreammsgmonth';
293
294
        $queryStr = [
295
            'begin_date' => $begin_date,
296
            'end_date'   => $end_date,
297
        ];
298
299
        $res = $this->_post('', $queryStr);
300
301
        return $res;
302
    }
303
304
    /**
305
     * 获取消息发送分布数据 (最大时间跨度 15 天)
306
     *
307
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
308
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
309
     *
310
     * @return array
311
     */
312 View Code Duplication
    public function getupstreammsgdist($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
313
    {
314
        $this->apitype = 'datacube';
315
        $this->module  = 'getupstreammsgdist';
316
317
        $queryStr = [
318
            'begin_date' => $begin_date,
319
            'end_date'   => $end_date,
320
        ];
321
322
        $res = $this->_post('', $queryStr);
323
324
        return $res;
325
    }
326
327
    /**
328
     * 获取消息发送分布周数据 (最大时间跨度 30 天)
329
     *
330
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
331
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
332
     *
333
     * @return array
334
     */
335 View Code Duplication
    public function getupstreammsgdistweek($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
336
    {
337
        $this->apitype = 'datacube';
338
        $this->module  = 'getupstreammsgdistweek';
339
340
        $queryStr = [
341
            'begin_date' => $begin_date,
342
            'end_date'   => $end_date,
343
        ];
344
345
        $res = $this->_post('', $queryStr);
346
347
        return $res;
348
    }
349
350
    /**
351
     * 获取消息发送分布月数据 (最大时间跨度 30 天)
352
     *
353
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
354
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
355
     *
356
     * @return array
357
     */
358 View Code Duplication
    public function getupstreammsgdistmonth($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
359
    {
360
        $this->apitype = 'datacube';
361
        $this->module  = 'getupstreammsgdistmonth';
362
363
        $queryStr = [
364
            'begin_date' => $begin_date,
365
            'end_date'   => $end_date,
366
        ];
367
368
        $res = $this->_post('', $queryStr);
369
370
        return $res;
371
    }
372
373
    /**
374
     * 接口分析数据接口
375
     */
376
377
    /**
378
     * 获取接口分析数据 (最大时间跨度 30 天)
379
     *
380
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
381
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
382
     *
383
     * @return array
384
     */
385 View Code Duplication
    public function getinterfacesummary($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
386
    {
387
        $this->apitype = 'datacube';
388
        $this->module  = 'getinterfacesummary';
389
390
        $queryStr = [
391
            'begin_date' => $begin_date,
392
            'end_date'   => $end_date,
393
        ];
394
395
        $res = $this->_post('', $queryStr);
396
397
        return $res;
398
    }
399
400
    /**
401
     * 获取接口分析分时数据 (最大时间跨度 1 天)
402
     *
403
     * @param  string $begin_date 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,begin_date和end_date的差值只能为0,才能小于1),否则会报错
404
     * @param  string $end_date   获取数据的结束日期,end_date允许设置的最大值为昨日
405
     *
406
     * @return array
407
     */
408 View Code Duplication
    public function getinterfacesummaryhour($begin_date, $end_date)
0 ignored issues
show
This method seems to be duplicated in 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...
409
    {
410
        $this->apitype = 'datacube';
411
        $this->module  = 'getinterfacesummaryhour';
412
413
        $queryStr = [
414
            'begin_date' => $begin_date,
415
            'end_date'   => $end_date,
416
        ];
417
418
        $res = $this->_post('', $queryStr);
419
420
        return $res;
421
    }
422
}
423