74677[TASK] Resolve more dead code paths
Commit message
Review
-
Code review CR +2 Done
- Nikita Hovratov +2
- Joey Bouten +1
- Stefan Bürk +1
-
Verified V +2 Done
- Nikita Hovratov +2
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 5
- Build/phpstan/phpstan-baseline.neon+0 −20
- typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php+1 −1
- typo3/sysext/backend/Classes/View/PageLayoutView.php9+1 −1
- typo3/sysext/core/Classes/LinkHandling/LinkService.php+2 −2
- typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php+1 −1
Review log 2024
-
crell uploaded patch set 1 05/17/22, 23:03
-
core-ci voted on patch set 1 V +1 05/17/22, 23:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27291
-
Simon Schaufelberger commented on patch set 1 05/18/22, 10:54
-
crell commented on patch set 1 05/18/22, 13:29
PageLayoutView.php:1001ReplyNot manually; I assumed the test bot would catch it if there was something wonky. However, from static analysis, none of it gets used. $out is always set to a string immediately before the if, so it will never be false. (This is what PHPStan noted.) So that is irrelevant. Both branches of the if statement overwrite $out, so whatever it's set to before that is irrelevant. So remove that. $confirm is only used in $out, but since $out is irrelevant so is $confirm. $refCountMsg is only used in $confirm. $params is only used in $out. So while those lines were executed, they ultimately do nothing but burn CPU cycles. -
Simon Schaufelberger commented on patch set 1 05/18/22, 14:08
PageLayoutView.php:1001ReplyYes, $out is always true but $out is a concatenated string and you just removed a whole code block which should be wrapped but is now missing a lot of HTML. I can't believe this is dead. -
crell commented on patch set 1 05/18/22, 15:04
PageLayoutView.php:1001ReplyI looked it over again, and interestingly you're right. I goofed and while both if branches overwrite $out, one of them uses out in doing so, so its value is not wasted. I'll revert that part of the patch. However, that means there's some missing test coverage as CI should have caught this. -
crell uploaded patch set 2 05/18/22, 15:04
-
core-ci voted on patch set 2 V +1 05/18/22, 15:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27304
-
Nikita Hovratov uploaded patch set 3 05/18/22, 15:45
-
Nikita Hovratov voted on patch set 3 V +1 CR +1 05/18/22, 15:48
-
core-ci voted on patch set 3 V +1 05/18/22, 15:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27305
-
Simon Schaufelberger voted on patch set 3 CR +1 05/18/22, 16:33
-
Stefan Bürk commented on patch set 3 05/28/22, 22:44
PageLayoutView.php:1025This looks kind of weired/dangerous - or do i get something wrong ? if $delete is disabled, this would not be checked. If not, this may be checked and when having insufficent permissiones, this will clean all in $out, not just the $deleteButton part - however, not related to this patch. Or is it only me struggling with this when seeing it ? Not as blocker for this patch - but may someone confirm this feeling here before getting this patch merged ? -
Oliver Klee commented on patch set 3 05/29/22, 10:04
PageLayoutView.php:1025ReplyI line 1014, $out gets appended some non-empty and non-falsy string. So $out will always be truthy in line 2021, and this change is correct. -
Stefan Bürk commented on patch set 3 05/29/22, 11:17
PageLayoutView.php:1025ReplyYou got me wrong. removing the $out from the condition is obious and not my question. My quetion is about the "else" branch here doing $out = '' in conjuntion with L1000 condition. If $disableDelete is not true and $this->hasContentModificationAndAccesspermissions() will return false, it will empty out $out - but only in that constellation. This would not only clearing L1014, but also L972-L974 + eventually set L990-L992. And that is what I'm asking for .. 1) is the clearing of the previous set complet out okay here and 2) should the check eventually be outside $disableDelete or $out eventually used as "early" check to avoid amending to $out ?? -
Oliver Klee commented on patch set 3 05/29/22, 11:37
PageLayoutView.php:1025ReplyOh. :-) I'd indeed recommend to make it a guard clause/early check, but in a separate change with a dedicated ticket. -
Stefan Bürk commented on patch set 3 05/30/22, 05:14
PageLayoutView.php:1025ReplySure .. already said, not as blocker for this patch - just wanted to have someone confirm this point ;). -
Stefan Bürk updated the commit message in patch set 4 05/30/22, 05:15
-
Stefan Bürk voted on patch set 4 V +1 CR +1 05/30/22, 05:15
-
core-ci voted on patch set 4 V +1 05/30/22, 05:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27576
-
Oliver Klee wrote 06/07/22, 17:43
Removed cc Oliver Klee. -
Joey Bouten voted on patch set 4 CR +1 06/08/22, 12:35
-
Nikita Hovratov voted on patch set 4 V +2 CR +2 06/09/22, 07:29
-
Nikita Hovratov merged patch set 5 06/09/22, 07:30
PageLayoutView.php:1001