Issues (3)

Security Analysis    no request data  

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/DB/Table.php (2 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
 * Potatobase (https://github.com/PotatoPowered/potatobase)
4
 *
5
 * Licensed under The MIT License
6
 * For full copyright and license information, please see the LICENSE
7
 * Redistributions of files must retain the above copyright notice.
8
 *
9
 * @license     http://www.opensource.org/licenses/mit-license.php MIT License
10
 * @copyright   Copyright (c) Potato Powered Software
11
 * @link        http://potatopowered.net
12
 * @author      Blake Sutton <[email protected]>
13
 */
14
namespace Potatobase\DB;
15
16
use Phinx\Db\Table as BaseTable;
17
18
/**
19
 * Class Table
20
 *
21
 * This class is an extension to the default migration tools Table object. The goal of this object is to extend the base
22
 * table so that we can provide some default column builders and other tools.
23
 *
24
 * @package Potatobase\DB
25
 */
26
class Table extends BaseTable
27
{
28
    /**
29
     * Add a Created Timestamp Column
30
     *
31
     * This function is a simple accessor to allow a universal design for the created timestamp.
32
     *
33
     * @return BaseTable The table object with a created column added.
34
     */
35 View Code Duplication
    public function addCreated()
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...
36
    {
37
        return $this->addColumn(
38
            'created',
39
            'datetime',
40
            [
41
                'default' => null,
42
                'limit' => null,
43
                'null' => true,
44
            ]
45
        );
46
    }
47
48
    /**
49
     * Add a Modified Timestamp Column
50
     *
51
     * This function is a simple accessor to allow a universal design for the modified timestamp.
52
     *
53
     * @return BaseTable The table object with a modified column added.
54
     */
55 View Code Duplication
    public function addModified()
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...
56
    {
57
        return $this->addColumn(
58
            'modified',
59
            'datetime',
60
            [
61
                'default' => null,
62
                'limit' => null,
63
                'null' => true,
64
            ]
65
        );
66
    }
67
68
    /**
69
     * Add a varchar column to the table
70
     *
71
     * This function will be used to add a different styles of varchar type columns to the table. It can be called
72
     * directly but it is recommended to use the specific column creation methods.
73
     *
74
     * @param string    $name       Name of the column to add
75
     * @param int       $size       Character limit of the new column
76
     * @param bool      $nullable   Is the field be nullable
77
     * @param string    $default    The default value for the field
78
     * @return BaseTable The table object with the varchar column added.
79
     */
80
    public function addVarChar($name, $size, $nullable = true, $default = null)
81
    {
82
        return $this->addColumn(
83
            $name,
84
            'string',
85
            [
86
                'default' => $default,
87
                'limit' => $size,
88
                'null' => $nullable
89
            ]
90
        );
91
    }
92
93
    /**
94
     * Add a tiny varchar column to the table
95
     *
96
     * This function adds a 25 character length varchar column to the table.
97
     *   + **Type:** varchar
98
     *   + **Size:** 25
99
     *   + **Nullable:** false
100
     *   + **Default:**  null
101
     *
102
     * @param string    $name       Name of the column to add
103
     * @param bool      $nullable   Is the field be nullable
104
     * @param string    $default    The default value for the field
105
     * @return BaseTable The table object with a 25 character varchar column added
106
     */
107
    public function addTinyText($name, $nullable = true, $default = null)
108
    {
109
        return $this->addVarChar($name, 25, $nullable, $default);
110
    }
111
}
112