Sibyx/phpGPX

View on GitHub
src/phpGPX/Models/Point.php

Summary

Maintainability
A
0 mins
Test Coverage

The class Point has 24 fields. Consider redesigning Point to keep the number of fields under 15.
Open

class Point implements Summarizable
{
    const WAYPOINT = 'waypoint';
    const TRACKPOINT = 'track';
    const ROUTEPOINT = 'route';
Severity: Minor
Found in src/phpGPX/Models/Point.php by phpmd

TooManyFields

Since: 0.1

Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

Example

class Person {
   protected $one;
   private $two;
   private $three;
   [... many more fields ...]
}

Source https://phpmd.org/rules/codesize.html#toomanyfields

Avoid using static access to class '\phpGPX\Helpers\SerializationHelper' in method 'toArray'.
Open

            'extensions' => SerializationHelper::serialize($this->extensions)
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'src' => SerializationHelper::stringOrNull($this->source),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'fix' => SerializationHelper::stringOrNull($this->fix),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'name' => SerializationHelper::stringOrNull($this->name),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'sym' => SerializationHelper::stringOrNull($this->symbol),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'link' => SerializationHelper::serialize($this->links),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'desc' => SerializationHelper::stringOrNull($this->description),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'type' => SerializationHelper::stringOrNull($this->type),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'ele' => SerializationHelper::floatOrNull($this->elevation),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'geoidheight' => SerializationHelper::floatOrNull($this->geoidHeight),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'difference' => SerializationHelper::floatOrNull($this->difference),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'cmt' => SerializationHelper::stringOrNull($this->comment),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'distance' => SerializationHelper::floatOrNull($this->distance),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'sat' => SerializationHelper::integerOrNull($this->satellitesNumber),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'hdop' => SerializationHelper::floatOrNull($this->hdop),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'vdop' => SerializationHelper::floatOrNull($this->vdop),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'pdop' => SerializationHelper::floatOrNull($this->pdop),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'ageofdgpsdata' => SerializationHelper::floatOrNull($this->ageOfGpsData),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\DateTimeHelper' in method 'toArray'.
Open

            'time' => DateTimeHelper::formatDateTime($this->time, phpGPX::$DATETIME_FORMAT, phpGPX::$DATETIME_TIMEZONE_OUTPUT),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'dgpsid' => SerializationHelper::integerOrNull($this->dgpsid),
Severity: Minor
Found in src/phpGPX/Models/Point.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\Helpers\SerializationHelper' in method 'toArray'.
Open

            'magvar' => SerializationHelper::floatOrNull($this->magVar),
Severity: Minor
Found in src/phpGPX/Models/Point.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

There are no issues that match your filters.

Category
Status