Showing 664 of 664 total issues
editCardealerServpart accesses the super-global variable $GLOBALS. Open
function editCardealerServpart($options)
{
$form = MB_CARDEALER_DISPLAY;
$form .= "<input type='hidden' name='options[0]' value='" . $options[0] . "' />";
- 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
render accesses the super-global variable $GLOBALS. Open
public function render()
{
if (!isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme'])) {
require $GLOBALS['xoops']->path('class/theme.php');
$GLOBALS['xoTheme'] = new \xos_opal_Theme();
- 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
editCardealerCustomer accesses the super-global variable $GLOBALS. Open
function editCardealerCustomer($options)
{
$form = MB_CARDEALER_DISPLAY;
$form .= "<input type='hidden' name='options[0]' value='" . $options[0] . "' />";
- 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
cloneRecord accesses the super-global variable $GLOBALS. Open
public static function cloneRecord($tableName, $id_field, $id)
{
$new_id = false;
$table = $GLOBALS['xoopsDB']->prefix($tableName);
// copy content of the record you wish to clone
- 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
cloneRecord accesses the super-global variable $GLOBALS. Open
public static function cloneRecord($tableName, $id_field, $id)
{
$new_id = false;
$table = $GLOBALS['xoopsDB']->prefix($tableName);
// copy content of the record you wish to clone
- 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
enumerate accesses the super-global variable $GLOBALS. Open
public static function enumerate($tableName, $columnName)
{
$table = $GLOBALS['xoopsDB']->prefix($tableName);
$sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
$result = $GLOBALS['xoopsDB']->query($sql);
- 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
cloneRecord accesses the super-global variable $GLOBALS. Open
public static function cloneRecord($tableName, $id_field, $id)
{
$new_id = false;
$table = $GLOBALS['xoopsDB']->prefix($tableName);
// copy content of the record you wish to clone
- 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
enumerate accesses the super-global variable $GLOBALS. Open
public static function enumerate($tableName, $columnName)
{
$table = $GLOBALS['xoopsDB']->prefix($tableName);
$sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
$result = $GLOBALS['xoopsDB']->query($sql);
- 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
cloneRecord accesses the super-global variable $GLOBALS. Open
public static function cloneRecord($tableName, $id_field, $id)
{
$new_id = false;
$table = $GLOBALS['xoopsDB']->prefix($tableName);
// copy content of the record you wish to clone
- 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
enumerate accesses the super-global variable $GLOBALS. Open
public static function enumerate($tableName, $columnName)
{
$table = $GLOBALS['xoopsDB']->prefix($tableName);
$sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
$result = $GLOBALS['xoopsDB']->query($sql);
- 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
cloneRecord accesses the super-global variable $GLOBALS. Open
public static function cloneRecord($tableName, $id_field, $id)
{
$new_id = false;
$table = $GLOBALS['xoopsDB']->prefix($tableName);
// copy content of the record you wish to clone
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The method truncateHtml() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
- 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
enumerate accesses the super-global variable $GLOBALS. Open
public static function enumerate($tableName, $columnName)
{
$table = $GLOBALS['xoopsDB']->prefix($tableName);
$sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
$result = $GLOBALS['xoopsDB']->query($sql);
- 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
cloneRecord accesses the super-global variable $GLOBALS. Open
public static function cloneRecord($tableName, $id_field, $id)
{
$new_id = false;
$table = $GLOBALS['xoopsDB']->prefix($tableName);
// copy content of the record you wish to clone
- 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
Line exceeds 120 characters; contains 223 characters Open
$select_view .= ' <a href="' . Request::getString('PHP_SELF', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=asc" /><img src="' . $pathModIcon16 . '/' . $sel1 . '" title="ASC" alt="ASC"></a>';
- Exclude checks
Line exceeds 120 characters; contains 224 characters Open
$select_view .= '<a href="' . Request::getString('PHP_SELF', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=desc" /><img src="' . $pathModIcon16 . '/' . $sel2 . '" title="DESC" alt="DESC"></a>';
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$workorder_id_select = new \XoopsFormSelect(AM_CARDEALER_WORKSERV_ORDERNUM, 'ordernum', $this->targetObject->getVar('ordernum'));
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$service_id_select = new \XoopsFormSelect(AM_CARDEALER_WORKSERV_ITEMNUM, 'itemnum', $this->targetObject->getVar('itemnum'));
- Exclude checks
Line exceeds 120 characters; contains 200 characters Open
$select_view = '<form name="form_switch" id="form_switch" action="' . Request::getString('REQUEST_URI', '', 'SERVER') . '" method="post"><span style="font-weight: bold;">' . $text . '</span>';
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
$title = $this->targetObject->isNew() ? sprintf(AM_CARDEALER_WORKSERV_ADD) : sprintf(AM_CARDEALER_WORKSERV_EDIT);
- Exclude checks