You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C++ has some static detection tools, I use the open source cppcheck to check the current code quality.It is not satisfactory, it will cause some performance loss,at least we have to be able to achieve effective c++ in some aspects.I'm already working and researching this,I will list a few rules,but I will follow the contribution guidelines #7, if you have no objections, please allow me to do this.@hsluoyz@xcaptain
C++ has some static detection tools, I use the open source cppcheck to check the current code quality.It is not satisfactory, it will cause some performance loss,at least we have to be able to achieve effective c++ in some aspects.I'm already working and researching this,I will list a few rules,but I will follow the contribution guidelines #7, if you have no objections, please allow me to do this.@hsluoyz @xcaptain
1.Class object has a constructor with 1 argument that should use Keyword:explicit.
2.Exception should be caught by reference.
https://stackoverflow.com/questions/2522299/c-catch-blocks-catch-exception-by-value-or-reference
3.Prefer prefix ++/-- operators for non-primitive types.
https://stackoverflow.com/questions/631506/does-pre-and-post-increment-decrement-operators-in-c-have-same-performance-in
4.Variable is assigned in constructor body. Consider performing initialization in initialization list.
https://stackoverflow.com/questions/9903248/initializing-fields-in-constructor-initializer-list-vs-constructor-body
5.Function parameter value should be passed by reference.
https://stackoverflow.com/questions/10231349/are-the-days-of-passing-const-stdstring-as-a-parameter-over
6.Applying size_type as a subscript when using string and vector or use the Keyword auto
https://stackoverflow.com/questions/1181079/stringsize-type-instead-of-int
7.The byte defined in the ip_parse folder has been implemented in the std library as std::byte, which is recommended to be written as Byte
8.Avoiding c-style type casting
https://stackoverflow.com/questions/3278441/c-type-casting
https://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-const-cast-and-reinterpret-cast-be-used/332086#332086
and so on...
There are some things not mentioned, I will continue to add, submit pr after the test
The text was updated successfully, but these errors were encountered: