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.

tests/lib/TuleapDbTestCase.class.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
 * Copyright (c) Enalean, 2012. 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
require_once 'common/dao/CodendiDataAccess.class.php';
22
require_once 'database.php';
23
24
// GRANT ALL PRIVILEGES on integration_test.* to 'integration_test'@'localhost' identified by 'welcome0';
25
abstract class TuleapDbTestCase extends TuleapTestCase {
26
    protected $mysqli;
27
28
    protected static $db_initialized = false;
29
30
    private $development_on_going = false;
31
32
    private $src_dir = '';
33
34
    public function __construct() {
35
        parent::__construct();
36
        $this->loadConfiguration();
37
        $this->mysqli = mysqli_init();
38
        if (!$this->mysqli->real_connect($GLOBALS['sys_dbhost'], $GLOBALS['sys_dbuser'], $GLOBALS['sys_dbpasswd'])) {
39
            $this->mysqli = false;
40
        }
41
        $this->src_dir = realpath(dirname(__FILE__)."/../..");
42
    }
43
44
    public function setUp() {
45
        parent::setUp();
46
        ForgeConfig::set('DEBUG_MODE', true);
47
        if (self::$db_initialized == false) {
0 ignored issues
show
Coding Style Best Practice introduced by
It seems like you are loosely comparing two booleans. Considering using the strict comparison === instead.

When comparing two booleans, it is generally considered safer to use the strict comparison operator.

Loading history...
48
            self::$db_initialized = true;
49
            $this->initDb();
50
        }
51
        $this->mysqli->select_db($GLOBALS['sys_dbname']);
52
        db_connect();
53
    }
54
55
    public function skip() {
56
        parent::skip();
57
        if (!$this->mysqli) {
58
            echo "== (屮ಠ益ಠ)屮 Y U NO CONFIGURE DATABASE? ==\n";
59
        }
60
        $this->skipUnless($this->mysqli, '== (屮ಠ益ಠ)屮 Y U NO CONFIGURE DATABASE? ==');
0 ignored issues
show
It seems like $this->mysqli can also be of type false; however, SimpleTestCase::skipUnless() does only seem to accept string, did you maybe forget to handle an error condition?
Loading history...
61
    }
62
63
    public function tearDown() {
64
        unset($GLOBALS['sys_dbhost']);
65
        unset($GLOBALS['sys_dbuser']);
66
        unset($GLOBALS['sys_dbpasswd']);
67
        unset($GLOBALS['sys_dbname']);
68
        parent::tearDown();
69
    }
70
71
    /**
72
     * Use this method to flag your test as 'under development'
73
     * This will prevent drop of the database before tests and avoid become crasy
74
     * waiting for 50" test execution.
75
     */
76
    protected function markThisTestUnderDevelopment() {
77
        self::$db_initialized       = true;
78
        $this->development_on_going = true;
79
    }
80
81
    protected function thisTestIsNotUnderDevelopment() {
82
        return !$this->development_on_going;
83
    }
84
85
    /**
86
     * Use this method if you need to drop the database after a test
87
     */
88
    protected function resetDatabase() {
89
        self::$db_initialized = false;
90
    }
91
92
93
    protected function truncateTable($table) {
94
        $this->mysqli->query("TRUNCATE TABLE $table");
95
    }
96
97
    /**
98
     * Execute all statements of given file (bulk imports)
99
     *
100
     * @param String $file
101
     */
102
    protected function mysqlLoadFile($file) {
103
        $mysql_cmd = 'mysql -u'.$GLOBALS['sys_dbuser'].' -p'.$GLOBALS['sys_dbpasswd'].' '.$GLOBALS['sys_dbname'];
104
        $cmd = $mysql_cmd.' < '.$this->src_dir.'/'.$file;
105
        system($cmd);
106
    }
107
108
    private function loadConfiguration() {
109
        $config_file = 'tests.inc';
110
        ForgeConfig::loadFromFile(dirname(__FILE__)."/../../src/etc/$config_file.dist");
111
        ForgeConfig::loadFromFile(dirname($this->getLocalIncPath())."/$config_file");
112
        $GLOBALS['sys_dbhost']   = ForgeConfig::get('sys_dbhost');
113
        $GLOBALS['sys_dbuser']   = ForgeConfig::get('sys_dbuser');
114
        $GLOBALS['sys_dbpasswd'] = ForgeConfig::get('sys_dbpasswd');
115
        $GLOBALS['sys_dbname']   = ForgeConfig::get('sys_dbname');
116
    }
117
118
    private function getLocalIncPath() {
119
        return getenv('CODENDI_LOCAL_INC') ? getenv('CODENDI_LOCAL_INC') : '/etc/codendi/conf/local.inc';
120
    }
121
122
    private function foraceCreateDatabase() {
123
        $this->mysqli->query("DROP DATABASE IF EXISTS ".$GLOBALS['sys_dbname']);
124
        $this->mysqli->query("CREATE DATABASE ".$GLOBALS['sys_dbname']);
125
    }
126
127
    protected function initDb() {
128
        $this->foraceCreateDatabase();
129
        $this->mysqlLoadFile('src/db/mysql/database_structure.sql');
130
        $this->mysqlLoadFile('src/db/mysql/database_initvalues.sql');
131
        $this->mysqlLoadFile('src/db/mysql/trackerv3structure.sql');
132
        $this->mysqlLoadFile('src/db/mysql/trackerv3values.sql');
133
        $this->mysqlLoadFile('plugins/tracker_date_reminder/db/install.sql');
134
        $this->mysqlLoadFile('plugins/tracker_date_reminder/db/examples.sql');
135
        $this->mysqlLoadFile('plugins/graphontrackers/db/install.sql');
136
        $this->mysqlLoadFile('plugins/graphontrackers/db/initvalues.sql');
137
        $this->mysqlLoadFile('plugins/tracker/db/install.sql');
138
        $this->mysqlLoadFile('plugins/graphontrackersv5/db/install.sql');
139
        $this->mysqlLoadFile('plugins/statistics/db/install.sql');
140
    }
141
}
142
143
?>
144