Showing 12 of 18 total issues
Method getPhpKeywords
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getPhpKeywords()
{
return [
'abstract',
'and',
Entity
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Entity implements EntityInterface
{
/**
* Contains the entity name.
*
File MappingValidator.php
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the RemgGeneratorBundle package.
*
Method buildAssociations
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildAssociations(EntityInterface $entity, ClassMetadataBuilder $builder)
{
foreach ($entity->getAssociations() as $association) {
switch ($association->getType()) {
case Association::ONE_TO_ONE:
Method getReverseAssociation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getReverseAssociation(AssociationInterface $targetAssociation)
{
$name = $targetAssociation->isOwningSide()
? $targetAssociation->getInversedBy()
: $targetAssociation->getMappedBy();
Method interact
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
/* @var StyleInterface */
$display = $this->getDisplay($input, $output);
/* @var \Remg\GeneratorBundle\Command\Helper\EntityHelper */
Method listAssociations
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function listAssociations(EntityInterface $entity)
{
if ($entity->getAssociations()->isEmpty()) {
return;
}
Function buildAssociations
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function buildAssociations(EntityInterface $entity, ClassMetadataBuilder $builder)
{
foreach ($entity->getAssociations() as $association) {
switch ($association->getType()) {
case Association::ONE_TO_ONE:
- 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 __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $mapping = null)
{
if ($mapping) {
$this->name = $mapping['fieldName'];
- 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 getAllEntities
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getAllEntities()
{
$metadatas = $this->metadataFactory->getAllMetadata();
if (empty($metadatas)) {
- 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 getDoctrineType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getDoctrineType()
{
if (
static::ONE_TO_MANY === $this->type
&& false === $this->bidirectional
- 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 discoverAssociations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function discoverAssociations(EntityInterface $entity, array $entities)
{
foreach ($entities as $targetEntity) {
$targetAssociations = $targetEntity
->getAssociations()
- 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"