GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (4873)

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.

plugins/cardwall/include/SingleCard.class.php (1 issue)

Labels
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
 * Copyright (c) Enalean, 2013. All Rights Reserved.
4
 *
5
 * This file is a part of Tuleap.
6
 *
7
 * Tuleap is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 2 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * Tuleap is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
/**
22
 * This class is a wrapper on top of card in cell presenter to be used when
23
 * a card is rendered out of the board context.
24
 *
25
 * In other words it's what you need when you only want to have one single card
26
 */
27
class Cardwall_SingleCard {
28
29
    /** @var Cardwall_CardInCellPresenter */
30
    private $card_in_cell_presenter;
31
32
    /** @var Tracker_Artifact */
33
    private $artifact;
34
35
    /** @var Cardwall_CardFields */
36
    private $card_fields;
37
38
    /** @var Cardwall_UserPreferences_UserPreferencesDisplayUser */
39
    private $display_preferences;
40
41
    /** @var int */
42
    private $column_id;
43
44
    /** @var Cardwall_OnTop_Config_TrackerMapping */
45
    private $mapping;
46
47
    /** @var array */
48
    private $fields_cache = null;
49
50
    public function __construct(
51
        Cardwall_CardInCellPresenter $card_in_cell_presenter,
52
        Cardwall_CardFields $card_fields,
53
        Cardwall_UserPreferences_UserPreferencesDisplayUser $display_preferences,
54
        $column_id,
55
        Cardwall_OnTop_Config_TrackerMapping $mapping
56
    ) {
57
        $this->card_in_cell_presenter = $card_in_cell_presenter;
58
        $this->artifact               = $card_in_cell_presenter->getArtifact();
59
        $this->card_fields            = $card_fields;
60
        $this->display_preferences    = $display_preferences;
61
        $this->column_id              = $column_id;
62
        $this->mapping                = $mapping;
63
    }
64
65
    /**
66
     * @return Cardwall_CardInCellPresenter
67
     */
68
    public function getCardInCellPresenter() {
69
        return $this->card_in_cell_presenter;
70
    }
71
72
    public function getColumnId() {
73
        return $this->column_id;
74
    }
75
76
    public function getFields() {
77
        return $this->card_fields->getFields($this->artifact);
78
    }
79
80
    /**
81
     * Return a field on the card based on the card
82
     *
83
     * @param Integer $id
84
     *
85
     * @return Tracker_FormElement_Field
86
     */
87
    public function getFieldById($id) {
88
        if ($this->fields_cache === null) {
89
            foreach ($this->getFields() as $field) {
90
                $this->fields_cache[$field->getId()] = $field;
91
            }
92
        }
93
        if (isset($this->fields_cache[$id])) {
94
            return $this->fields_cache[$id];
95
        }
96
        throw new Cardwall_FieldNotOnCardException($id);
97
    }
98
99
    /**
100
     * @return Tracker_Artifact
101
     */
102
    public function getArtifact() {
103
        return $this->artifact;
104
    }
105
106
    public function getFieldJsonValue(PFUser $user, Tracker_FormElement_Field $field) {
107
        return $field->getJsonValue($user, $this->artifact->getLastChangeset());
0 ignored issues
show
It seems like $this->artifact->getLastChangeset() can be null; however, getJsonValue() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
108
    }
109
110
    public function getFieldHTMLValue(PFUser $user, Tracker_FormElement_Field $field) {
111
        return $field->fetchCardValue($this->artifact, $this->display_preferences);
112
    }
113
114
    public function getMapping() {
115
        return $this->mapping;
116
    }
117
}
118