Sonar major warnings param assignment

* Removed Assignments to Parameters
* Made copies of objects where necessary especially in sync code blocks for mutability reasons