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 (42)

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/Naneau/FileGen/File.php (3 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
namespace Naneau\FileGen;
3
4
use Naneau\FileGen\Parameterized;
5
6
use Naneau\FileGen\AccessRights;
7
8
use Naneau\FileGen\File\Contents as ContentGenerator;
9
use Naneau\FileGen\File\Contents\StringBased as StringContents;
10
11
use \InvalidArgumentException;
12
13
/**
14
 * A file
15
 */
16
class File extends AccessRights
17
{
18
    /**
19
     * Contents of the file
20
     *
21
     * @var ContentGenerator
22
     **/
23
    private $contentGenerator;
24
25
    /**
26
     * Constructor
27
     *
28
     * @param  string                  $name
29
     * @param  ContentGenerator|string $contents
30
     * @param  int                     $mode     mode in octal 0XXX
31
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
32
     **/
33
    public function __construct($name, $contents = '', $mode = null)
34
    {
35
        parent::__construct($name, $mode);
36
37
        $this->setContentGenerator($contents);
0 ignored issues
show
It seems like $contents defined by parameter $contents on line 33 can also be of type string; however, Naneau\FileGen\File::setContentGenerator() does only seem to accept object<Naneau\FileGen\File\Contents>, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
38
    }
39
40
    /**
41
     * Get the contents as a string
42
     *
43
     * @param  array[string]string $parameters
0 ignored issues
show
The doc-type array[string]string could not be parsed: Expected "]" at position 2, but found "string". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
44
     * @return string
45
     **/
46
    public function getContents(array $parameters = array())
47
    {
48
        // Merge incoming parameters with that of the content generator if the
49
        // content generator is parameterized
50
        if ($this->getContentGenerator() instanceof Parameterized) {
51
            $this->getContentGenerator()->setParameters(array_merge(
52
                $this->getContentGenerator()->getParameters(),
53
                $parameters
54
            ));
55
        }
56
57
        return $this->getContentGenerator()->getContents();
58
    }
59
60
    /**
61
     * Get the content generator
62
     *
63
     * @return ContentGenerator
64
     */
65
    public function getContentGenerator()
66
    {
67
        return $this->contentGenerator;
68
    }
69
70
    /**
71
     * Set the content generator
72
     *
73
     * @param  ContentGenerator $contentGenerator
74
     * @return File
75
     */
76
    public function setContentGenerator($contentGenerator)
77
    {
78
        if (is_string($contentGenerator)) {
79
            $this->contentGenerator = new StringContents($contentGenerator);
80
        } elseif ($contentGenerator instanceof ContentGenerator) {
81
            $this->contentGenerator = $contentGenerator;
82
        } else {
83
            throw new InvalidArgumentException(
84
                'Content generator needs to be string or instance of Naneau\FileGen\File\Contents'
85
            );
86
        }
87
88
        return $this;
89
    }
90
}
91