Avoid unused local variables such as '$helper'. Open
$helper = Helper::getInstance();
- 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 '$maps_name'. Open
$maps_name = $xoopsConfig['language'];
- 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 parameters such as '$options'. Open
function adslight_maps_show($options)
- 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 unused local variables such as '$myts'. Open
$myts = \MyTextSanitizer::getInstance();
- 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 using static access to class '\XoopsModules\Adslight\Helper' in method 'adslight_maps_show'. Open
$helper = Helper::getInstance();
- 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
Avoid using static access to class '\MyTextSanitizer' in method 'adslight_maps_show'. Open
$myts = \MyTextSanitizer::getInstance();
- 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
Line exceeds 120 characters; contains 167 characters Open
$form .= ' ' . constant("{$block_lang}_DISP") . " <input type='text' name='options[]' value='{$options[1]}'> " . constant("{$block_lang}_LISTINGS");
- Exclude checks
Line exceeds 120 characters; contains 279 characters Open
$block['imgmapsurl'] = '<a title="Recherche dans votre region" href="' . XOOPS_URL . '/modules/adslight/maps.php"><img src="' . XOOPS_URL . '/modules/adslight/maps/' . $xoopsConfig['language'] . '/assets/images/map.png" alt="Recherche dans votre region" border="0"></a><br>';
- Exclude checks
Line exceeds 120 characters; contains 187 characters Open
$form .= ' <br><br>' . constant("{$block_lang}_CHARS") . " <input type='text' name='options[]' value='{$options[2]}'> " . constant("{$block_lang}_LENGTH") . '<br><br>';
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$block['add'] = '<a href="' . XOOPS_URL . "/modules/{$moduleDirName}/\"><b>" . constant("{$block_lang}_ADDNOW") . '</b></a><br>';
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
$block['link'] = '<a href="' . XOOPS_URL . "/modules/{$moduleDirName}/\"><b>" . constant("{$block_lang}_ALL_LISTINGS") . '</b></a><br>';
- Exclude checks
The variable $maps_name is not named in camelCase. Open
function adslight_maps_show($options)
{
if (!class_exists(Helper::class)) {
return [];
}
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_show($options)
{
if (!class_exists(Helper::class)) {
return [];
}
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_show($options)
{
if (!class_exists(Helper::class)) {
return [];
}
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_show($options)
{
if (!class_exists(Helper::class)) {
return [];
}
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_show($options)
{
if (!class_exists(Helper::class)) {
return [];
}
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_show($options)
{
if (!class_exists(Helper::class)) {
return [];
}
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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 $block_lang is not named in camelCase. Open
function adslight_maps_edit($options): string
{
$moduleDirName = \basename(\dirname(__DIR__));
$block_lang = '_MB_' . mb_strtoupper($moduleDirName);
- 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();
}
}