Resolve cyclomatic complexity & NCSS Sonar issues with validateDoc