crocs-muni / eacirc

Automatic problem solver based on circuit-like representation and genetic programming
13 stars 8 forks source link

Static code analysis via clang-tidy #200

Closed xtracko closed 6 years ago

xtracko commented 7 years ago

Analyse our code using clang-tidy, a static code analysis tool.

Bender250 commented 7 years ago

Clang-tidy is not part of Fedora repositories. It can still be obtained as a binary.

https://unix.stackexchange.com/questions/278292/clang-tidy-install

http://releases.llvm.org/3.9.0/clang+llvm-3.9.0-x86_64-fedora23.tar.xz

Bender250 commented 7 years ago

BTW, cppcheck is still relevant. It found unused variables, possibility to reduce scope of variables and parameters that should be passed by reference even in core ;).

Can you take a look on this @xtracko in April?

xtracko commented 7 years ago

BTW, cppcheck is still relevant. It found unused variables, possibility to reduce scope of variables and parameters that should be passed by reference even in core ;).

I don't know how to properly run cppcheck, nonetheless I ran cppcheck --enable=all on al files from folders core, eacirc, and solvers and I found few issues, but nothing significant.

Bender250 commented 7 years ago

If you ran cppcheck --enable=all then it is enough. And yes, those proposals are not significant, but some can be incorporated.

Therefore it would be nice do it together with clang-tidy check. But I agree with Petr about low priority label, this is nice to have, not something, we should solve now...

Bender250 commented 6 years ago

Clang static analysis found no real issue. It detects multiple redundant variables and initializations in cryptoprimitives' code, yet we do not want to change the functions. None of the found issues are in our modifications, or in base code (I checked only eacirc-streams).