creof/doctrine2-spatial

View on GitHub

Showing 444 of 444 total issues

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

        $expected = array(
            array(
                array(
                    array(0, 0),
                    array(10, 0),
tests/CrEOF/Spatial/Tests/PHP/Types/Geometry/MultiPolygonTest.php on lines 115..134
tests/CrEOF/Spatial/Tests/PHP/Types/Geometry/MultiPolygonTest.php on lines 278..297
tests/CrEOF/Spatial/Tests/PHP/Types/Geometry/MultiPolygonTest.php on lines 307..326

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

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

Function onNotSuccessfulTest has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function onNotSuccessfulTest(\Exception $e)
    {
        if (! $GLOBALS['opt_use_debug_stack'] || $e instanceof \PHPUnit_Framework_AssertionFailedError) {
            throw $e;
        }
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/OrmTestCase.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method testSolidMultiPolygonFromArraysGetPolygons has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSolidMultiPolygonFromArraysGetPolygons()
    {
        $expected = array(
            new Polygon(
                array(
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/PHP/Types/Geometry/MultiPolygonTest.php - About 2 hrs to fix

Method testSolidMultiPolygonFromObjectsToArray has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSolidMultiPolygonFromObjectsToArray()
    {
        $expected = array(
            array(
                array(
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/PHP/Types/Geometry/MultiPolygonTest.php - About 2 hrs to fix

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 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 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 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 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 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 setUpFunctions has 43 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 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 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 testSolidMultiLineStringAddRings has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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

Severity
Category
Status
Source
Language