creof/doctrine2-spatial

View on GitHub

Showing 447 of 447 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function testSelectSTSnapToGridSignature2Parameters()
    {
        $entity = new PointEntity();
        $entity->setPoint(new Point(1.25, 2.55));
        $this->getEntityManager()->persist($entity);
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 52..69
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 74..91
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 96..113

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 119.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function testSelectSTSnapToGridSignature5Parameters()
    {
        $entity = new PointEntity();
        $entity->setPoint(new Point(5.25, 6.55));
        $this->getEntityManager()->persist($entity);
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 30..47
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 52..69
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 96..113

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 119.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function testSelectSTSnapToGridSignature6Parameters()
    {
        $entity = new PointEntity();
        $entity->setPoint(new Point(5.25, 6.55));
        $this->getEntityManager()->persist($entity);
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 30..47
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 52..69
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 74..91

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 119.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function testSelectSTSnapToGridSignature3Parameters()
    {
        $entity = new PointEntity();
        $entity->setPoint(new Point(1.25, 2.55));
        $this->getEntityManager()->persist($entity);
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 30..47
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 74..91
tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/PostgreSql/STSnapToGridTest.php on lines 96..113

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 119.

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

Further Reading

Method setUpFunctions has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function setUpFunctions()
    {
        $configuration = $this->getEntityManager()->getConfiguration();

        if ($this->getPlatform()->getName() == 'postgresql') {
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/OrmTestCase.php - About 1 hr to fix

Method testMBRDisjointWhereParameter has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testMBRDisjointWhereParameter()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),

Method testSTDisjointWhereParameter has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSTDisjointWhereParameter()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),

Method testDisjointWhereParameter has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testDisjointWhereParameter()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),

Method testSelectSTDisjoint has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSelectSTDisjoint()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),

Method testSelectMBRDisjoint has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSelectMBRDisjoint()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),

Method testSelectDisjoint has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSelectDisjoint()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),

Method testGeometryWalkerText has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testGeometryWalkerText()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(2, 2),
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/ORM/Query/GeometryWalkerTest.php - About 1 hr to fix

Method testGeometryWalkerBinary has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testGeometryWalkerBinary()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(2, 2),
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/ORM/Query/GeometryWalkerTest.php - About 1 hr to fix

Method testSolidMultiLineStringAddRings has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSolidMultiLineStringAddRings()
    {
        $expected = array(
            new LineString(
                array(

Method testSolidPolygonFromArrayAddRings has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSolidPolygonFromArrayAddRings()
    {
        $expected = array(
            new LineString(
                array(
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/PHP/Types/Geometry/PolygonTest.php - About 1 hr to fix

Method testSelectSTSummaryGeometry has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSelectSTSummaryGeometry()
    {
        $entity1 = new GeometryEntity();
        $point1  = new Point(5, 5);

Method testSelectSTSummaryGeography has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSelectSTSummaryGeography()
    {
        $entity1 = new GeographyEntity();
        $point1  = new GeographyPoint(5, 5);

Method testMultiLineStringFromObjectsToArray has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testMultiLineStringFromObjectsToArray()
    {
        $expected = array(
            array(
                array(0, 0),

Method testSTEnvelopeWhereParameter has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSTEnvelopeWhereParameter()
    {
        $entity1 = new PolygonEntity();
        $rings1 = array(
            new LineString(array(

Method testSolidMultiLineStringFromArraysGetRings has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSolidMultiLineStringFromArraysGetRings()
    {
        $expected = array(
            new LineString(
                array(
Severity
Category
Status
Source
Language