Issues (109)

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.

DataFixtures/StatementFixtures.php (4 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
3
/*
4
 * This file is part of the xAPI package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Xabbuh\XApi\DataFixtures;
13
14
use Xabbuh\XApi\Model\Account;
15
use Xabbuh\XApi\Model\Agent;
16
use Xabbuh\XApi\Model\Activity;
17
use Xabbuh\XApi\Model\Definition;
18
use Xabbuh\XApi\Model\Group;
19
use Xabbuh\XApi\Model\Result;
20
use Xabbuh\XApi\Model\Score;
21
use Xabbuh\XApi\Model\Statement;
22
use Xabbuh\XApi\Model\StatementReference;
23
use Xabbuh\XApi\Model\SubStatement;
24
use Xabbuh\XApi\Model\Verb;
25
26
/**
27
 * Statement fixtures.
28
 *
29
 * @author Christian Flothmann <[email protected]>
30
 */
31
class StatementFixtures
32
{
33
    const DEFAULT_STATEMENT_ID = '12345678-1234-5678-8234-567812345678';
34
35
    /**
36
     * Loads a minimal valid statement.
37
     *
38
     * @param string $id The id of the new Statement
39
     *
40
     * @return Statement
41
     */
42 View Code Duplication
    public static function getMinimalStatement($id = self::DEFAULT_STATEMENT_ID)
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...
43
    {
44
        $actor = new Agent('mailto:[email protected]');
45
        $verb = new Verb('http://adlnet.gov/expapi/verbs/created', array('en-US' => 'created'));
46
        $activity = new Activity('http://example.adlnet.gov/xapi/example/activity');
47
48
        return new Statement($id, $actor, $verb, $activity);
49
    }
50
51
    /**
52
     * Loads a statement with a group as an actor.
53
     *
54
     * @param string $id The id of the new Statement
55
     *
56
     * @return Statement
57
     */
58 View Code Duplication
    public static function getStatementWithGroupActor($id = self::DEFAULT_STATEMENT_ID)
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...
59
    {
60
        $group = ActorFixtures::getGroup();
61
        $verb = VerbFixtures::getVerb();
62
        $activity = ActivityFixtures::getActivity();
63
64
        return new Statement($id, $group, $verb, $activity);
65
    }
66
67
    /**
68
     * Loads a statement with a group that has no members as an actor.
69
     *
70
     * @param string $id The id of the new Statement
71
     *
72
     * @return Statement
73
     */
74 View Code Duplication
    public static function getStatementWithGroupActorWithoutMembers($id = self::DEFAULT_STATEMENT_ID)
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...
75
    {
76
        $group = ActorFixtures::getGroupWithoutMembers();
77
        $verb = VerbFixtures::getVerb();
78
        $activity = ActivityFixtures::getActivity();
79
80
        return new Statement($id, $group, $verb, $activity);
81
    }
82
83
    /**
84
     * Loads a statement including a reference to another statement.
85
     *
86
     * @param string $id The id of the new Statement
87
     *
88
     * @return Statement
89
     */
90
    public static function getStatementWithStatementRef($id = self::DEFAULT_STATEMENT_ID)
91
    {
92
        $minimalStatement = static::getMinimalStatement($id);
93
94
        return new Statement(
95
            $minimalStatement->getId(),
96
            $minimalStatement->getActor(),
97
            $minimalStatement->getVerb(),
98
            new StatementReference('8f87ccde-bb56-4c2e-ab83-44982ef22df0')
99
        );
100
    }
101
102
    /**
103
     * Loads a statement including a result.
104
     *
105
     * @param string $id The id of the new Statement
106
     *
107
     * @return Statement
108
     */
109
    public static function getStatementWithResult($id = self::DEFAULT_STATEMENT_ID)
110
    {
111
        $actor = new Agent('mailto:[email protected]');
112
        $verb = new Verb('http://adlnet.gov/expapi/verbs/created', array('en-US' => 'created'));
113
        $activity = new Activity('http://example.adlnet.gov/xapi/example/activity');
114
        $score = new Score(0.95, 31, 0, 50);
115
        $result = new Result($score, true, true, 'Wow, nice work!', 'PT1H0M0S');
116
117
        return new Statement($id, $actor, $verb, $activity, $result);
118
    }
119
120
    /**
121
     * Loads a statement including a sub statement.
122
     *
123
     * @param string $id The id of the new Statement
124
     *
125
     * @return Statement
126
     */
127
    public static function getStatementWithSubStatement($id = self::DEFAULT_STATEMENT_ID)
128
    {
129
        $actor = new Agent('mailto:[email protected]');
130
        $verb = new Verb('http://example.com/visited', array('en-US' => 'will visit'));
131
        $definition = new Definition(
132
            array('en-US' => 'Some Awesome Website'),
133
            array('en-US' => 'The visited website'),
134
            'http://example.com/definition-type'
135
        );
136
        $activity = new Activity('http://example.com/website', $definition);
137
        $subStatement = new SubStatement(null, $actor, $verb, $activity);
138
139
        $actor = new Agent('mailto:[email protected]');
140
        $verb = new Verb('http://example.com/planned', array('en-US' => 'planned'));
141
142
        return new Statement($id, $actor, $verb, $subStatement);
143
    }
144
145
    /**
146
     * Loads a statement including an agent authority.
147
     *
148
     * @param string $id The id of the new Statement
149
     *
150
     * @return Statement
151
     */
152
    public static function getStatementWithAgentAuthority($id = self::DEFAULT_STATEMENT_ID)
153
    {
154
        $actor = new Agent('mailto:[email protected]');
155
        $verb = new Verb('http://adlnet.gov/expapi/verbs/created', array('en-US' => 'created'));
156
        $activity = new Activity('http://example.adlnet.gov/xapi/example/activity');
157
        $authority = new Agent(null, null, null, new Account('anonymous', 'http://cloud.scorm.com/'));
158
159
        return new Statement($id, $actor, $verb, $activity, null, $authority);
160
    }
161
162
    /**
163
     * Loads a statement including a group authority.
164
     *
165
     * @param string $id The id of the new Statement
166
     *
167
     * @return Statement
168
     */
169 View Code Duplication
    public static function getStatementWithGroupAuthority($id = self::DEFAULT_STATEMENT_ID)
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...
170
    {
171
        $actor = new Agent('mailto:[email protected]');
172
        $verb = new Verb('http://adlnet.gov/expapi/verbs/created', array('en-US' => 'created'));
173
        $activity = new Activity('http://example.adlnet.gov/xapi/example/activity');
174
        $user = new Agent(null, null, null, new Account('oauth_consumer_x75db', 'http://example.com/xAPI/OAuth/Token'));
175
        $application = new Agent('mailto:[email protected]');
176
        $authority = new Group(null, null, null, null, null, array($user, $application));
177
178
        return new Statement($id, $actor, $verb, $activity, null, $authority);
179
    }
180
181
    /**
182
     * Loads a void statement.
183
     *
184
     * @param string $id The id of the new Statement
185
     *
186
     * @return Statement
187
     */
188
    public static function getVoidStatement($id = self::DEFAULT_STATEMENT_ID)
189
    {
190
        $actor = new Agent('mailto:[email protected]');
191
        $verb = Verb::createVoidVerb();
192
        $object = new StatementReference('e05aa883-acaf-40ad-bf54-02c8ce485fb0');
193
194
        return new Statement($id, $actor, $verb, $object);
195
    }
196
}
197