Showing 44 of 330 total issues
Method validXmlProvider
has 275 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function validXmlProvider() : array
{
return [
'project-sample-data' => [
'projectsampledata.xml',
File MetadataHydrationTest.php
has 468 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types = 1);
namespace SoliantTest\SimpleFM\Repository\Builder;
File RepositoryTest.php
has 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types = 1);
namespace SoliantTest\SimpleFM\Repository;
File ResultSetClientTest.php
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types = 1);
namespace SoliantTest\SimpleFM\Client\ResultSet;
File MetadataExtractionTest.php
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types = 1);
namespace SoliantTest\SimpleFM\Repository\Builder;
Function hydrateWithMetadata
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
private function hydrateWithMetadata(array $data, $entity, Entity $metadata)
{
Assertion::isInstanceOf($entity, $metadata->getClassName());
$reflectionClass = new ReflectionClass($entity);
- Read upRead up
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 buildMetadata
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildMetadata(string $xmlPath) : Entity
{
$xml = $this->loadValidatedXml($xmlPath);
$fields = [];
$embeddables = [];
Method hydrateWithMetadata
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function hydrateWithMetadata(array $data, $entity, Entity $metadata)
{
Assertion::isInstanceOf($entity, $metadata->getClassName());
$reflectionClass = new ReflectionClass($entity);
File FileMakerException.php
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types = 1);
namespace Soliant\SimpleFM\Client\Exception;
RepositoryTest
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
final class RepositoryTest extends TestCase
{
public function testQuoteStringUsesClientMethod()
{
$resultSetClient = $this->prophesize(ResultSetClientInterface::class);
Function buildMetadata
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function buildMetadata(string $xmlPath) : Entity
{
$xml = $this->loadValidatedXml($xmlPath);
$fields = [];
$embeddables = [];
- Read upRead up
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 buildProxyClass
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildProxyClass(
string $entityInterfaceName,
string $proxyNamespace,
string $proxyClassName
) : string {
MetadataBuilderTest
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
final class MetadataBuilderTest extends TestCase
{
public function testInvalidType()
{
$this->expectException(InvalidArgumentException::class);
Function extractWithMetadata
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function extractWithMetadata($entity, Entity $metadata) : array
{
if ($entity instanceof ProxyInterface) {
$entity = $entity->__getRealEntity();
}
- Read upRead up
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 extractWithMetadata
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractWithMetadata($entity, Entity $metadata) : array
{
if ($entity instanceof ProxyInterface) {
$entity = $entity->__getRealEntity();
}
Function arrayToParagraphs
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function arrayToParagraphs($value)
{
$count = count($value);
if ($count) {
$collapsedValue = '';
- Read upRead up
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
File MetadataBuilderTest.php
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types = 1);
namespace SoliantTest\SimpleFM\Repository\Builder\Metadata;
Method testOneToOneInverseHydrationWithEntity
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testOneToOneInverseHydrationWithEntity(bool $eagerHydration)
{
$entityPrototype = new class
{
public $baz;
Method testOneToOneOwningHydrationWithEntity
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testOneToOneOwningHydrationWithEntity(bool $eagerHydration)
{
$entityPrototype = new class
{
public $baz;
Method testManyToOneHydrationWithChild
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testManyToOneHydrationWithChild(bool $eagerHydration)
{
$entityPrototype = new class
{
public $baz;