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.

cardwall/include/PaneBoardBuilder.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, 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
 * Build the artifact tree to be presented on the cardwall
23
 */
24
class Cardwall_PaneBoardBuilder {
25
26
    private $artifact_factory;
27
    private $presenter_builder;
28
    private $dao;
29
    private $swimline_factory;
30
31
    public function __construct(Cardwall_CardInCellPresenterBuilder $presenter_builder, Tracker_ArtifactFactory $artifact_factory, AgileDashboard_BacklogItemDao $dao, Cardwall_SwimlineFactory $swimline_factory) {
32
        $this->presenter_builder = $presenter_builder;
33
        $this->artifact_factory = $artifact_factory;
34
        $this->dao = $dao;
35
        $this->swimline_factory = $swimline_factory;
36
    }
37
38
    /**
39
     * Get the board
40
     *
41
     * @param PFUser $user
42
     * @param Tracker_Artifact $milestone_artifact
43
     * @param Cardwall_OnTop_Config_ColumnCollection $columns
44
     * @param Cardwall_MappingCollection $mapping_collection
45
     * @return \Cardwall_Board
46
     */
47
    public function getBoard(PFUser $user, Tracker_Artifact $milestone_artifact, Cardwall_OnTop_Config_ColumnCollection $columns, Cardwall_MappingCollection $mapping_collection) {
48
        return new Cardwall_Board(
49
            $this->getSwimlines($user, $milestone_artifact, $columns),
50
            $columns,
51
            $mapping_collection
52
        );
53
    }
54
55
    /**
56
     * Retrieves the artifacts planned for the given milestone artifact.
57
     *
58
     * @param PFUser $user
59
     * @param Tracker_Artifact $milestone_artifact
60
     * @param Cardwall_OnTop_Config_ColumnCollection $columns
61
     *
62
     * @return Cardwall_Swimline[]
63
     */
64
    private function getSwimlines(PFUser $user, Tracker_Artifact $milestone_artifact, Cardwall_OnTop_Config_ColumnCollection $columns) {
65
        $swimlines = array();
66
        foreach ($this->dao->getBacklogArtifacts($milestone_artifact->getId()) as $row) {
0 ignored issues
show
The expression $this->dao->getBacklogAr...tone_artifact->getId()) of type false|object is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
67
            $swimline_artifact = $this->artifact_factory->getInstanceFromRow($row);
68
            if ($swimline_artifact->userCanView($user)) {
69
                $swimlines[] = $this->buildSwimlineForArtifact($user, $swimline_artifact, $columns);
70
            }
71
        }
72
        return $swimlines;
73
    }
74
75
    private function buildSwimlineForArtifact(PFUser $user, Tracker_Artifact $artifact, Cardwall_OnTop_Config_ColumnCollection $columns) {
76
        $artifact_presenter = $this->presenter_builder->getCardInCellPresenter($artifact, $artifact->getId());
77
        $children           = $artifact->getChildrenForUser($user);
78
79
        if ($children) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $children of type Tracker_Artifact[] is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
80
            $children_presenters = $this->presenter_builder->getCardInCellPresenters($children, $artifact->getId());
81
            return $this->buildSwimline($artifact_presenter, $columns, $children_presenters);
82
        } else {
83
            return $this->buildSwimlineSolo($artifact, $artifact_presenter, $columns);
84
        }
85
    }
86
87
    private function buildSwimlineSolo(Tracker_Artifact $artifact, Cardwall_CardInCellPresenter $artifact_presenter, Cardwall_OnTop_Config_ColumnCollection $columns) {
88
        $cells = $this->swimline_factory->getCells($columns, array($artifact_presenter));
89
90
        if ($this->areSwimlineCellsEmpty($cells)) {
91
            return $this->buildSwimlineSoloNoMatchingColumns($artifact_presenter, $artifact, $cells);
92
        }
93
94
        return new Cardwall_SwimlineSolo(
95
            $artifact->getId(),
96
            $cells
97
        );
98
    }
99
100
    private function areSwimlineCellsEmpty(array $cells) {
101
        foreach ($cells as $cell) {
102
            if ($cell['cardincell_presenters']) {
103
                return false;
104
            }
105
        }
106
107
        return true;
108
    }
109
110
    private function buildSwimline(Cardwall_CardInCellPresenter $artifact_presenter, Cardwall_OnTop_Config_ColumnCollection $columns, array $children_presenters) {
111
        return new Cardwall_Swimline(
112
            $artifact_presenter,
113
            $this->swimline_factory->getCells($columns, $children_presenters)
114
        );
115
    }
116
117
    private function buildSwimlineSoloNoMatchingColumns(Cardwall_CardInCellPresenter $artifact_presenter, Tracker_Artifact $artifact, array $cells) {
118
        return new Cardwall_SwimlineSoloNoMatchingColumns(
119
            $artifact_presenter,
120
            $artifact,
121
            $cells
122
        );
123
    }
124
}
125
126
?>
127