Sibyx/phpGPX

View on GitHub
src/phpGPX/phpGPX.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\phpGPX\Parsers\WaypointParser' in method 'parse'.
Open

        $gpx->waypoints = isset($xml->wpt) ? WaypointParser::parse($xml->wpt) : [];
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 using static access to class '\phpGPX\Parsers\MetadataParser' in method 'parse'.
Open

        $gpx->metadata = isset($xml->metadata) ? MetadataParser::parse($xml->metadata) : null;
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 using static access to class '\phpGPX\Parsers\RouteParser' in method 'parse'.
Open

        $gpx->routes = isset($xml->rte) ? RouteParser::parse($xml->rte) : [];
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 using static access to class '\phpGPX\Parsers\TrackParser' in method 'parse'.
Open

        $gpx->tracks = isset($xml->trk) ? TrackParser::parse($xml->trk) : [];
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 excessively long variable names like $APPLY_DISTANCE_SMOOTHING. Keep variable name length under 20.
Open

    public static $APPLY_DISTANCE_SMOOTHING = false;
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $DISTANCE_SMOOTHING_THRESHOLD. Keep variable name length under 20.
Open

    public static $DISTANCE_SMOOTHING_THRESHOLD = 2;
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $DATETIME_TIMEZONE_OUTPUT. Keep variable name length under 20.
Open

    public static $DATETIME_TIMEZONE_OUTPUT = 'UTC';
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $APPLY_ELEVATION_SMOOTHING. Keep variable name length under 20.
Open

    public static $APPLY_ELEVATION_SMOOTHING = false;
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $ELEVATION_SMOOTHING_THRESHOLD. Keep variable name length under 20.
Open

    public static $ELEVATION_SMOOTHING_THRESHOLD = 2;
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $ELEVATION_SMOOTHING_SPIKES_THRESHOLD. Keep variable name length under 20.
Open

    public static $ELEVATION_SMOOTHING_SPIKES_THRESHOLD = null;
Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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

The property $ELEVATION_SMOOTHING_THRESHOLD is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $SORT_BY_TIMESTAMP is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $ELEVATION_SMOOTHING_SPIKES_THRESHOLD is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $APPLY_DISTANCE_SMOOTHING is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $DATETIME_FORMAT is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $PRETTY_PRINT is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $APPLY_ELEVATION_SMOOTHING is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $CALCULATE_STATS is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $DISTANCE_SMOOTHING_THRESHOLD is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 phpGPX is not named in CamelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $DATETIME_TIMEZONE_OUTPUT is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

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 $IGNORE_ELEVATION_0 is not named in camelCase.
Open

class phpGPX
{
    const JSON_FORMAT = 'json';
    const XML_FORMAT = 'xml';

Severity: Minor
Found in src/phpGPX/phpGPX.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

There are no issues that match your filters.

Category
Status