Code should not be duplicated

  • Minor
  • Architecture

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

  1. */
  2. public function setFalseLabel($falseLabel)
  3. {
  4. $this->falseLabel = $falseLabel;
  5. return $this;

    The next 81 lines appear both in Datatable/Column/BooleanColumn.php:276 and Datatable/Column/DateTimeColumn.php:181.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by stwe
  6. }
  7. //-------------------------------------------------
  8. // Helper
  9. //-------------------------------------------------

Booleans and null should be compared strictly

  • Minor
  • Bugrisk

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

  1. * @return $this
  2. */
  3. private function setSelectFrom()
  4. {
  5. foreach ($this->selectColumns as $key => $value) {
  6. if (null != $key) {

    With booleans and null, only strict comparison (with !== operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Sébastien ALFAIATE
  7. $this->qb->addSelect('partial '.$key.'.{'.implode(',', $value).'}');
  8. } else {
  9. $this->qb->addSelect($value);
  10. }
  11. }

Unused method, property, variable or parameter 6

  • Minor
  • Deadcode

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

  1. * @param boolean $bool flag defining whether use caching or not
  2. * @param int|null $lifetime lifetime of cache in seconds
  3. * @param string|null $resultCacheId string identifier for result cache if left empty ID will be generated by Doctrine
  4. * @return $this
  5. */
  6. public function useResultCache($bool, $lifetime = null, $resultCacheId = null)

    This bool argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Eloar
  7. {
  8. $this->useResultCacheArgs = func_get_args();
  9. return $this;
  10. }
  1. * @param boolean $bool flag defining whether use caching or not
  2. * @param int|null $lifetime lifetime of cache in seconds
  3. * @param string|null $resultCacheId string identifier for result cache if left empty ID will be generated by Doctrine
  4. * @return $this
  5. */
  6. public function useResultCache($bool, $lifetime = null, $resultCacheId = null)

    This lifetime argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Eloar
  7. {
  8. $this->useResultCacheArgs = func_get_args();
  9. return $this;
  10. }
  1. * @param boolean $bool flag defining whether use caching or not
  2. * @param int|null $lifetime lifetime of cache in seconds
  3. * @param string|null $resultCacheId string identifier for result cache if left empty ID will be generated by Doctrine
  4. * @return $this
  5. */
  6. public function useResultCache($bool, $lifetime = null, $resultCacheId = null)

    This resultCacheId argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Eloar
  7. {
  8. $this->useResultCacheArgs = func_get_args();
  9. return $this;
  10. }
  1. * @param boolean $bool flag defining whether use caching or not
  2. * @param int|null $lifetime lifetime of cache in seconds
  3. * @param string|null $resultCacheId string identifier for result cache if left empty ID will be generated by Doctrine
  4. * @return $this
  5. */
  6. public function useCountResultCache($bool, $lifetime = null, $resultCacheId = null)

    This bool argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Eloar
  7. {
  8. $this->useCountResultCacheArgs = func_get_args();
  9. return $this;
  10. }
  1. * @param boolean $bool flag defining whether use caching or not
  2. * @param int|null $lifetime lifetime of cache in seconds
  3. * @param string|null $resultCacheId string identifier for result cache if left empty ID will be generated by Doctrine
  4. * @return $this
  5. */
  6. public function useCountResultCache($bool, $lifetime = null, $resultCacheId = null)

    This resultCacheId argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Eloar
  7. {
  8. $this->useCountResultCacheArgs = func_get_args();
  9. return $this;
  10. }
  1. * @param boolean $bool flag defining whether use caching or not
  2. * @param int|null $lifetime lifetime of cache in seconds
  3. * @param string|null $resultCacheId string identifier for result cache if left empty ID will be generated by Doctrine
  4. * @return $this
  5. */
  6. public function useCountResultCache($bool, $lifetime = null, $resultCacheId = null)

    This lifetime argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Eloar
  7. {
  8. $this->useCountResultCacheArgs = func_get_args();
  9. return $this;
  10. }

Text files should end with a newline character 20

  • Info
  • Codestyle

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

in Resources/doc/cache.md, line 131
  1. ```
  2. Above listing shows how 3 different cache drivers are set for default entity manager. Each driver is set as service, and
  3. id of service points to doctrine cache provider setup earlier. It is not mandatory to use different cache providers for
  4. each kind of cache driver, but might be good start for use of different kind of provider for different kind of data
  5. (ex. Redis for results and filesystem for both metadata and queries).

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Eloar
  1. },
  2. "oAria": {
  3. "sSortAscending": ": aktiveer kolom stygende te sorteer",
  4. "sSortDescending": ": aktiveer kolom orde te sorteer"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": sütunu artma sırası üzərə aktiv etmək",
  4. "sSortDescending": ": sütunu azalma sırası üzərə aktiv etmək"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": rhoi ar waith i drefnu colofnau o'r lleiaf i'r mwyaf",
  4. "sSortDescending": ": rhoi ar waith i drefnu colofnau o'r mwyaf i'r lleiaf"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": activate to sort column ascending",
  4. "sSortDescending": ": activate to sort column descending"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": Activar para ordenar la columna de manera ascendente",
  4. "sSortDescending": ": Activar para ordenar la columna de manera descendente"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": Zutabea goranzko eran ordenatzeko aktibatu ",
  4. "sSortDescending": ": Zutabea beheranzko eran ordenatzeko aktibatu"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": Activar para ordenar a columna de maneira ascendente",
  4. "sSortDescending": ": Activar para ordenar a columna de maneira descendente"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": સ્તંભ ચડતા ક્રમમાં ગોઠવવા માટે સક્રિય",
  4. "sSortDescending": ": કૉલમ ઉતરતા ક્રમમાં ગોઠવવા માટે સક્રિય"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. "sFirst": "Pertama",
  2. "sPrevious": "Sebelumnya",
  3. "sNext": "Selanjutnya",
  4. "sLast": "Terakhir"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": virkja til að raða dálki í hækkandi röð",
  4. "sSortDescending": ": virkja til að raða dálki lækkandi í röð"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": attiva per ordinare la colonna in ordine crescente",
  4. "sSortDescending": ": attiva per ordinare la colonna in ordine decrescente"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": 오름차순 정렬",
  4. "sSortDescending": ": 내림차순 정렬"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": په صعودي ډول مرتبول",
  4. "sSortDescending": ": په نزولي ډول مرتبول"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": තීරුව ආරෝහනව තෝරන්න",
  4. "sSortDescending": ": තීරුව අවරෝහනව තෝරන්න"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": vključite za naraščujoči sort",
  4. "sSortDescending": ": vključite za padajoči sort"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": aktivizo për të sortuar kolumnin me vlera në ngritje",
  4. "sSortDescending": ": aktivizo për të sortuar kolumnin me vlera në zbritje"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": seti kulainisha sanjari kwa mtindo wa upandaji",
  4. "sSortDescending": ": seti kulainisha sanjari kwa mtindo wa mteremko"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": நிரலை ஏறுவரிசையில் வரிசைப்படுத்த செயல்படுத்த",
  4. "sSortDescending": ": நிரலை இறங்கு வரிசைப்படுத்த செயல்படுத்த"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe
  1. },
  2. "oAria": {
  3. "sSortAscending": ": to'g'ri tartiblash",
  4. "sSortDescending": ": teskari tartiblash"
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by stwe