Showing 54 of 54 total issues
Missing class import via use statement (line '30', column '23'). Open
throw new \InvalidArgumentException(
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '165', column '23'). Open
throw new \Exception('The writable-dirs must be specified in composer arbitrary extra data.');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '288', column '27'). Open
throw new \Exception('Path Not Found: '.$path);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid too many return
statements within this method. Open
return 'default';
Function get_module_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function get_module_settings($module = 'default', $setting = false)
{
if (!isset($GLOBALS['modules'][$module])) {
$keys = array_keys($GLOBALS['modules']);
$module = $keys[0];
- 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
Avoid unused local variables such as '$childResponse'. Open
$out[$idx] = $childResponse = $child->$childCall();
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$protocol'. Open
$protocol = parse_url($event->getProcessedUrl(), PHP_URL_SCHEME);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$idx'. Open
foreach ($tkeys as $idx => $key) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The variable $http_user is not named in camelCase. Open
public static function SetfaclPermissionsSetter(Event $event, $http_user, $path)
{
self::EnsureDirExists($event, $path);
self::runProcess($event, 'setfacl -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
self::runProcess($event, 'setfacl -d -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
- 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 $http_user is not named in camelCase. Open
public static function setPermissionsSetfacl(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::SetfaclPermissionsSetter($event, $http_user, $path);
- 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 $http_user is not named in camelCase. Open
public static function setPermissionsChmod(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
- 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 $http_user is not named in camelCase. Open
public static function setPermissionsSetfacl(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::SetfaclPermissionsSetter($event, $http_user, $path);
- 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 $http_user is not named in camelCase. Open
public static function setPermissionsChmod(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
- 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 $http_user is not named in camelCase. Open
public static function ChmodPermissionsSetter(Event $event, $http_user, $path, $type = 'dir')
{
if ($type == 'dir') {
self::EnsureDirExists($event, $path);
// self::runProcess($event, 'chmod +a "'.$http_user.' allow delete,write,append,file_inherit,directory_inherit" '.$path);
- 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 $http_user is not named in camelCase. Open
public static function SetfaclPermissionsSetter(Event $event, $http_user, $path)
{
self::EnsureDirExists($event, $path);
self::runProcess($event, 'setfacl -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
self::runProcess($event, 'setfacl -d -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
- 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 $http_user is not named in camelCase. Open
public static function setPermissionsSetfacl(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::SetfaclPermissionsSetter($event, $http_user, $path);
- 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 $http_user is not named in camelCase. Open
public static function setPermissionsChmod(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
- 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 method add_route_requirement is not named in camelCase. Open
public function add_route_requirement($type, $function, $source = '', $path = false, $methods = false)
{
if ($path === false) {
$path = '/'.$function;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_setting is not named in camelCase. Open
public function get_setting($setting)
{
return constant($setting);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_routes is not named in camelCase. Open
public function get_routes()
{
$routes = $this->routes;
uksort($routes, function ($a, $b) {
if (strlen($a) == strlen($b)) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}