Commit 038c8f49 authored by GILLES Sebastien's avatar GILLES Sebastien

#1500 Several improvements in analysis scripts (unfortunately no way found to...

#1500 Several improvements in analysis scripts (unfortunately no way found to shave off time as I did for Cppcheck...).
parent ca764f59
......@@ -48,6 +48,7 @@ clang-static-analysis:
when: always
paths:
- build_4_sonarqube/analyzer_reports
- build_4_sonarqube/morefem-build.log
only:
- develop@MoReFEM/CoreLibrary/MoReFEM
- /(sonarqube)/
......@@ -70,7 +71,8 @@ sonarqube:
paths:
- morefem-cppcheck.xml
- morefem-rats.xml
- morefem-build.log
- build_4_sonarqube/morefem-build.log
- build_4_sonarqube/analyzer_reports
- sonar.log
only:
- develop@MoReFEM/CoreLibrary/MoReFEM
......
......@@ -2,7 +2,7 @@ import os
import sys
import shutil
import subprocess
import time
if __name__ == "__main__":
......@@ -24,8 +24,13 @@ if __name__ == "__main__":
"--install_directory=/opt",
"--no_run_command" )
start = time.time()
subprocess.Popen(cmd, shell = False).communicate()
step1 = time.time()
print("Preparing CMakeLists.txt done - {} seconds elapsed".format(round(step1 - start, 1)))
cmd = ( "scan-build",
"-v",
"--plist-html",
......@@ -41,9 +46,18 @@ if __name__ == "__main__":
"-DCMAKE_VERBOSE_MAKEFILE=ON",
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
"..")
step2 = time.time()
print("Running CMake done - {} seconds elapsed".format(round(step2 - start, 1)))
subprocess.Popen(cmd, shell = False).communicate()
cmd = "scan-build -v --plist-html --intercept-first --analyze-headers -o analyzer_reports ninja 2>&1 | tee morefem-build.log"
step3 = time.time()
print("Running scan build - {} seconds elapsed".format(round(step3 - start, 1)))
subprocess.Popen(cmd, shell = True).communicate()
end = time.time()
print("Output written in analyzer_reports directory; analysis performed in {} seconds".format(round(end - start, 1)))
\ No newline at end of file
......@@ -3,37 +3,40 @@
# create the sonarqube config file
cat > sonar-project.properties << EOF
sonar.host.url=https://sonarqube.inria.fr/sonarqube
sonar.login=$SONARQUBE_LOGIN
sonar.login=38a5102208b9b34fb90fdc89358289239488da30
sonar.links.homepage=$CI_PROJECT_URL
sonar.links.scm=$CI_REPOSITORY_URL
sonar.scm.disabled=false
sonar.scm.disabled=true
sonar.scm.provider=git
sonar.projectKey=m3disim:morefem:$SONARQUBE_PROJECT:$CI_COMMIT_REF_NAME
sonar.projectKey=m3disim:morefem:1500_speedup_analysis
sonar.projectDescription=MoReFEM finite element library
sonar.projectVersion=0.9
sonar.language=c++
sonar.sources=Sources
sonar.exclusions=**/*.doxygen, **/*.cmake, **/CMakeLists.txt, Sources/ThirdParty/Source/**, **/ExpectedResult*/**, **/*.lua, **/Data/**, **/README*, **/Scripts/**, **/*.mesh, **/*.hhdata
sonar.cxx.includeDirectories=Sources,/usr/include,/usr/lib64/clang/8.0.0/include,/usr/include/c++/v1,/opt/Boost/include,/opt/Libmeshb/include,/opt/Lua/include,/opt/Openblas/include,/opt/Openmpi/include,/opt/Parmetis/include,/opt/Petsc/include,/opt/Xtensor/include,/opt/Tclap/include
sonar.cxx.includeDirectories=Sources,/usr/include,/usr/lib64/clang/8.0.0/include,/usr/include/c++/v1
sonar.sourceEncoding=UTF-8
sonar.cxx.errorRecoveryEnabled=true
sonar.cxx.compiler.charset=UTF-8
sonar.cxx.compiler.parser=clang
sonar.cxx.compiler.regex=^(.*):(\\\d+):\\\d+: warning: (.*)\\\[(.*)\\\]$
sonar.cxx.compiler.reportPath=build_4_sonarqube/morefem-build.log
sonar.cxx.clangsa.reportPath=build_4_sonarqube/analyzer_reports/*/*.plist
sonar.cxx.cppcheck.reportPath=morefem-cppcheck.xml
sonar.cxx.rats.reportPath=morefem-rats.xml
EOF
echo "sonar-project.properties file written."
# run sonar analysis + publish on sonarqube-dev
# run sonar analysis
STARTTIME=$(date +%s)
sonar-scanner -X >& sonar.log
ENDTIME=$(date +%s)
echo "Output written in sonar.log; analysis performed in $(($ENDTIME - $STARTTIME)) seconds."
# Left out in sonar.cxx.includeDirectories to be a tad more faster:
# /opt/Boost/include,/opt/Libmeshb/include,/opt/Lua/include,/opt/Openblas/include,/opt/Openmpi/include,/opt/Parmetis/include,/opt/Petsc/include,/opt/Xtensor/include,/opt/Tclap/include
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment