Method buildFormats
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildFormats() {
$this->adFormats['728x90_as'] = array(
'caption' => '728 X 90 Leaderboard',
'width' => 728,
'height' => 90,
The method render uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$ret = '<div>';
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'icms_core_DataFilter' in method 'generateTag'. Open
$title = icms_core_DataFilter::icms_substr($title, 0, 10, '');
- 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 unused local variables such as '$title'. Open
$obj->setVar('tag', $title = $obj->generateTag());
- 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
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('color_link', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_LINK, _CO_ICMS_ADSENSE_COLOR_LINK_DSC);
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('color_text', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_TEXT, _CO_ICMS_ADSENSE_COLOR_TEXT_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::setControl
Open
$this->setControl('color_border', 'color');
- Exclude checks
Call to undeclared method \SystemAdsense::setControl
Open
$this->setControl('color_link', 'color');
- Exclude checks
Returning type void
but color_text()
is declared to return string
Open
if ($value == "") return;
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTAREA
Open
$this->quickInitVar('description', XOBJ_DTYPE_TXTAREA, TRUE, _CO_ICMS_ADSENSE_DESCRIPTION, _CO_ICMS_ADSENSE_DESCRIPTION_DSC);
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('format', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_FORMAT, _CO_ICMS_ADSENSE_FORMAT_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('color_background', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_BACKGROUND, _CO_ICMS_ADSENSE_COLOR_BORDER_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('color_text', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_TEXT, _CO_ICMS_ADSENSE_COLOR_TEXT_DSC);
- Exclude checks
Assigning array|array{}
to property but \SystemAdsenseHandler->_objects
is false
Open
$this->_objects = $ret;
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('tag', XOBJ_DTYPE_TXTBOX, FALSE, _CO_ICMS_ADSENSE_TAG, _CO_ICMS_ADSENSE_TAG_DSC);
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTAREA
Open
$this->quickInitVar('style', XOBJ_DTYPE_TXTAREA, FALSE, _CO_ICMS_ADSENSE_STYLE, _CO_ICMS_ADSENSE_STYLE_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::setControl
Open
$this->setControl('format', array('method' => 'getFormats'));
- Exclude checks
Call to undeclared method \SystemAdsense::setControl
Open
$this->setControl('color_url', 'color');
- Exclude checks
Reference to undeclared class \icms_ipf_Handler
Open
parent::__construct($db, 'adsense', 'adsenseid', 'tag', 'description', 'system');
- Exclude checks
Reference to undeclared property \SystemAdsense->handler
Open
. 'google_ad_width = ' . $this->handler->adFormats[$this->getVar('format', 'n')]['width'] . ';'
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('adsenseid', XOBJ_DTYPE_INT, TRUE);
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('color_border', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_BORDER, _CO_ICMS_ADSENSE_COLOR_BORDER_DSC);
- Exclude checks
Returning type void
but color_url()
is declared to return string
Open
if ($value == "") return;
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('client_id', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_CLIENT_ID, _CO_ICMS_ADSENSE_CLIENT_ID_DSC);
- Exclude checks
Reference to undeclared class \icms_ipf_Object
Open
parent::__construct($handler);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('client_id', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_CLIENT_ID, _CO_ICMS_ADSENSE_CLIENT_ID_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('color_link', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_LINK, _CO_ICMS_ADSENSE_COLOR_LINK_DSC);
- Exclude checks
Returning type void
but color_background()
is declared to return string
Open
if ($value == "") return;
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('slot', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_SLOT, _CO_ICMS_ADSENSE_SLOT_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('tag', XOBJ_DTYPE_TXTBOX, FALSE, _CO_ICMS_ADSENSE_TAG, _CO_ICMS_ADSENSE_TAG_DSC);
- Exclude checks
Returning type void
but color_border()
is declared to return string
Open
if ($value == "") return;
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('description', XOBJ_DTYPE_TXTAREA, TRUE, _CO_ICMS_ADSENSE_DESCRIPTION, _CO_ICMS_ADSENSE_DESCRIPTION_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('slot', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_SLOT, _CO_ICMS_ADSENSE_SLOT_DSC);
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('color_background', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_BACKGROUND, _CO_ICMS_ADSENSE_COLOR_BORDER_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::setControl
Open
$this->setControl('color_text', 'color');
- Exclude checks
Call to method icms_substr
from undeclared class \icms_core_DataFilter
Open
$title = icms_core_DataFilter::icms_substr($title, 0, 10, '');
- Exclude checks
Returning type false
but getAdsensesByTag()
is declared to return array
Open
return $this->_objects;
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('format', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_FORMAT, _CO_ICMS_ADSENSE_FORMAT_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('style', XOBJ_DTYPE_TXTAREA, FALSE, _CO_ICMS_ADSENSE_STYLE, _CO_ICMS_ADSENSE_STYLE_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::id
Open
. $this->id() . '"><img src="' . ICMS_IMAGES_SET_URL . '/actions/editcopy.png" style="vertical-align: middle;" alt="'
- Exclude checks
Class extends undeclared class \icms_ipf_Object
Open
class SystemAdsense extends icms_ipf_Object {
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_INT
Open
$this->quickInitVar('adsenseid', XOBJ_DTYPE_INT, TRUE);
- Exclude checks
Call to undeclared method \SystemAdsenseHandler::getObjects
Open
$adsensesObj = $this->getObjects(NULL, TRUE);
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('color_border', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_BORDER, _CO_ICMS_ADSENSE_COLOR_BORDER_DSC);
- Exclude checks
Reference to undeclared constant \XOBJ_DTYPE_TXTBOX
Open
$this->quickInitVar('color_url', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_URL, _CO_ICMS_ADSENSE_COLOR_URL_DSC);
- Exclude checks
Reference to undeclared class \icms_ipf_Object
Open
return parent::getVar($key, $format);
- Exclude checks
Reference to undeclared property \SystemAdsense->handler
Open
. 'google_ad_height = ' . $this->handler->adFormats[$this->getVar('format', 'n')]['height'] . ';'
- Exclude checks
Class extends undeclared class \icms_ipf_Handler
Open
class SystemAdsenseHandler extends icms_ipf_Handler {
- Exclude checks
Call to undeclared method \SystemAdsense::quickInitVar
Open
$this->quickInitVar('color_url', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_URL, _CO_ICMS_ADSENSE_COLOR_URL_DSC);
- Exclude checks
Call to undeclared method \SystemAdsense::setControl
Open
$this->setControl('color_background', 'color');
- Exclude checks
Returning type void
but color_link()
is declared to return string
Open
if ($value == "") return;
- Exclude checks
Similar blocks of code found in 5 locations. Consider refactoring. Open
$pattern = array ("/%09/", "/%20/", "/%21/", "/%22/", "/%23/", "/%25/", "/%26/", "/%27/", "/%28/", "/%29/", "/%2C/", "/%2F/", "/%3A/", "/%3B/", "/%3C/", "/%3D/", "/%3E/", "/%3F/", "/%40/", "/%5B/", "/%5C/", "/%5D/", "/%5E/", "/%7B/", "/%7C/", "/%7D/", "/%7E/", "/\./" );
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 5 locations. Consider refactoring. Open
$rep_pat = array ("-", "-", "-", "-", "-", "-100", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-at-", "-", "-", "-", "-", "-", "-", "-", "-", "-" );
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class SystemAdsense extends icms_ipf_Object {
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class SystemAdsenseHandler extends icms_ipf_Handler {
- Exclude checks
The property $_adFormatsList is not named in camelCase. Open
class SystemAdsenseHandler extends icms_ipf_Handler {
public $adFormats = array();
private $_adFormatsList = array();
private $_objects = FALSE;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Avoid variables with short names like $db. Configured minimum length is 3. Open
public function __construct(&$db) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The property $_objects is not named in camelCase. Open
class SystemAdsenseHandler extends icms_ipf_Handler {
public $adFormats = array();
private $_adFormatsList = array();
private $_objects = FALSE;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Each class must be in a file by itself Open
class SystemAdsenseHandler extends icms_ipf_Handler {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
private $_objects = FALSE;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('color_link', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_LINK, _CO_ICMS_ADSENSE_COLOR_LINK_DSC);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('color_text', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_TEXT, _CO_ICMS_ADSENSE_COLOR_TEXT_DSC);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
return TRUE;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
public $content = FALSE;
- Exclude checks
Method name "SystemAdsense::color_url" is not in camel caps format Open
public function color_url() {
- Exclude checks
Method name "SystemAdsense::color_text" is not in camel caps format Open
public function color_text() {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('slot', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_SLOT, _CO_ICMS_ADSENSE_SLOT_DSC);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('color_border', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_BORDER, _CO_ICMS_ADSENSE_COLOR_BORDER_DSC);
- Exclude checks
Method name "SystemAdsense::color_background" is not in camel caps format Open
public function color_background() {
- Exclude checks
Method name "SystemAdsense::color_link" is not in camel caps format Open
public function color_link() {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('adsenseid', XOBJ_DTYPE_INT, TRUE);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('format', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_FORMAT, _CO_ICMS_ADSENSE_FORMAT_DSC);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
$this->quickInitVar('style', XOBJ_DTYPE_TXTAREA, FALSE, _CO_ICMS_ADSENSE_STYLE, _CO_ICMS_ADSENSE_STYLE_DSC);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('color_background', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_BACKGROUND, _CO_ICMS_ADSENSE_COLOR_BORDER_DSC);
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('description', XOBJ_DTYPE_TXTAREA, TRUE, _CO_ICMS_ADSENSE_DESCRIPTION, _CO_ICMS_ADSENSE_DESCRIPTION_DSC);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('color_url', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_COLOR_URL, _CO_ICMS_ADSENSE_COLOR_URL_DSC);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
$this->quickInitVar('tag', XOBJ_DTYPE_TXTBOX, FALSE, _CO_ICMS_ADSENSE_TAG, _CO_ICMS_ADSENSE_TAG_DSC);
- Exclude checks
Method name "SystemAdsense::color_border" is not in camel caps format Open
public function color_border() {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
$adsensesObj = $this->getObjects(NULL, TRUE);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$adsensesObj = $this->getObjects(NULL, TRUE);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$this->quickInitVar('client_id', XOBJ_DTYPE_TXTBOX, TRUE, _CO_ICMS_ADSENSE_CLIENT_ID, _CO_ICMS_ADSENSE_CLIENT_ID_DSC);
- Exclude checks
Inline control structures are not allowed Open
if ($value == "") return;
- Exclude checks
Inline control structures are not allowed Open
if ($value == "") return;
- Exclude checks
Inline control structures are not allowed Open
if ($value == "") return;
- Exclude checks
Inline control structures are not allowed Open
if ($value == "") return;
- Exclude checks
Inline control structures are not allowed Open
if ($value == "") return;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
. 'google_color_bg = ' . json_encode($this->getVar('color_background', 'n') ). ';'
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
. 'google_color_border = ' . json_encode($this->getVar('color_border', 'n') ). ';'
- Exclude checks
The variable $rep_pat is not named in camelCase. Open
public function generateTag() {
$title = rawurlencode(strtolower($this->getVar('description', 'e')));
$title = icms_core_DataFilter::icms_substr($title, 0, 10, '');
$pattern = array ("/%09/", "/%20/", "/%21/", "/%22/", "/%23/", "/%25/", "/%26/", "/%27/", "/%28/", "/%29/", "/%2C/", "/%2F/", "/%3A/", "/%3B/", "/%3C/", "/%3D/", "/%3E/", "/%3F/", "/%40/", "/%5B/", "/%5C/", "/%5D/", "/%5E/", "/%7B/", "/%7C/", "/%7D/", "/%7E/", "/\./" );
- 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 $rep_pat is not named in camelCase. Open
public function generateTag() {
$title = rawurlencode(strtolower($this->getVar('description', 'e')));
$title = icms_core_DataFilter::icms_substr($title, 0, 10, '');
$pattern = array ("/%09/", "/%20/", "/%21/", "/%22/", "/%23/", "/%25/", "/%26/", "/%27/", "/%28/", "/%29/", "/%2C/", "/%2F/", "/%3A/", "/%3B/", "/%3C/", "/%3D/", "/%3E/", "/%3F/", "/%40/", "/%5B/", "/%5C/", "/%5D/", "/%5E/", "/%7B/", "/%7C/", "/%7D/", "/%7E/", "/\./" );
- 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 $rep_pat is not named in camelCase. Open
public function generateTag() {
$title = rawurlencode(strtolower($this->getVar('description', 'e')));
$title = icms_core_DataFilter::icms_substr($title, 0, 10, '');
$pattern = array ("/%09/", "/%20/", "/%21/", "/%22/", "/%23/", "/%25/", "/%26/", "/%27/", "/%28/", "/%29/", "/%2C/", "/%2F/", "/%3A/", "/%3B/", "/%3C/", "/%3D/", "/%3E/", "/%3F/", "/%40/", "/%5B/", "/%5C/", "/%5D/", "/%5E/", "/%7B/", "/%7C/", "/%7D/", "/%7E/", "/\./" );
- 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 $rep_pat is not named in camelCase. Open
public function generateTag() {
$title = rawurlencode(strtolower($this->getVar('description', 'e')));
$title = icms_core_DataFilter::icms_substr($title, 0, 10, '');
$pattern = array ("/%09/", "/%20/", "/%21/", "/%22/", "/%23/", "/%25/", "/%26/", "/%27/", "/%28/", "/%29/", "/%2C/", "/%2F/", "/%3A/", "/%3B/", "/%3C/", "/%3D/", "/%3E/", "/%3F/", "/%40/", "/%5B/", "/%5C/", "/%5D/", "/%5E/", "/%7B/", "/%7C/", "/%7D/", "/%7E/", "/\./" );
- 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 color_text is not named in camelCase. Open
public function color_text() {
$value = $this->getVar("color_text", "n");
if ($value == "") return;
return "#" . $value;
}
- 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 color_background is not named in camelCase. Open
public function color_background() {
$value = $this->getVar("color_background", "n");
if ($value == "") return;
return "#" . $value;
}
- 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 color_link is not named in camelCase. Open
public function color_link() {
$value = $this->getVar("color_link", "n");
if ($value == "") return;
return "#" . $value;
}
- 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 color_url is not named in camelCase. Open
public function color_url() {
$value = $this->getVar("color_url", "n");
if ($value == "") return;
return "#" . $value;
}
- 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 color_border is not named in camelCase. Open
public function color_border() {
$value = $this->getVar("color_border", "n");
if ($value == "") return;
return "#" . $value;
}
- 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() {
}
}