creof/doctrine2-spatial

View on GitHub

Showing 60 of 447 total issues

File OrmTestCase.php has 320 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Copyright (C) 2015 Derek J. Lambert
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
Severity: Minor
Found in tests/CrEOF/Spatial/Tests/OrmTestCase.php - About 3 hrs to fix

File MultiPolygonTest.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php


namespace CrEOF\Spatial\Tests\PHP\Types\Geometry;

Severity: Minor
Found in tests/CrEOF/Spatial/Tests/PHP/Types/Geometry/MultiPolygonTest.php - About 3 hrs to fix

Method testSelectArea has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSelectArea()
    {
        $entity1 = new PolygonEntity();
        $rings1 = array(
            new LineString(array(
Severity: Major
Found in tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/MySql/AreaTest.php - About 2 hrs to fix

Method testSelectSTArea has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Method testAreaWhere has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testAreaWhere()
    {
        $entity1 = new PolygonEntity();
        $rings1 = array(
            new LineString(array(
Severity: Major
Found in tests/CrEOF/Spatial/Tests/ORM/Query/AST/Functions/MySql/AreaTest.php - About 2 hrs to fix

Method testSTAreaWhere has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function validateArguments has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function validateArguments(array $argv = null)
    {
        $argc = count($argv);

        if (1 == $argc && is_array($argv[0])) {
Severity: Minor
Found in lib/CrEOF/Spatial/PHP/Types/AbstractPoint.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 testSolidMultiPolygonAddPolygon has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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 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
Severity
Category
Status
Source
Language