Issues (4069)

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.

jssource/jsmin.php (5 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
class SugarMin {
0 ignored issues
show
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
4
5
    /**
6
     * jsParser will take javascript source code and minify it.
7
     *
8
     * Note: There is a lot of redundant code since both passes
9
     * operate similarly but with slight differences. It will probably
10
     * be a good idea to refactor the code at a later point when it is stable.
11
     *
12
     * JSParser will perform 3 passes on the code. Pass 1 takes care of single
13
     * line and mult-line comments. Pass 2 performs some sanitation on each of the lines
14
     * and pass 3 works on stripping out unnecessary spaces.
15
     *
16
     * @param string $js
0 ignored issues
show
There is no parameter named $js. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
17
     * @param string $currentOptions
0 ignored issues
show
There is no parameter named $currentOptions. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
18
     * @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...
19
     */
20 1
    private function __construct($text, $compression) {
21 1
        $this->text = trim($text)."\n";
22 1
        $this->compression = $compression;
23 1
    }
24
25
    /**
26
     * Entry point function to minify javascript.
27
     *
28
     * @param string $js Javascript source code as a string.
29
     * @param string $compression Compression option. {light, deep}.
30
     * @return string $output Output javascript code as a string.
31
     */
32 1
    static public function minify($js, $compression = 'light') {
0 ignored issues
show
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
33
        try {
34 1
            $me = new SugarMin($js, $compression);
35 1
            $output = $me->jsParser();
36
37 1
            return $output;
38
        } catch (Exception $e) {
39
            // Exception handling is left up to the implementer.
40
            throw $e;
41
        }
42
    }
43
44 1
    protected function jsParser() {
45 1
        require_once('jssource/Minifier.php');
46 1
        return Minifier::minify($this->text);
47
	}
48
}
49