Issues (4388)

Security Analysis    no vulnerabilities found

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.

src/Controller/ContactsController.php (41 issues)

1
<?php
0 ignored issues
show
Filename "ContactsController.php" doesn't match the expected filename "contactscontroller.php"
Loading history...
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Header blocks must be separated by a single blank line
Loading history...
This file is missing a doc comment.
Loading history...
Class found in ".php" file; use ".inc" extension instead
Loading history...
2
namespace App\Controller;
0 ignored issues
show
Missing file doc comment
Loading history...
3
4
use App\Controller\AppController;
0 ignored issues
show
Unused use statement
Loading history...
5
6
/**
7
 * Contacts Controller
8
 *
9
 * @property \App\Model\Table\ContactsTable $Contacts
10
 *
11
 * @method \App\Model\Entity\Contact[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
12
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
13
class ContactsController extends AppController
14
{
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
Opening brace should be on the same line as the declaration for class ContactsController
Loading history...
15
16
    /**
17
     * Index method
18
     *
19
     * @return \Cake\Http\Response|void
0 ignored issues
show
@return doc comment specified, but function has no return statement
Loading history...
20
     */
21
    public function index()
22
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
23
        $contacts = $this->paginate($this->Contacts);
24
25
        $this->set(compact('contacts'));
26
    }
27
28
    /**
29
     * View method
30
     *
31
     * @param string|null $id Contact id.
0 ignored issues
show
Parameter comment must be on the next line
Loading history...
32
     * @return \Cake\Http\Response|void
0 ignored issues
show
Separate the @param and @return sections by a blank line.
Loading history...
@return doc comment specified, but function has no return statement
Loading history...
33
     * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
0 ignored issues
show
Separate the @return and @throws sections by a blank line.
Loading history...
@throws comment must be on the next line
Loading history...
34
     */
35
    public function view($id = null)
36
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
37
        $contact = $this->Contacts->get($id, [
38
            'contain' => []
0 ignored issues
show
A comma should follow the last multiline array item. Found: ]
Loading history...
39
        ]);
40
41
        $this->set('contact', $contact);
42
    }
43
44
    /**
45
     * Add method
46
     *
47
     * @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
48
     */
49
    public function add()
50
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
51
        $contact = $this->Contacts->newEntity();
52
        if ($this->request->is('post')) {
53
            $contact = $this->Contacts->patchEntity($contact, $this->request->getData());
54
            if ($this->Contacts->save($contact)) {
55
                $this->Flash->success(__('The contact has been saved.'));
56
57
                return $this->redirect(['action' => 'index']);
58
            }
0 ignored issues
show
No blank line found after control structure
Loading history...
59
            $this->Flash->error(__('The contact could not be saved. Please, try again.'));
60
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
61
        $this->set(compact('contact'));
62
    }
63
64
    /**
65
     * Edit method
66
     *
67
     * @param string|null $id Contact id.
0 ignored issues
show
Parameter comment must be on the next line
Loading history...
68
     * @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
0 ignored issues
show
Separate the @param and @return sections by a blank line.
Loading history...
69
     * @throws \Cake\Network\Exception\NotFoundException When record not found.
0 ignored issues
show
Separate the @return and @throws sections by a blank line.
Loading history...
@throws comment must be on the next line
Loading history...
70
     */
71
    public function edit($id = null)
72
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
73
        $contact = $this->Contacts->get($id, [
74
            'contain' => []
0 ignored issues
show
A comma should follow the last multiline array item. Found: ]
Loading history...
75
        ]);
76
        if ($this->request->is(['patch', 'post', 'put'])) {
77
            $contact = $this->Contacts->patchEntity($contact, $this->request->getData());
78
            if ($this->Contacts->save($contact)) {
79
                $this->Flash->success(__('The contact has been saved.'));
80
81
                return $this->redirect(['action' => 'index']);
82
            }
0 ignored issues
show
No blank line found after control structure
Loading history...
83
            $this->Flash->error(__('The contact could not be saved. Please, try again.'));
84
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
85
        $this->set(compact('contact'));
86
    }
87
88
    /**
89
     * Delete method
90
     *
91
     * @param string|null $id Contact id.
0 ignored issues
show
Parameter comment must be on the next line
Loading history...
92
     * @return \Cake\Http\Response|null Redirects to index.
0 ignored issues
show
Separate the @param and @return sections by a blank line.
Loading history...
93
     * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
0 ignored issues
show
@throws comment must be on the next line
Loading history...
Separate the @return and @throws sections by a blank line.
Loading history...
94
     */
95
    public function delete($id = null)
96
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
97
        $this->request->allowMethod(['post', 'delete']);
98
        $contact = $this->Contacts->get($id);
99
        if ($this->Contacts->delete($contact)) {
100
            $this->Flash->success(__('The contact has been deleted.'));
101
        } else {
0 ignored issues
show
Expected newline after closing brace
Loading history...
102
            $this->Flash->error(__('The contact could not be deleted. Please, try again.'));
103
        }
104
105
        return $this->redirect(['action' => 'index']);
106
    }
0 ignored issues
show
Expected 1 blank line after function; 0 found
Loading history...
107
}
108