code improvements inspired by sonar, complexity

refs #8346
code improvement inspired by sonar, braces

refs #8346
code improvement inspired by sonar, empty if stmt

refs #8346