Fixing an example script for changes in getter/setter reform
Removing traces of nxdoc
- add target for cppcheck with same arguments as for compilation
- fix error message
- reduce variable scopes