execute accesses the super-global variable $_SERVER. Open
function execute() {
$this->readRequest();
$valid = $this->validate();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['settings']['ROOT_PATH'] = $this->xoopsRootPath;
- 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
readRequest accesses the super-global variable $_SERVER. Open
function readRequest() {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$request = $_POST;
/*
$request = xo_input_get_args( INPUT_POST, 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
execute accesses the super-global variable $_SESSION. Open
function execute() {
$this->readRequest();
$valid = $this->validate();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['settings']['ROOT_PATH'] = $this->xoopsRootPath;
- 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
createTrustPath accesses the super-global variable $_SESSION. Open
function createTrustPath() {
if (@icms_core_Filesystem::mkdir($this->xoopsTrustPath, 0777, '', array('[', '?', '"', '<', '>', '|', ' ' ))) {
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
$_SESSION['settings']['TRUST_PATH'] = $this->xoopsTrustPath;
return $this->validTrustPath = true;
- 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
resolveDocumentRoot accesses the super-global variable $_SERVER. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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 $_SESSION. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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
readRequest accesses the super-global variable $_POST. Open
function readRequest() {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$request = $_POST;
/*
$request = xo_input_get_args( INPUT_POST, 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
execute accesses the super-global variable $_SESSION. Open
function execute() {
$this->readRequest();
$valid = $this->validate();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['settings']['ROOT_PATH'] = $this->xoopsRootPath;
- 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 $GLOBALS. Open
function execute() {
$this->readRequest();
$valid = $this->validate();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['settings']['ROOT_PATH'] = $this->xoopsRootPath;
- 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 $_SESSION. Open
function execute() {
$this->readRequest();
$valid = $this->validate();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['settings']['ROOT_PATH'] = $this->xoopsRootPath;
- 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 $_SESSION. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $GLOBALS. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $_SESSION. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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
resolveDocumentRoot accesses the super-global variable $_SERVER. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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 $_SESSION. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $_SESSION. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $_SESSION. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $GLOBALS. Open
function execute() {
$this->readRequest();
$valid = $this->validate();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['settings']['ROOT_PATH'] = $this->xoopsRootPath;
- 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 class PathStuffController has 11 public methods. Consider refactoring PathStuffController to keep number of public methods under 10. Open
class PathStuffController {
var $xoopsRootPath = '';
var $xoopsTrustPath = '';
var $xoopsUrl = '';
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class PathStuffController has an overall complexity of 53 which is very high. The configured complexity threshold is 50. Open
class PathStuffController {
var $xoopsRootPath = '';
var $xoopsTrustPath = '';
var $xoopsUrl = '';
- Exclude checks
File page_pathsettings.php
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Installer paths configuration page
*
* See the enclosed file license.txt for licensing information.
Function readRequest
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function readRequest() {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$request = $_POST;
/*
$request = xo_input_get_args( INPUT_POST, array(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function makeWritable
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method makeWritable
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
Avoid too many return
statements within this method. Open
return false;
The method makeWritable() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- 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
Remove error control operator '@' on line 200. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 212. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 157. Open
function createTrustPath() {
if (@icms_core_Filesystem::mkdir($this->xoopsTrustPath, 0777, '', array('[', '?', '"', '<', '>', '|', ' ' ))) {
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
$_SESSION['settings']['TRUST_PATH'] = $this->xoopsTrustPath;
return $this->validTrustPath = true;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 43. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 149. Open
function checkTrustPath() {
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
return $this->validTrustPath = true;
}
return $this->validTrustPath = false;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
The method makeWritable has a boolean flag argument $recurse, which is a certain sign of a Single Responsibility Principle violation. Open
function makeWritable( $path, $group = false, $recurse = false) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Remove error control operator '@' on line 135. Open
function checkRootPath() {
if (@is_dir( $this->xoopsRootPath ) && @is_readable( $this->xoopsRootPath )) {
@include_once "$this->xoopsRootPath/include/version.php";
if (file_exists( "$this->xoopsRootPath/mainfile.php" ) && defined( 'XOOPS_VERSION' )) {
return $this->validRootPath = true;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
The method makeWritable has a boolean flag argument $group, which is a certain sign of a Single Responsibility Principle violation. Open
function makeWritable( $path, $group = false, $recurse = false) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Remove error control operator '@' on line 135. Open
function checkRootPath() {
if (@is_dir( $this->xoopsRootPath ) && @is_readable( $this->xoopsRootPath )) {
@include_once "$this->xoopsRootPath/include/version.php";
if (file_exists( "$this->xoopsRootPath/mainfile.php" ) && defined( 'XOOPS_VERSION' )) {
return $this->validRootPath = true;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 208. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 157. Open
function createTrustPath() {
if (@icms_core_Filesystem::mkdir($this->xoopsTrustPath, 0777, '', array('[', '?', '"', '<', '>', '|', ' ' ))) {
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
$_SESSION['settings']['TRUST_PATH'] = $this->xoopsTrustPath;
return $this->validTrustPath = true;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 203. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 205. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 211. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 216. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 149. Open
function checkTrustPath() {
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
return $this->validTrustPath = true;
}
return $this->validTrustPath = false;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 156. Open
function createTrustPath() {
if (@icms_core_Filesystem::mkdir($this->xoopsTrustPath, 0777, '', array('[', '?', '"', '<', '>', '|', ' ' ))) {
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
$_SESSION['settings']['TRUST_PATH'] = $this->xoopsTrustPath;
return $this->validTrustPath = true;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 262. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 136. Open
function checkRootPath() {
if (@is_dir( $this->xoopsRootPath ) && @is_readable( $this->xoopsRootPath )) {
@include_once "$this->xoopsRootPath/include/version.php";
if (file_exists( "$this->xoopsRootPath/mainfile.php" ) && defined( 'XOOPS_VERSION' )) {
return $this->validRootPath = true;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 201. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 207. Open
function makeWritable( $path, $group = false, $recurse = false) {
if (!file_exists( $path )) {
return false;
}
$perm = @is_dir( $path ) ? 6 : 7;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
The method execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$GLOBALS['wizard']->redirectToPage( '+0' );
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method genTrustPathCheckHtml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return '<img src="img/no.png" alt="Error" class="rootimg" />' . _INSTALL_ERR_NO_TRUST_PATH_FOUND;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method genRootCheckHtml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return '<img src="img/no.png" alt="Error" class="rootimg" />' .ERR_NO_XOOPS_FOUND;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'icms_core_Filesystem' in method 'createTrustPath'. Open
if (@icms_core_Filesystem::mkdir($this->xoopsTrustPath, 0777, '', array('[', '?', '"', '<', '>', '|', ' ' ))) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
if (file_exists( "$path/mainfile.php" )) {
$this->xoopsRootPath = $path;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$web_root = dirname( $this->xoopsRootPath );
$arr = explode('/',$web_root);
$web_root = '';
for ($i = 0; $i < count($arr)-1; $i++) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$path = $GLOBALS['wizard']->baseLocation();
$this->xoopsUrl = substr( $path, 0, strrpos( $path, '/' ) );
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid unused parameters such as '$recurse'. Open
function makeWritable( $path, $group = false, $recurse = false) {
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid using count() function in for loops. Open
for ($i = 0; $i < count($arr)-1; $i++) {
$web_root .= $arr[$i].'/';
}
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
Returning type false
but findServerGID()
is declared to return int
Open
return false;
- Exclude checks
Suspicious argument void
for an echo/print statement Open
echo genCreateTrustPathHtml( $ctrl->createTrustPath() );
- Exclude checks
Default value for string
$group
can't be false
Open
function makeWritable( $path, $group = false, $recurse = false) {
- Exclude checks
Returning type 'u'
but makeWritable()
is declared to return false
Open
return 'u';
- Exclude checks
Call to method mkdir
from undeclared class \icms_core_Filesystem
Open
if (@icms_core_Filesystem::mkdir($this->xoopsTrustPath, 0777, '', array('[', '?', '"', '<', '>', '|', ' ' ))) {
- Exclude checks
Returning type 'w'
but makeWritable()
is declared to return false
Open
return 'w';
- Exclude checks
Variable $wizard
is undeclared Open
$wizard->setPage( 'pathsettings' );
- Exclude checks
Returning type 'g'
but makeWritable()
is declared to return false
Open
return 'g';
- Exclude checks
Argument 1 (str)
is int
but \md5()
takes string
Open
$this->xoopsTrustPath = $docroot . substr( md5( time() ), 0, 15);
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isset($request['ROOT_PATH'])) {
$request['ROOT_PATH'] = str_replace( "\\", "/", $request['ROOT_PATH'] );
if (substr( $request['ROOT_PATH'], -1 ) == '/') {
$request['ROOT_PATH'] = substr( $request['ROOT_PATH'], 0, -1 );
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 107.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isset($request['TRUST_PATH'])) {
$request['TRUST_PATH'] = str_replace( "\\", "/", $request['TRUST_PATH'] );
if (substr( $request['TRUST_PATH'], -1 ) == '/') {
$request['TRUST_PATH'] = substr( $request['TRUST_PATH'], 0, -1 );
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 107.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class PathStuffController {
- Exclude checks
Visibility must be declared on property "$validTrustPath" Open
var $validTrustPath = false;
- Exclude checks
Visibility must be declared on property "$validUrl" Open
var $validUrl = false;
- Exclude checks
Visibility must be declared on property "$permErrors" Open
var $permErrors = array();
- Exclude checks
Visibility must be declared on method "execute" Open
function execute() {
- Exclude checks
The var keyword must not be used to declare a property Open
var $validTrustPath = false;
- Exclude checks
Visibility must be declared on method "checkTrustPathPermissions" Open
function checkTrustPathPermissions() {
- Exclude checks
The var keyword must not be used to declare a property Open
var $xoopsRootPath = '';
- Exclude checks
The var keyword must not be used to declare a property Open
var $xoopsTrustPath = '';
- Exclude checks
Visibility must be declared on property "$xoopsUrl" Open
var $xoopsUrl = '';
- Exclude checks
Visibility must be declared on method "validate" Open
function validate() {
- Exclude checks
Expected 0 spaces between opening bracket and argument "$path"; 1 found Open
function makeWritable( $path, $group = false, $recurse = false) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (!defined( 'XOOPS_INSTALL' ) ) exit();
- Exclude checks
Visibility must be declared on method "checkRootPath" Open
function checkRootPath() {
- Exclude checks
Visibility must be declared on method "checkTrustPath" Open
function checkTrustPath() {
- Exclude checks
Visibility must be declared on method "checkPermissions" Open
function checkPermissions() {
- Exclude checks
Visibility must be declared on method "__construct" Open
function __construct() {
- Exclude checks
The var keyword must not be used to declare a property Open
var $xoopsUrl = '';
- Exclude checks
Visibility must be declared on method "createTrustPath" Open
function createTrustPath() {
- Exclude checks
Expected 0 spaces between opening bracket and argument "$valid"; 1 found Open
function genTrustPathCheckHtml( $valid) {
- Exclude checks
The var keyword must not be used to declare a property Open
var $permErrors = array();
- Exclude checks
The var keyword must not be used to declare a property Open
var $validUrl = false;
- Exclude checks
Visibility must be declared on method "readRequest" Open
function readRequest() {
- Exclude checks
The var keyword must not be used to declare a property Open
var $validRootPath = false;
- Exclude checks
Space found after opening bracket of FOREACH loop Open
foreach ( $paths as $path) {
- Exclude checks
Visibility must be declared on property "$validRootPath" Open
var $validRootPath = false;
- Exclude checks
Visibility must be declared on property "$xoopsRootPath" Open
var $xoopsRootPath = '';
- Exclude checks
Visibility must be declared on property "$xoopsTrustPath" Open
var $xoopsTrustPath = '';
- Exclude checks
Visibility must be declared on method "findServerGID" Open
function findServerGID() {
- Exclude checks
Expected 0 spaces between opening bracket and argument "$valid"; 1 found Open
function genRootCheckHtml( $valid) {
- Exclude checks
Visibility must be declared on method "makeWritable" Open
function makeWritable( $path, $group = false, $recurse = false) {
- Exclude checks
Space found after opening bracket of FOREACH loop Open
<?php foreach ( $ctrl->permErrors as $path => $result) {
- Exclude checks
Inline control structures are not allowed Open
if (!defined( 'XOOPS_INSTALL' ) ) exit();
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (!defined( 'XOOPS_INSTALL' ) ) exit();
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->xoopsTrustPath = $docroot . substr( md5( time() ), 0, 15);
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->xoopsUrl = substr( $path, 0, strrpos( $path, '/' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->xoopsUrl = substr( $path, 0, strrpos( $path, '/' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$request['ROOT_PATH'] = str_replace( "\\", "/", $request['ROOT_PATH'] );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
return ( $this->validRootPath && $this->validTrustPath && $this->validUrl && empty( $this->permErrors ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (@is_dir( $this->xoopsRootPath ) && @is_readable( $this->xoopsRootPath )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (@is_dir( $this->xoopsRootPath ) && @is_readable( $this->xoopsRootPath )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$web_root = dirname( $this->xoopsRootPath );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$web_root = dirname( $this->xoopsRootPath );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$GLOBALS['wizard']->redirectToPage( '+0' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (isset( $_SESSION['settings']['TRUST_PATH'] )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (file_exists( "$this->xoopsRootPath/mainfile.php" ) && defined( 'XOOPS_VERSION' )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->xoopsTrustPath = $docroot . substr( md5( time() ), 0, 15);
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->xoopsUrl = substr( $path, 0, strrpos( $path, '/' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$request['TRUST_PATH'] = str_replace( "\\", "/", $request['TRUST_PATH'] );
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
foreach ( $paths as $path) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$path = str_replace( "\\", "/", @realpath( '../' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$errors['trustpath'] = $this->makeWritable( "$this->xoopsTrustPath" );
- Exclude checks
No space found after comma in function call Open
$arr = explode('/',$web_root);
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$name = tempnam( '/non-existent/', 'XOOPS' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (substr( $request['URL'], -1 ) == '/') {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (substr( $request['URL'], -1 ) == '/') {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
echo genCreateTrustPathHtml( $ctrl->createTrustPath() );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$wizard->setPage( 'pathsettings' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (file_exists( "$path/mainfile.php" )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (isset( $request['URL'] )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (file_exists( "$this->xoopsRootPath/mainfile.php" ) && defined( 'XOOPS_VERSION' )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$request['TRUST_PATH'] = substr( $request['TRUST_PATH'], 0, -1 );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$request['URL'] = substr( $request['URL'], 0, -1 );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$request['ROOT_PATH'] = str_replace( "\\", "/", $request['ROOT_PATH'] );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$request['TRUST_PATH'] = str_replace( "\\", "/", $request['TRUST_PATH'] );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
return ( $this->validRootPath && $this->validTrustPath && $this->validUrl && empty( $this->permErrors ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
@chmod( $path, octdec( '0' . $perm . '00' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$wizard->setPage( 'pathsettings' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$path = str_replace( "\\", "/", @realpath( '../' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (file_exists( "$path/mainfile.php" )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$request['ROOT_PATH'] = substr( $request['ROOT_PATH'], 0, -1 );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (@is_dir( $this->xoopsRootPath ) && @is_readable( $this->xoopsRootPath )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (substr( $request['ROOT_PATH'], -1 ) == '/') {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (substr( $request['ROOT_PATH'], -1 ) == '/') {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$errors['trustpath'] = $this->makeWritable( "$this->xoopsTrustPath" );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (!file_exists( $path )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$perm = @is_dir( $path ) ? 6 : 7;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
@chgrp( $path, $group );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (@is_writable( $path )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$group = filegroup( $name );
- Exclude checks
No space found after comma in function call Open
$rootp = str_replace("\\","/",$rootp);
- Exclude checks
Space after opening parenthesis of function call prohibited Open
return '<img src="img/yes.png" alt="Success" class="rootimg" />' . sprintf( XOOPS_FOUND, XOOPS_VERSION);
- Exclude checks
Expected 1 space after closing brace; 2 found Open
} else {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
echo '<li class="failure">' . sprintf( IS_NOT_WRITABLE, $path ) . '</li>';
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (!defined( 'XOOPS_INSTALL' ) ) exit();
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$GLOBALS['wizard']->redirectToPage( '+1' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$path = str_replace( "\\", "/", @realpath( '../' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$GLOBALS['wizard']->redirectToPage( '+1' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$request['URL'] = substr( $request['URL'], 0, -1 );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
@chmod( $path, octdec( '0' . $perm . $perm . '0' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$GLOBALS['wizard']->redirectToPage( '+0' );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$group = filegroup( $name );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
unlink( $name );
- Exclude checks
No space found after comma in function call Open
$lastchar = substr($rootp,strlen($rootp)-1,1);
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (file_exists( "$this->xoopsRootPath/mainfile.php" ) && defined( 'XOOPS_VERSION' )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
echo '<li class="success">' . sprintf( IS_WRITABLE, $path ) . '</li>';
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (in_array( false, $errors )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
@chgrp( $path, $group );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
@chmod( $path, octdec( '0' . $perm . $perm . $perm ) );
- Exclude checks
No space found after comma in function call Open
$rootp = str_replace("\\","/",$rootp);
- Exclude checks
Space after opening parenthesis of function call prohibited Open
echo '<li class="success">' . sprintf( IS_WRITABLE, $path ) . '</li>';
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (isset( $_SESSION['settings']['URL'] )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$request['ROOT_PATH'] = substr( $request['ROOT_PATH'], 0, -1 );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (substr( $request['TRUST_PATH'], -1 ) == '/') {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
@chmod( $path, octdec( '0' . $perm . $perm . '0' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$errors[$path] = $this->makeWritable( "$this->xoopsRootPath/$path" );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$perm = @is_dir( $path ) ? 6 : 7;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
@chmod( $path, octdec( '0' . $perm . '00' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (!@is_writable( $path )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (@is_writable( $path )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
unlink( $name );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$this->xoopsTrustPath = $docroot . substr( md5( time() ), 0, 15);
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (substr( $request['TRUST_PATH'], -1 ) == '/') {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$request['TRUST_PATH'] = substr( $request['TRUST_PATH'], 0, -1 );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$errors[$path] = $this->makeWritable( "$this->xoopsRootPath/$path" );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$info = stat( $path );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$info = stat( $path );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$name = tempnam( '/non-existent/', 'XOOPS' );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (touch( $name )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (touch( $name )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (in_array( false, $errors )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
@chmod( $path, octdec( '0' . $perm . $perm . $perm ) );
- Exclude checks
Expected 1 space after closing brace; 2 found Open
} else {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
echo genRootCheckHtml( $ctrl->checkRootPath() );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
echo genTrustPathCheckHtml( $ctrl->checkTrustPath() );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
value="<?php echo $ctrl->xoopsRootPath; ?>" /> <span id="rootpathimg"><?php echo genRootCheckHtml( $ctrl->validRootPath ); ?></span>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
<?php if ($ctrl->validRootPath && !empty( $ctrl->permErrors )) { ?>
- Exclude checks
Closing brace must be on a line by itself Open
<?php } else { echo '<div id="rootperms">'.CHECKING_PERMISSIONS .'<br /><ul class="diags"><li class="success">'.ALL_PERM_OK.'</li></ul></div>';} ?>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$this->xoopsUrl = substr( $path, 0, strrpos( $path, '/' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (@is_dir( $this->xoopsRootPath ) && @is_readable( $this->xoopsRootPath )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (@is_dir( $this->xoopsTrustPath ) && @is_readable( $this->xoopsTrustPath )) {
- Exclude checks
No space found after comma in function call Open
$lastchar = substr($rootp,strlen($rootp)-1,1);
- Exclude checks
Space after opening parenthesis of function call prohibited Open
<?php if ($ctrl->validRootPath && !empty( $ctrl->permErrors )) { ?>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$path = str_replace( "\\", "/", @realpath( '../' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (isset( $_SESSION['settings']['TRUST_PATH'] )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (isset( $_SESSION['settings']['URL'] )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (isset( $request['URL'] )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (file_exists( "$this->xoopsRootPath/mainfile.php" ) && defined( 'XOOPS_VERSION' )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (in_array( false, $errors )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
echo '<li class="failure">' . sprintf( IS_NOT_WRITABLE, $path ) . '</li>';
- Exclude checks
Space after opening parenthesis of function call prohibited Open
value="<?php echo $ctrl->xoopsTrustPath; ?>" /> <span id="trustpathimg"><?php echo genTrustPathCheckHtml( $ctrl->validTrustPath ); ?></span>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
value="<?php echo $ctrl->xoopsTrustPath; ?>" /> <span id="trustpathimg"><?php echo genTrustPathCheckHtml( $ctrl->validTrustPath ); ?></span>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
echo genCreateTrustPathHtml( $ctrl->createTrustPath() );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
value="<?php echo $ctrl->xoopsRootPath; ?>" /> <span id="rootpathimg"><?php echo genRootCheckHtml( $ctrl->validRootPath ); ?></span>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (in_array( false, $errors )) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (!@is_writable( $path )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
@chmod( $path, octdec( '0' . $perm . '00' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (!@is_writable( $path ) && $group !== false) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
@chmod( $path, octdec( '0' . $perm . $perm . '0' ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
echo genRootCheckHtml( $ctrl->checkRootPath() );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if (!@is_writable( $path ) && $group !== false) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
<?php foreach ( $ctrl->permErrors as $path => $result) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
@chmod( $path, octdec( '0' . $perm . '00' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
@chmod( $path, octdec( '0' . $perm . $perm . '0' ) );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
@chmod( $path, octdec( '0' . $perm . $perm . $perm ) );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
echo genTrustPathCheckHtml( $ctrl->checkTrustPath() );
- Exclude checks
Newline required after opening brace Open
<?php } else { echo '<div id="rootperms">'.CHECKING_PERMISSIONS .'<br /><ul class="diags"><li class="success">'.ALL_PERM_OK.'</li></ul></div>';} ?>
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if (!file_exists( $path )) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
@chmod( $path, octdec( '0' . $perm . $perm . $perm ) );
- Exclude checks
The variable $web_root is not named in camelCase. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $current_path is not named in camelCase. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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 $web_root is not named in camelCase. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $current_script is not named in camelCase. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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 $web_root is not named in camelCase. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $web_root is not named in camelCase. Open
function __construct() {
if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
$this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
} else {
$path = str_replace( "\\", "/", @realpath( '../' ) );
- 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 $adjusted_path is not named in camelCase. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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 $adjusted_path is not named in camelCase. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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 $current_script is not named in camelCase. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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 $current_path is not named in camelCase. Open
function resolveDocumentRoot() {
$current_script = dirname($_SERVER['SCRIPT_NAME']);
$current_path = dirname($_SERVER['SCRIPT_FILENAME']);
/* work out how many folders we are away from document_root
- 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();
}
}