Resolve cyclomatic complexity and NCSS issues in saveOrInsert