Edit the file conf/local.conf and add the following line
INHERIT += "sca"
this will run static code analysis on all the recipes available and used in your workspace. It might be a good idea to do this if you like to wait for a very long time on your build - maybe nightly builds
Edit the recipe-file by adding the following line
inherit sca
Now the power of static code analysis will be applied to exactly this recipe