Source code should not contain TODO comments 4

  • Minor
  • Architecture

More information: https://insight.symfony.com/what-we-analyse/task_todo_comment

  1. $qb = $this->em->createQueryBuilder();
  2. $qb->select('count(distinct ' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');
  3. $qb->from($this->entityName, $this->tableName);
  4. /*
  5. * @todo: $this->setJoins($qb);

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Permalink
    Last edited by Steffen
  6. */
  7. return !$qb->getDQLPart('groupBy') ?
  8. (int)$qb->getQuery()->getSingleScalarResult()
  9. : count($qb->getQuery()->getResult());
  • stwe

    Not necessary for dev-master
  1. $metadata = $this->em->getMetadataFactory()->getMetadataFor($entityName);
  2. } catch (MappingException $e) {
  3. throw new Exception('DatatableQuery::getMetadata(): Given object ' . $entityName . ' is not a Doctrine Entity.');
  4. }
  5. // @todo:

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Permalink
    Last edited by Steffen
  6. return $metadata;
  7. }
  8. /**
  9. * Get table name.
  • stwe

    Not necessary for dev-master
  1. $resolver->setAllowedTypes('join_type', 'string');
  2. $resolver->setAllowedTypes('type_of_field', array('null', 'string'));
  3. $resolver->setAllowedValues('cell_type', array(null, 'th', 'td'));
  4. $resolver->setAllowedValues('join_type', array(null, 'join', 'leftJoin', 'innerJoin'));
  5. // @todo: $resolver->setAllowedValues('type_of_field', array(null, 'string', 'integer', 'boolean'));

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Permalink
    Last edited by Steffen
  6. return $this;
  7. }
  8. //-------------------------------------------------
  • stwe

    Not necessary for dev-master
  1. // resolve options - !!'data' can be modified again!!
  2. $column->set($options);
  3. if (null === $column->getTypeOfField() && true === $column->isSelectColumn()) {
  4. if (true === $column->isAssociation()) {
  5. // @todo: set type of field for association

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Permalink
    Last edited by Steffen
  6. $column->setTypeOfField(null);
  7. } else {
  8. $column->setTypeOfField($this->metadata->getTypeOfField($dql));
  9. }
  10. }
  • stwe

    Not necessary for dev-master

Unused method, property, variable or parameter 2

  • Minor
  • Deadcode

More information: https://insight.symfony.com/what-we-analyse/php.unused_local_variable_or_private_member

  1. private $requestParams;
  2. /**
  3. * @var DatatableInterface
  4. */
  5. private $datatable;

    This datatable attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by Steffen
  6. /**
  7. * The EntityManager.
  8. *
  9. * @var EntityManagerInterface
  1. /**
  2. * The doctrine orm entity manager service.
  3. *
  4. * @var EntityManagerInterface
  5. */
  6. private $em;

    This em attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by Steffen
  7. /**
  8. * The class metadata.
  9. *
  10. * @var ClassMetadata