Fix sonar issue about nested stmts

Refactor code to not nest more than 3 condition or loop stmts
in policy PolicyEngineUtils. Rework based on review comments

Issue-ID: POLICY-1003
Change-Id: I95fcfa0f99c517c02357c85ca39cd2f934e8da4d
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
3 files changed