Issues (733)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

class/pear/Calendar/tests/year_test.php (2 issues)

1
<?php
2
3
require_once __DIR__ . '/simple_include.php';
4
require_once __DIR__ . '/calendar_include.php';
5
6
require_once __DIR__ . '/./calendar_test.php';
7
8
/**
9
 * Class TestOfYear.
10
 */
11
class TestOfYear extends TestOfCalendar
12
{
13
    /**
14
     * TestOfYear constructor.
15
     */
16
    public function __construct()
17
    {
18
        $this->UnitTestCase('Test of Year');
19
    }
20
21
    public function setUp()
22
    {
23
        $this->cal = new Calendar_Year(2003);
24
    }
25
26
    public function testPrevYear_Object()
27
    {
28
        $this->assertEqual(new Calendar_Year(2002), $this->cal->prevYear('object'));
29
    }
30
31
    public function testThisYear_Object()
32
    {
33
        $this->assertEqual(new Calendar_Year(2003), $this->cal->thisYear('object'));
34
    }
35
36
    public function testPrevMonth()
37
    {
38
        $this->assertEqual(12, $this->cal->prevMonth());
39
    }
40
41
    public function testPrevMonth_Array()
42
    {
43
        $this->assertEqual([
44
                               'year'   => 2002,
45
                               'month'  => 12,
46
                               'day'    => 1,
47
                               'hour'   => 0,
48
                               'minute' => 0,
49
                               'second' => 0,
50
                           ], $this->cal->prevMonth('array'));
51
    }
52
53
    public function testThisMonth()
54
    {
55
        $this->assertEqual(1, $this->cal->thisMonth());
56
    }
57
58
    public function testNextMonth()
59
    {
60
        $this->assertEqual(2, $this->cal->nextMonth());
61
    }
62
63
    public function testPrevDay()
64
    {
65
        $this->assertEqual(31, $this->cal->prevDay());
66
    }
67
68
    public function testPrevDay_Array()
69
    {
70
        $this->assertEqual([
71
                               'year'   => 2002,
72
                               'month'  => 12,
73
                               'day'    => 31,
74
                               'hour'   => 0,
75
                               'minute' => 0,
76
                               'second' => 0,
77
                           ], $this->cal->prevDay('array'));
78
    }
79
80
    public function testThisDay()
81
    {
82
        $this->assertEqual(1, $this->cal->thisDay());
83
    }
84
85
    public function testNextDay()
86
    {
87
        $this->assertEqual(2, $this->cal->nextDay());
88
    }
89
90
    public function testPrevHour()
91
    {
92
        $this->assertEqual(23, $this->cal->prevHour());
93
    }
94
95
    public function testThisHour()
96
    {
97
        $this->assertEqual(0, $this->cal->thisHour());
98
    }
99
100
    public function testNextHour()
101
    {
102
        $this->assertEqual(1, $this->cal->nextHour());
103
    }
104
105
    public function testPrevMinute()
106
    {
107
        $this->assertEqual(59, $this->cal->prevMinute());
108
    }
109
110
    public function testThisMinute()
111
    {
112
        $this->assertEqual(0, $this->cal->thisMinute());
113
    }
114
115
    public function testNextMinute()
116
    {
117
        $this->assertEqual(1, $this->cal->nextMinute());
118
    }
119
120
    public function testPrevSecond()
121
    {
122
        $this->assertEqual(59, $this->cal->prevSecond());
123
    }
124
125
    public function testThisSecond()
126
    {
127
        $this->assertEqual(0, $this->cal->thisSecond());
128
    }
129
130
    public function testNextSecond()
131
    {
132
        $this->assertEqual(1, $this->cal->nextSecond());
133
    }
134
135
    public function testGetTimeStamp()
136
    {
137
        $stamp = mktime(0, 0, 0, 1, 1, 2003);
138
        $this->assertEqual($stamp, $this->cal->getTimestamp());
139
    }
140
}
141
142
/**
143
 * Class TestOfYearBuild.
144
 */
145
class TestOfYearBuild extends TestOfYear
146
{
147
    /**
148
     * TestOfYearBuild constructor.
149
     */
150
    public function __construct()
151
    {
152
        $this->UnitTestCase('Test of Year::build()');
153
    }
154
155
    public function testSize()
156
    {
157
        $this->cal->build();
158
        $this->assertEqual(12, $this->cal->size());
159
    }
160
161
    public function testFetch()
162
    {
163
        $this->cal->build();
164
        $i = 0;
165
        while ($Child = $this->cal->fetch()) {
0 ignored issues
show
The assignment to $Child is dead and can be removed.
Loading history...
166
            ++$i;
167
        }
168
        $this->assertEqual(12, $i);
169
    }
170
171
    public function testFetchAll()
172
    {
173
        $this->cal->build();
174
        $children = [];
175
        $i        = 1;
176
        while ($Child = $this->cal->fetch()) {
177
            $children[$i] = $Child;
178
            ++$i;
179
        }
180
        $this->assertEqual($children, $this->cal->fetchAll());
181
    }
182
183
    public function testSelection()
184
    {
185
        require_once CALENDAR_ROOT . 'Month.php';
186
        $selection = [new Calendar_Month(2003, 10)];
187
        $this->cal->build($selection);
188
        $i = 1;
189
        while ($Child = $this->cal->fetch()) {
190
            if (10 == $i) {
191
                break;
192
            }
193
            ++$i;
194
        }
195
        $this->assertTrue($Child->isSelected());
196
    }
197
}
198
199
if (!defined('TEST_RUNNING')) {
200
    define('TEST_RUNNING', true);
201
    $test = new TestOfYear();
202
    $test->run(new HtmlReporter());
0 ignored issues
show
The type HtmlReporter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
203
    $test = new TestOfYearBuild();
204
    $test->run(new HtmlReporter());
205
}
206