Remg/GeneratorBundle

View on GitHub

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',
Severity: Major
Found in Mapping/MappingValidator.php - About 3 hrs to fix

    Entity has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Entity implements EntityInterface
    {
        /**
         * Contains the entity name.
         *
    Severity: Minor
    Found in Model/Entity.php - About 3 hrs to fix

      File MappingValidator.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * This file is part of the RemgGeneratorBundle package.
       *
      Severity: Minor
      Found in Mapping/MappingValidator.php - About 2 hrs to fix

        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:
        Severity: Minor
        Found in Mapping/ClassMetadataFactory.php - About 1 hr to fix

          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();
          Severity: Minor
          Found in Mapping/EntityBuilder.php - About 1 hr to fix

            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 */
            Severity: Minor
            Found in Command/GenerateEntityCommand.php - About 1 hr to fix

              Method listAssociations has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function listAssociations(EntityInterface $entity)
                  {
                      if ($entity->getAssociations()->isEmpty()) {
                          return;
                      }
              Severity: Minor
              Found in Command/Helper/EntityHelper.php - About 1 hr to fix

                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:
                Severity: Minor
                Found in Mapping/ClassMetadataFactory.php - About 55 mins 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

                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'];
                
                
                Severity: Minor
                Found in Model/Association.php - About 45 mins 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

                Function getAllEntities has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getAllEntities()
                    {
                        $metadatas = $this->metadataFactory->getAllMetadata();
                
                        if (empty($metadatas)) {
                Severity: Minor
                Found in Mapping/EntityFactory.php - About 45 mins 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

                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
                Severity: Minor
                Found in Model/Association.php - About 35 mins 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

                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()
                Severity: Minor
                Found in Mapping/EntityBuilder.php - About 35 mins 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

                Severity
                Category
                Status
                Source
                Language