[TASK] Enhance code according to Sonar rules

https://metrics.typo3.org reports a few problems:

- LineLengthMaxExceeded
- LogicalOperatorSpacingTooMuchSpaceBefore
- ForLoopWithTestFunctionCallNotAllowed
- DoubleQuoteUsageContainsVar

Change-Id: Id861a34bf932386b8b605c79fbbb341192cae5f7
Reviewed-on: https://review.typo3.org/26657
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers