Showing 44 of 330 total issues
Method testGetIterator
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetIterator()
{
$first = new stdClass();
$second = new stdClass();
$third = new stdClass();
Method parameterProvider
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parameterProvider() : array
{
return [
'no-parameters' => [
[],
Method testOneToManyHydrationWithEntity
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testOneToManyHydrationWithEntity(bool $eagerHydration)
{
$entityPrototype = new class
{
public $bar;
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
string $propertyName,
string $targetTable,
string $targetEntity,
string $targetFieldName,
string $targetInterfaceName = null,
Method execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(Command $command) : CollectionInterface
{
$xml = $this->connection->execute($command, self::GRAMMAR_PATH);
$errorCode = (int) $xml->error['code'];
$dataSource = $xml->datasource;
Method testOneToOneInverseHydrationWithoutEntity
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testOneToOneInverseHydrationWithoutEntity(bool $eagerHydration)
{
$entityPrototype = new class
{
public $baz;
Method testOneToOneOwningHydrationWithoutEntity
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testOneToOneOwningHydrationWithoutEntity(bool $eagerHydration)
{
$entityPrototype = new class
{
public $baz;
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
string $layout,
string $className,
array $fields,
array $embeddables,
array $oneToMany,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
string $fieldName,
string $propertyName,
string $targetTable,
string $targetEntity,
string $targetPropertyName,
Method testManyToOneHydrationWithoutEntity
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testManyToOneHydrationWithoutEntity(bool $eagerHydration)
{
$entityPrototype = new class
{
public $baz;
Function buildProxyClass
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function buildProxyClass(
string $entityInterfaceName,
string $proxyNamespace,
string $proxyClassName
) : string {
- 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 testProxyExtraction
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testProxyExtraction()
{
$entity = new class
{
private $baz = 'bat';
Function __toString
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __toString() : string
{
$parts = [];
foreach ($this->parameters as $name => $value) {
- 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
Function toParameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function toParameters() : array
{
if (empty($this->queries)) {
throw EmptyQueryException::fromEmptyQueryArray();
}
- 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 __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $fieldName,
string $propertyName,
TypeInterface $type,
bool $repeatable,
bool $readOnly
Method findBy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
array $search,
array $sort = [],
int $limit = null,
int $offset = null,
bool $autoQuoteSearch = true
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $propertyName,
string $targetTable,
string $targetEntity,
string $targetFieldName,
bool $eagerHydration = false
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
HttpClient $httpClient,
UriInterface $uri,
string $database,
IdentityHandlerInterface $identityHandler = null,
LoggerInterface $logger = null
Method findBy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
array $search,
array $sort = [],
int $limit = null,
int $offset = null,
bool $autoQuoteSearch = true
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute(Command $command) : CollectionInterface
{
$xml = $this->connection->execute($command, self::GRAMMAR_PATH);
$errorCode = (int) $xml->error['code'];
$dataSource = $xml->datasource;
- 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"