Showing 2,235 of 2,235 total issues
execute accesses the super-global variable $_ENV. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$time = $input->getOption('time');
list($hours, $minutes) = CommandHelper::validateTimeInput($time);
$arguments = '--instances=all --no-interaction';
- 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 execute() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$vcsOption = $input->getOption('vcs');
$vcsOption = $vcsOption ? strtoupper($vcsOption) : '';
if (! in_array($vcsOption, ['SVN', 'GIT', 'SRC'])) {
- 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
setupDatabase accesses the super-global variable $_ENV. Open
public function setupDatabase(Instance $instance, $reconfigure = false): Instance
{
try {
if (!$reconfigure && $this->testExistingDbConnection($instance)) {
return $instance;
- 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
execute accesses the super-global variable $_ENV. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$time = $input->getOption('time');
// Check if option (set in cli is also valid)
list($hours, $minutes) = CommandHelper::validateTimeInput($time);
- 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
execute accesses the super-global variable $_ENV. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$email = $input->getOption('email');
if (empty($email) || ! filter_var($email, FILTER_VALIDATE_EMAIL)) {
- 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
setRequiredEnvironmentVariables accesses the super-global variable $_ENV. Open
private function setRequiredEnvironmentVariables()
{
$pharPath = Phar::running(false);
$_ENV['IS_PHAR'] = $isPhar = isset($pharPath) && !empty($pharPath);
- 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
runSetup accesses the super-global variable $_ENV. Open
private function runSetup()
{
debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);
$writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
- 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
runSetup accesses the super-global variable $_ENV. Open
private function runSetup()
{
debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);
$writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
- 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
runSetup accesses the super-global variable $_ENV. Open
private function runSetup()
{
debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);
$writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
- 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 setupInstance() has a Cyclomatic Complexity of 37. The configured cyclomatic complexity threshold is 10. Open
public function setupInstance(Instance $instance, $import = false) : Instance
{
$url = $this->input->getOption('url') ?: $instance->getDiscovery()->detectWeburl();
$url = $this->io->ask('WebUrl', $url, function ($value) {
if (empty($value)) {
- 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
The method execute() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$email = $input->getOption('email');
if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
- 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
loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV. Open
private function loadEnvironmentVariablesContainingLogic()
{
$_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));
if ($_ENV['TRIM_OS'] === 'WIN') {
- 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
runSetup accesses the super-global variable $_ENV. Open
private function runSetup()
{
debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);
$writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
- 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
setComposerPath accesses the super-global variable $_ENV. Open
public function setComposerPath($composerPath)
{
if (file_exists($composerPath)) {
$_ENV['COMPOSER_PATH'] = $composerPath;
} else {
- 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
loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV. Open
private function loadEnvironmentVariablesContainingLogic()
{
$_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));
if ($_ENV['TRIM_OS'] === 'WIN') {
- 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
loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV. Open
private function loadEnvironmentVariablesContainingLogic()
{
$_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));
if ($_ENV['TRIM_OS'] === 'WIN') {
- 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
runSetup accesses the super-global variable $_ENV. Open
private function runSetup()
{
debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);
$writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
- 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
execute accesses the super-global variable $_ENV. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$databaseFile = $_ENV['DB_FILE'];
$sqliteVersion = shell_exec(self::SQLITE.' --version');
- 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
loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV. Open
private function loadEnvironmentVariablesContainingLogic()
{
$_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));
if ($_ENV['TRIM_OS'] === 'WIN') {
- 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
setRequiredEnvironmentVariables accesses the super-global variable $_ENV. Open
private function setRequiredEnvironmentVariables()
{
$pharPath = Phar::running(false);
$_ENV['IS_PHAR'] = $isPhar = isset($pharPath) && !empty($pharPath);
- 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'];
}
}