Issues (55)

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/AppBundle/Entity/Question.php (1 issue)

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
 * Created by PhpStorm.
4
 * User: device
5
 * Date: 23.02.16
6
 * Time: 10:00
7
 */
8
9
namespace AppBundle\Entity;
10
11
use Doctrine\Common\Collections\ArrayCollection;
12
use Doctrine\ORM\Mapping as ORM;
13
use Symfony\Component\Validator\Constraints as Assert;
14
15
16
/**
17
 * Question
18
 *
19
 * @ORM\Table(name="question")
20
 * @ORM\Entity(repositoryClass="AppBundle\Repository\QuestionRepository")
21
 */
22
class Question
23
{
24
    /**
25
     * @ORM\Id
26
     * @ORM\GeneratedValue
27
     * @ORM\Column(type="integer")
28
     */
29
    private $id;
30
31
    /**
32
     * @ORM\Column(name="sort", type="integer")
33
     */
34
    private $sort;
35
36
    /**
37
     * @ORM\Column(name="text_question", type="string")
38
     * @Assert\NotBlank()
39
     */
40
    private $textQuestion;
41
42
    /**
43
     * @ORM\Column(name="all_incorrect", type="boolean", nullable=true)
44
     */
45
    private $allIncorrect;
46
    /**
47
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Module", inversedBy="questions")
48
     */
49
    private $module;
50
51
    /**
52
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\Answer", mappedBy="question", cascade={"persist", "remove"})
53
     * @Assert\Count(
54
     *      min = "2",
55
     *      minMessage = "You must specify at least two answers"
56
     * )
57
     */
58
    private $answers;
59
60
    /**
61
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\PassModule", mappedBy="currentQuestion")
62
     */
63
    private $passModules;
0 ignored issues
show
The property $passModules is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
64
65
66 27
    public function __construct()
67
    {
68 27
        $this->answers = new ArrayCollection();
69 27
    }
70
71
    /**
72
     * @return mixed
73
     */
74 3
    public function getAnswers()
75
    {
76 3
        return $this->answers;
77
    }
78
79
    /**
80
     * @param Answer $answer
81
     * @return $this
82
     */
83
    public function addAnswer(Answer $answer)
84
    {
85
        $this->answers->add($answer);
86
87
        return $this;
88
    }
89
90
    /**
91
     * @param Answer $answer
92
     */
93
    public function removeAnswer(Answer $answer)
94
    {
95
        $this->answers->removeElement($answer);
96
    }
97
98
    /**
99
     * @return mixed
100
     */
101 2
    public function getId()
102
    {
103 2
        return $this->id;
104
    }
105
106
    /**
107
     * @return mixed
108
     */
109 3
    public function getSort()
110
    {
111 3
        return $this->sort;
112
    }
113
114
    /**
115
     * @param mixed $sort
116
     */
117 27
    public function setSort($sort)
118
    {
119 27
        $this->sort = $sort;
120 27
    }
121
122
    /**
123
     * @return mixed
124
     */
125 4
    public function getTextQuestion()
126
    {
127 4
        return $this->textQuestion;
128
    }
129
130
    /**
131
     * @param mixed $textQuestion
132
     */
133 27
    public function setTextQuestion($textQuestion)
134
    {
135 27
        $this->textQuestion = $textQuestion;
136 27
    }
137
138
    /**
139
     * @return mixed
140
     */
141 1
    public function getModule()
142
    {
143 1
        return $this->module;
144
    }
145
146
    /**
147
     * @param mixed $module
148
     */
149 27
    public function setModule(Module $module = null)
150
    {
151 27
        $this->module = $module;
152 27
    }
153
154
    /**
155
     * @return mixed
156
     */
157 2
    public function getAllIncorrect()
158
    {
159 2
        return $this->allIncorrect;
160
    }
161
162
    /**
163
     * @param mixed $allIncorrect
164
     */
165 27
    public function setAllIncorrect($allIncorrect)
166
    {
167 27
        $this->allIncorrect = $allIncorrect;
168 27
    }
169
170 1
    public function getCountAnswers()
171
    {
172 1
        return count($this->answers);
173
    }
174
175
}
176