Issues (1925)

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.

app/Models/Comment.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
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Models;
9
10
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
11
use Illuminate\Database\Eloquent\Model;
12
use Illuminate\Database\Eloquent\SoftDeletes;
13
14
/**
15
 * Class Comment.
16
 *
17
 * @property int $id
18
 * @property int $user_id
19
 * @property int $content_id
20
 * @property string $content_type
21
 * @property string $comment_md
22
 * @property string $comment_html
23
 * @property \Carbon\Carbon $created_at
24
 * @property \Carbon\Carbon $updated_at
25
 * @property string $deleted_at
26
 * @property int $vote_up
27
 * @property int $vote_down
28
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereId($value)
29
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereUserId($value)
30
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereContentId($value)
31
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereContentType($value)
32
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereCommentMd($value)
33
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereCommentHtml($value)
34
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereCreatedAt($value)
35
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereUpdatedAt($value)
36
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereDeletedAt($value)
37
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereVoteUp($value)
38
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment whereVoteDown($value)
39
 * @mixin \Eloquent
40
 * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $content
41
 * @property-read \App\Models\User $user
42
 * @property-read \App\Models\Game $game
43
 * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory
44
 * @property-read \App\Models\News $news
45
 * @method static bool|null forceDelete()
46
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment onlyTrashed()
47
 * @method static bool|null restore()
48
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment withTrashed()
49
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Comment withoutTrashed()
50
 * @property int $deleted
51
 * @property string $delete_reason
52
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Comment whereDeleteReason($value)
53
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Comment whereDeleted($value)
54
 */
55 View Code Duplication
class Comment extends Model
0 ignored issues
show
This class 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
    use \Venturecraft\Revisionable\RevisionableTrait;
58
    use SoftDeletes;
59
60
    public $timestamps = true;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
61
    protected $table = 'comments';
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
62
    protected $fillable = [
63
        'user_id',
64
        'content_id',
65
        'content_type',
66
        'comment_md',
67
        'comment_html',
68
        'vote_up',
69
        'vote_down',
70
        'deleted',
71
        'delete_reason',
72
    ];
73
74
    protected $dates = ['deleted_at'];
75
76
    protected $guarded = [];
77
78
    public function content()
79
    {
80
        return $this->morphTo();
81
    }
82
83
    public function user()
84
    {
85
        return $this->belongsTo('App\Models\User');
86
    }
87
88
    public function game()
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
89
    {
90
        return $this->hasOne('App\Models\Game', 'id', 'content_id')->with('user', 'maker', 'gamefiles', 'language');
91
    }
92
93
    public function news()
94
    {
95
        return $this->hasOne('App\Models\News', 'id', 'content_id');
96
    }
97
}
98