Showing 765 of 765 total issues
extractUser accesses the super-global variable $_REQUEST. Open
protected function extractUser()
{
$this->user = (string)$_REQUEST["user_name"];
unset($_REQUEST["user_name"]);
$this->userPassword = (string)$_REQUEST["user_password"];
- 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
generateSiteUrl accesses the super-global variable $_SERVER. Open
protected function generateSiteUrl()
{
$dir = dirname(substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"])));
if ($dir == '.' || $dir == '..') {
$dir = '';
- 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
getTimeZone accesses the super-global variable $_SERVER. Open
protected function getTimeZone()
{
static $ip;
if (empty($ip)) {
$ip = @file_get_contents("http://ipecho.net/plain");
- 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
convertRequestToConfig accesses the super-global variable $_REQUEST. Open
protected function convertRequestToConfig()
{
$array = array();
foreach ($_REQUEST as $name => $value) {
if (!is_string($value) || empty($value)) {
- 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
extractUser accesses the super-global variable $_REQUEST. Open
protected function extractUser()
{
$this->user = (string)$_REQUEST["user_name"];
unset($_REQUEST["user_name"]);
$this->userPassword = (string)$_REQUEST["user_password"];
- 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
generateSiteUrl accesses the super-global variable $_SERVER. Open
protected function generateSiteUrl()
{
$dir = dirname(substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"])));
if ($dir == '.' || $dir == '..') {
$dir = '';
- 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
saveConfigs accesses the super-global variable $_SERVER. Open
protected function saveConfigs()
{
$this->extractUser();
//save config.ini
$config = array(
- 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
generateSiteUrl accesses the super-global variable $_SERVER. Open
protected function generateSiteUrl()
{
$dir = dirname(substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"])));
if ($dir == '.' || $dir == '..') {
$dir = '';
- 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
generateSiteUrl accesses the super-global variable $_SERVER. Open
protected function generateSiteUrl()
{
$dir = dirname(substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"])));
if ($dir == '.' || $dir == '..') {
$dir = '';
- 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
saveConfigs accesses the super-global variable $_SERVER. Open
protected function saveConfigs()
{
$this->extractUser();
//save config.ini
$config = array(
- 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
generateSiteUrl accesses the super-global variable $_SERVER. Open
protected function generateSiteUrl()
{
$dir = dirname(substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"])));
if ($dir == '.' || $dir == '..') {
$dir = '';
- 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
install accesses the super-global variable $_SERVER. Open
protected function install()
{
if (HelperClass::fileExists('test.php')) {
unlink(dirname($_SERVER["SCRIPT_FILENAME"]) . "/test.php");
}
- 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
extractUser accesses the super-global variable $_REQUEST. Open
protected function extractUser()
{
$this->user = (string)$_REQUEST["user_name"];
unset($_REQUEST["user_name"]);
$this->userPassword = (string)$_REQUEST["user_password"];
- 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 go() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10. Open
- 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
saveConfigs accesses the super-global variable $_SERVER. Open
protected function saveConfigs()
{
$this->extractUser();
//save config.ini
$config = array(
- 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
runForm accesses the super-global variable $_SESSION. Open
protected function runForm()
{
if (StaticFunctions::from($_REQUEST, 'user_name') && StaticFunctions::from($_REQUEST, 'user_password')) {
$this->install();
$this->saveConfigs();
- 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
saveConfigs accesses the super-global variable $_SERVER. Open
protected function saveConfigs()
{
$this->extractUser();
//save config.ini
$config = array(
- 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
__construct accesses the super-global variable $_SERVER. Open
public function __construct()
{
$messages = $this->testTheEnvironment();
if (StaticFunctions::isWritable("./") && !HelperClass::fileExists(".htaccess")) {
file_put_contents(dirname($_SERVER["SCRIPT_FILENAME"]) . "/.htaccess", GetHtaccess::htaccess());
- 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
__construct accesses the super-global variable $_SERVER. Open
public function __construct()
{
$messages = $this->testTheEnvironment();
if (StaticFunctions::isWritable("./") && !HelperClass::fileExists(".htaccess")) {
file_put_contents(dirname($_SERVER["SCRIPT_FILENAME"]) . "/.htaccess", GetHtaccess::htaccess());
- 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
runForm accesses the super-global variable $_REQUEST. Open
protected function runForm()
{
if (StaticFunctions::from($_REQUEST, 'user_name') && StaticFunctions::from($_REQUEST, 'user_password')) {
$this->install();
$this->saveConfigs();
- 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'];
}
}