Showing 2,235 of 2,235 total issues
runCommands accesses the super-global variable $_ENV. Open
public function runCommands($commands, $output = false)
{
$key = $_ENV['SSH_KEY'];
$config = $_ENV['SSH_CONFIG'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
runCommands accesses the super-global variable $_ENV. Open
public function runCommands($commands, $output = false)
{
$key = $_ENV['SSH_KEY'];
$config = $_ENV['SSH_CONFIG'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The method update() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10. Open
public function update(string $targetFolder, string $branch, int $lag = 0, ?string $revision = null)
{
$commitSHA = $revision;
$fetchOptions = [];
$time = time() - $lag * 60 * 60 * 24;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
setSafeDirectory accesses the super-global variable $_SERVER. Open
private function setSafeDirectory($instance)
{
$skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;
if ($skipSafeDir) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
runCommands accesses the super-global variable $_ENV. Open
public function runCommands($commands, $output = false)
{
$key = $_ENV['SSH_KEY'];
$config = $_ENV['SSH_CONFIG'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
setSafeDirectory accesses the super-global variable $_ENV. Open
private function setSafeDirectory($instance)
{
$skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;
if ($skipSafeDir) {
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The variable $num_rows is not named in camelCase. Open
function _mysqldump_table_data($table)
{
$sql = "select COUNT(*) from `$table`;";
$result = query($sql);
$num_rows = fetch_row($result);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $num_fields is not named in camelCase. Open
function _mysqldump_table_data($table)
{
$sql = "select COUNT(*) from `$table`;";
$result = query($sql);
$num_rows = fetch_row($result);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $mysqli_db_link is not named in camelCase. Open
function free($result)
{
global $mysqli_db_link;
return mysqli_free_result($result);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $svn_name is not named in camelCase. Open
public function getSVNPath()
{
$host = $this->getHost();
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $mysqli_db_link is not named in camelCase. Open
function fetch_field($result, $field)
{
global $mysqli_db_link;
return mysqli_fetch_field_direct($result, $field);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $num_fields is not named in camelCase. Open
function _mysqldump_table_data($table)
{
$sql = "select COUNT(*) from `$table`;";
$result = query($sql);
$num_rows = fetch_row($result);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $output_length is not named in camelCase. Open
function _mysqldump_table_data($table)
{
$sql = "select COUNT(*) from `$table`;";
$result = query($sql);
$num_rows = fetch_row($result);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $db_selected is not named in camelCase. Open
function _mysql_test($mysql_host, $mysql_database, $mysql_username, $mysql_password)
{
$link = connect($mysql_host, $mysql_username, $mysql_password);
if ($link) {
$db_selected = select_db($mysql_database, $link);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $mysqli_db_link is not named in camelCase. Open
function escape($data)
{
global $mysqli_db_link;
return mysqli_real_escape_string($mysqli_db_link, $data);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $mysql_password is not named in camelCase. Open
function _mysql_test($mysql_host, $mysql_database, $mysql_username, $mysql_password)
{
$link = connect($mysql_host, $mysql_username, $mysql_password);
if ($link) {
$db_selected = select_db($mysql_database, $link);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $mysqli_db_link is not named in camelCase. Open
function fetch_row($result)
{
global $mysqli_db_link;
return mysqli_fetch_row($result);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $num_rows is not named in camelCase. Open
function _mysqldump_table_data($table)
{
$sql = "select COUNT(*) from `$table`;";
$result = query($sql);
$num_rows = fetch_row($result);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $field_type is not named in camelCase. Open
function _mysqldump_table_data($table)
{
$sql = "select COUNT(*) from `$table`;";
$result = query($sql);
$num_rows = fetch_row($result);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $svn_name is not named in camelCase. Open
public function getSVNPath()
{
$host = $this->getHost();
$sets = [
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}