getFormFeedback accesses the super-global variable $GLOBALS. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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
getFormFeedback accesses the super-global variable $_SERVER. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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
Method getFormFeedback
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
The method getFormFeedback has a boolean flag argument $action, which is a certain sign of a Single Responsibility Principle violation. Open
public function getFormFeedback($action = false): XoopsThemeForm
- 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
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 37 and the first side effect is on line 32. Open
<?php declare(strict_types=1);
- Exclude checks
Line exceeds 120 characters; contains 173 characters Open
$recipient = new XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT'), 'recipient', 50, 255, $GLOBALS['xoopsModule']->getInfo('author_mail'));
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$your_site = new XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE'), 'your_site', 50, 255, $this->site);
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$your_mail->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER') . '"');
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
$editor = new XoopsFormEditor(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT'), 'fb_content', $editorConfigs);
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$your_mail = new XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL'), 'your_mail', 50, 255, $this->email);
- Exclude checks
Line exceeds 120 characters; contains 163 characters Open
$fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS'));
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$fbtypeSelect = new XoopsFormSelect(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE'), 'fb_type', $this->type);
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION'));
- Exclude checks
Line exceeds 120 characters; contains 159 characters Open
$fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS'));
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
$fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES'));
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$your_name->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER') . '"');
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$your_name = new XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME'), 'your_name', 50, 255, $this->name);
- Exclude checks
Line exceeds 120 characters; contains 173 characters Open
$fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL'));
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
$form = new XoopsThemeForm(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE'), 'formfeedback', 'feedback.php', 'post', true);
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$your_site->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER') . '"');
- Exclude checks
The variable $your_site is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_site is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_site is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_mail is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_name is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_name is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_mail is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_mail is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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 $your_name is not named in camelCase. Open
public function getFormFeedback($action = false): XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
- 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();
}
}