shareCalendar.php
getCategories accesses the super-global variable $GLOBALS. Open
Open
function getCategories()
{
global $xoopsDB;
$cats = array(0 => _APCAL_SHOWALLCAT);
- 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
getCategories accesses the super-global variable $GLOBALS. Open
Open
function getCategories()
{
global $xoopsDB;
$cats = array(0 => _APCAL_SHOWALLCAT);
- 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
getCategories accesses the super-global variable $GLOBALS. Open
Open
function getCategories()
{
global $xoopsDB;
$cats = array(0 => _APCAL_SHOWALLCAT);
- 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
Avoid unused local variables such as '$xoopsDB'. Open
Open
global $xoopsDB;
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 81 and the first side effect is on line 22. Open
Open
<?php
- Exclude checks
Line exceeds 120 characters; contains 142 characters Open
Open
$result = $GLOBALS['xoopsDB']->queryF("SELECT cid, cat_title, cat_depth FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} ORDER BY weight");
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
$formCustom->addElement(new XoopsFormText(_APCAL_LINK, 'APlink', 60, 255, 'color: #0000FF; text-decoration: none;'), false);
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
Open
$formCustom->addElement(new XoopsFormText(_APCAL_TITLE, 'APtitle', 60, 255, 'color: #000000; font-size: 1.3em;'), false);
- Exclude checks
The variable $depth_desc is not named in camelCase. Open
Open
function getCategories()
{
global $xoopsDB;
$cats = array(0 => _APCAL_SHOWALLCAT);
- 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 $depth_desc is not named in camelCase. Open
Open
function getCategories()
{
global $xoopsDB;
$cats = array(0 => _APCAL_SHOWALLCAT);
- 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();
}
}