diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 41481fa28a001cdb3fd08791b4cf8352c5d6b96a..83b052e159eb7ecedef61dd33e3b28c7b51ec480 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,9 +17,10 @@ before_script:
     - echo BUILD_OPTIONS $BUILD_OPTIONS
     - echo VERSION $VERSION
     - (cd build &&
-       cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake ..
-             $BUILD_OPTIONS &&
-        ctest --no-compress-output -V -j 5
+       scan-build -plist --intercept-first --analyze-headers -o analyzer_reports
+       cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. $BUILD_OPTIONS &&
+       scan-build -plist --intercept-first --analyze-headers -o analyzer_reports
+       ctest --no-compress-output -V -j 5
              -D ExperimentalBuild
              -D ExperimentalSubmit
              | tee ../chameleon_${VERSION}.log)
diff --git a/tools/analysis.sh b/tools/analysis.sh
index 9c66eb740735e3ab5a1b448204ffe42b98fcbc05..d7ffc3f554fb80be832f386bb8ccbd2fda043856 100755
--- a/tools/analysis.sh
+++ b/tools/analysis.sh
@@ -35,14 +35,17 @@ sonar.projectVersion=master
 sonar.language=c
 sonar.sources=build, compute, control, coreblas, example, include, runtime, testing, timing
 sonar.inclusions=`cat filelist.txt | xargs echo | sed 's/ /, /g'`
+sonar.c.includeDirectories=$(echo | gcc -E -Wp,-v - 2>&1 | grep "^ " | tr '\n' ',').,include,coreblas/include,runtime/parsec/include,runtime/quark/include,runtime/starpu/include,build,build/control,build/coreblas,build/coreblas/include,build/include,build/runtime/parsec/include,build/runtime/quark/include,build/runtime/starpu/include,hqr/include,$PARSEC_DIR/include,$QUARK_DIR/include,$STARPU_DIR/include/starpu/1.2,$SIMGRID_DIR/include
 sonar.sourceEncoding=UTF-8
+sonar.c.errorRecoveryEnabled=true
 sonar.c.compiler.charset=UTF-8
 sonar.c.compiler.parser=GCC
-sonar.c.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$
+sonar.c.compiler.regex=^(.*):(\\\d+):\\\d+: warning: (.*)\\\[(.*)\\\]$
 sonar.c.compiler.reportPath=chameleon_starpu.log, chameleon_starpu_simgrid.log, chameleon_quark.log, chameleon_parsec.log
 sonar.c.coverage.reportPath=chameleon_coverage.xml
 sonar.c.cppcheck.reportPath=chameleon_cppcheck.xml
 sonar.c.rats.reportPath=chameleon_rats.xml
+sonar.c.clangsa.reportPath=build/analyzer_reports/*/*.plist
 EOF
 
 # run sonar analysis + publish on sonarqube-dev