[TASK] Code improvements according to metrics.typo3.org

Change-Id: I1ebe00fb98e2c6e40c3475b861c2e459313a1523
Reviewed-on: https://review.typo3.org/25659
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes