include/Text_Diff_Renderer_unified.php
Avoid excessively long variable names like $_leading_context_lines. Keep variable name length under 20. Open
Open
public $_leading_context_lines = 4;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $_trailing_context_lines. Keep variable name length under 20. Open
Open
public $_trailing_context_lines = 4;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Text_Diff_Renderer_unified extends Text_Diff_Renderer
- Exclude checks
The property $_leading_context_lines is not named in camelCase. Open
Open
class Text_Diff_Renderer_unified extends Text_Diff_Renderer
{
/**
* Number of leading context "lines" to preserve.
*/
- 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
The property $_trailing_context_lines is not named in camelCase. Open
Open
class Text_Diff_Renderer_unified extends Text_Diff_Renderer
{
/**
* Number of leading context "lines" to preserve.
*/
- 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
The class Text_Diff_Renderer_unified is not named in CamelCase. Open
Open
class Text_Diff_Renderer_unified extends Text_Diff_Renderer
{
/**
* Number of leading context "lines" to preserve.
*/
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Property name "$_trailing_context_lines" should not be prefixed with an underscore to indicate visibility Open
Open
public $_trailing_context_lines = 4;
- Exclude checks
Method name "_changed" should not be prefixed with an underscore to indicate visibility Open
Open
public function _changed($orig, $final)
- Exclude checks
Method name "_blockHeader" should not be prefixed with an underscore to indicate visibility Open
Open
public function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
- Exclude checks
Property name "$_leading_context_lines" should not be prefixed with an underscore to indicate visibility Open
Open
public $_leading_context_lines = 4;
- Exclude checks
Method name "_deleted" should not be prefixed with an underscore to indicate visibility Open
Open
public function _deleted($lines)
- Exclude checks
Method name "_added" should not be prefixed with an underscore to indicate visibility Open
Open
public function _added($lines)
- Exclude checks
Class name "Text_Diff_Renderer_unified" is not in camel caps format Open
Open
class Text_Diff_Renderer_unified extends Text_Diff_Renderer
- Exclude checks
The method _added is not named in camelCase. Open
Open
public function _added($lines)
{
return $this->_lines($lines, '+');
}
- 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 _changed is not named in camelCase. Open
Open
public function _changed($orig, $final)
{
return $this->_deleted($orig) . $this->_added($final);
}
- 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 _deleted is not named in camelCase. Open
Open
public function _deleted($lines)
{
return $this->_lines($lines, '-');
}
- 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 _blockHeader is not named in camelCase. Open
Open
public function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
{
if ($xlen != 1) {
$xbeg .= ',' . $xlen;
}
- 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() {
}
}