XoopsModules25x/apcal

View on GitHub
include/Text_Diff_Renderer_unified.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid excessively long variable names like $_leading_context_lines. Keep variable name length under 20.
Open

    public $_leading_context_lines = 4;

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

    public $_trailing_context_lines = 4;

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

class Text_Diff_Renderer_unified extends Text_Diff_Renderer

The property $_leading_context_lines is not named in camelCase.
Open

class Text_Diff_Renderer_unified extends Text_Diff_Renderer
{
    /**
     * Number of leading context "lines" to preserve.
     */

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

class Text_Diff_Renderer_unified extends Text_Diff_Renderer
{
    /**
     * Number of leading context "lines" to preserve.
     */

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

class Text_Diff_Renderer_unified extends Text_Diff_Renderer
{
    /**
     * Number of leading context "lines" to preserve.
     */

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

    public $_trailing_context_lines = 4;

Method name "_changed" should not be prefixed with an underscore to indicate visibility
Open

    public function _changed($orig, $final)

Method name "_blockHeader" should not be prefixed with an underscore to indicate visibility
Open

    public function _blockHeader($xbeg, $xlen, $ybeg, $ylen)

Property name "$_leading_context_lines" should not be prefixed with an underscore to indicate visibility
Open

    public $_leading_context_lines = 4;

Method name "_deleted" should not be prefixed with an underscore to indicate visibility
Open

    public function _deleted($lines)

Method name "_added" should not be prefixed with an underscore to indicate visibility
Open

    public function _added($lines)

Class name "Text_Diff_Renderer_unified" is not in camel caps format
Open

class Text_Diff_Renderer_unified extends Text_Diff_Renderer

The method _added is not named in camelCase.
Open

    public function _added($lines)
    {
        return $this->_lines($lines, '+');
    }

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

    public function _changed($orig, $final)
    {
        return $this->_deleted($orig) . $this->_added($final);
    }

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

    public function _deleted($lines)
    {
        return $this->_lines($lines, '-');
    }

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

    public function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
    {
        if ($xlen != 1) {
            $xbeg .= ',' . $xlen;
        }

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

There are no issues that match your filters.

Category
Status