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

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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/Shodan.php (61 issues)

1
<?php
0 ignored issues
show
Class found in ".php" file; use ".inc" extension instead
Loading history...
This file is missing a doc comment.
Loading history...
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Filename "Shodan.php" doesn't match the expected filename "shodan.php"
Loading history...
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace RattfieldNz\Shodan;
4
5
use ErrorException;
6
use RattfieldNz\Shodan\Libraries\Curl\Curl;
7
use RattfieldNz\Shodan\Libraries\Data\Data;
8
9
/**
10
 * Class Shodan.
11
 *
12
 * @category PHP
0 ignored issues
show
Coding Style Documentation introduced by
@category tag is not allowed in class comment
Loading history...
13
 *
14
 * @author  Rob Attfield <[email protected]>
0 ignored issues
show
Coding Style Documentation introduced by
@author tag is not allowed in class comment
Loading history...
15
 * @license https://github.com/rattfieldnz/shodan/blob/master/LICENSE MIT
0 ignored issues
show
Coding Style Documentation introduced by
@license tag is not allowed in class comment
Loading history...
16
 */
0 ignored issues
show
Missing @package tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
17
class Shodan
18
{
0 ignored issues
show
Opening brace should be on the same line as the declaration for class Shodan
Loading history...
19
    private $_url;
0 ignored issues
show
Expected 1 blank line(s) before first member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
20
21
    private $_results;
0 ignored issues
show
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
22
23
    private $_data;
0 ignored issues
show
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
24
25 6
    public function __construct()
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
Missing doc comment for function __construct()
Loading history...
26
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
27 6
        $this->_results = null;
0 ignored issues
show
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
28 6
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end __construct()
Loading history...
29
30
    /**
31
     * Add URL to be checked with Shodan API.
32
     *
33
     * @param string $url The URL to be checked.
34
     *
35
     * @return Shodan.
0 ignored issues
show
Documentation Bug introduced by
The doc comment Shodan. at position 0 could not be parsed: Unknown type name 'Shodan.' at position 0 in Shodan..
Loading history...
36
     */
37 4
    public function setUrl(string $url)
38
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
39 4
        $this->_url = $url;
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...
40 4
        $this->_data = new Data($this->_url);
41
42 4
        return $this;
43
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end setUrl()
Loading history...
44
45
    /**
46
     * Checks a given URL with Shodan API.
47
     *
48
     * @throws ErrorException
0 ignored issues
show
Comment missing for @throws tag in function comment
Loading history...
49
     *
50
     * @return Shodan
51
     */
52 2
    public function check()
53
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
54
        $error = [
0 ignored issues
show
Short array syntax is not allowed
Loading history...
55 2
            'status'   => 500,
0 ignored issues
show
This array key does not seem to be aligned correctly; expected 18 spaces, but found 12.
Loading history...
56
            'response' => 'URL cannot be null.',
0 ignored issues
show
This array key does not seem to be aligned correctly; expected 18 spaces, but found 12.
Loading history...
57
        ];
0 ignored issues
show
The closing parenthesis does not seem to be aligned correctly; expected 17 space(s), but found 8.
Loading history...
58
59 2
        $this->_results = empty($this->getUrl()) || empty($this->_data) ?
0 ignored issues
show
The value of a boolean operation must not be assigned to a variable
Loading history...
Boolean operators are not allowed outside of control structure conditions
Loading history...
Expected 1 space after "?"; newline found
Loading history...
Inline IF statements are not allowed
Loading history...
Inline shorthand IF statement must be declared on a single line
Loading history...
60 2
            $error : (new Curl($this->_data))->getData();
61
62 2
        return $this;
63
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end check()
Loading history...
64
65
    /**
66
     * Get current URL.
67
     *
68
     * @return string|null
69
     */
70 4
    public function getUrl()
71
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
72 4
        return $this->_url;
73
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end getUrl()
Loading history...
74
75
    /**
76
     * Get results of Shodan API call.
77
     *
78
     * @param bool $jsonEncode Encode results as JSON, or
0 ignored issues
show
Expected "boolean" but found "bool" for parameter type
Loading history...
79
     *                         return as associative array.
80
     *
81
     * @return mixed|null
82
     */
83 3
    public function getResults(bool $jsonEncode = false)
0 ignored issues
show
Incorrect spacing between argument "$jsonEncode" and equals sign; expected 0 but found 1
Loading history...
Incorrect spacing between default value and equals sign for argument "$jsonEncode"; expected 0 but found 1
Loading history...
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
84
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
85 3
        if (empty($this->_results)) {
86 1
            return;
0 ignored issues
show
Function return type is not void, but function is returning void here
Loading history...
87
        }
88
89 2
        return $jsonEncode === false ?
0 ignored issues
show
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
Expected 1 space after "?"; newline found
Loading history...
Inline IF statements are not allowed
Loading history...
Inline shorthand IF statement must be declared on a single line
Loading history...
90 2
            $this->_results : json_encode($this->_results);
91
    }
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end getResults()
Loading history...
92
}
0 ignored issues
show
Expected //end class
Loading history...
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
93