gluster / gluster-block

A framework for gluster block storage
GNU General Public License v2.0
74 stars 32 forks source link

[WIP] Let Travis CI run scan build for each PR #275

Closed pkalever closed 3 years ago

pkalever commented 4 years ago

What does this PR achieve? Why do we need it?

clang static analyzer is a source code analysis tool that                         
finds bugs in C, C++.                                                             

This patch automates clang analyzes part by integrating                           
it with 'make clang-check'                                                        

clang-checker.sh: runs clang analyzer with and without the                        
HEAD commit, and shows the bugs introduced by HEAD commit (if any)                

sample report:                                                                    

$[ gluster-block ]: make clang-check                                              

================ Clang analyzer in progress ================                      
...                                                                               

BASELINE BUGS LIST (before applying patch):                                       
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       
Dead assignment --> 4                                                             
All Bugs --> 12                                                                   
Dereference of null pointer --> 8                                                 

TARGET BUGS LIST (after applying patch):                                          
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                          
Dead assignment --> 4                                                             
All Bugs --> 13                                                                   
Dereference of null pointer --> 9                                                 

SUMMARY OF CLANG-ANALYZER:                                                        
~~~~~~~~~~~~~~~~~~~~~~~~~~                                                        

Patch Value given by Clang analyzer '-1'                                          

Explore complete results at:                                                      
/home/user/gluster-block/baseline/results/rpc/2020-05-14-123417-12345-1/index.html
/home/user/gluster-block/target/results/rpc/2020-05-14-123632-19247-1/index.html  

================= Done with Clang Analysis =================                      

And we run these scan-build via Travis CI and get the score.

Notes for the reviewer

This is a WIP as of now.

pkalever commented 3 years ago

I no longer consider this to be adding any value, as the project is in maintenance now.