发布于 2016-08-25 10:20:11 | 48 次阅读 | 评论: 0 | 来源: 网友投递
SonarQube代码质量管理平台
Sonar是一个用于代码质量管理的开源平台,用于管理源代码的质量,可以从七个维度检测代码质量通过插件形式,可以支持包括java,C#,C/C++,PL/SQL,Cobol,JavaScrip,Groovy等等二十几种编程语言的代码质量管理与检测
SonarQube C/C++/Objective C 4.1 发布了,本次发布更新如下:
Comparison operators should not be virtual (C++, Code Smell, pitfall)
Declaration specifiers should not be redundant (C++, C, Objective-C, Bug, redundant)
Example of an issue found in the Samba source code:
Exceptions should not be ignored (C++, Objective-C, Bug, cwe, error-handling, suspicious)
Example of an issue found in the MongoDB source code:
Generic exceptions should never be thrown (C++, Bug, cert, cwe, error-handling)
Generic exceptions should not be caught (C++, Bug, cert, cwe, error-handling)
Non-exception types should not be caught (C++, Code Smell, error-handling)
Non-exception types should not be thrown (C++, Bug, error-handling, misra)
Partial specialization syntax should not be used for function templates (C++, Code Smell, lock-in)
Pure “virtual” functions should not override non-pure “virtual” functions (C++, Code Smell, misra, pitfall)
Example of an issue found in the Clang source code:
Indeed here is the inheritance hierarchy :
class ASTConsumer { public: virtual void Initialize(ASTContext &Context) {} };
class RewriteObjC : public ASTConsumer { public: void Initialize(ASTContext &context) override = 0; };
class RewriteObjCFragileABI : public RewriteObjC { public: virtual void Initialize(ASTContext &context); };
And so the function body of RewriteObjCFragileABI::Initialize(...)
don’t start by callingRewriteObjC::Initialize(...)
, because it’s a pure virtual function that can’t be called, and don’t either call ASTConsumer::Initialize(...)
because it’s unexpected to have a pure virtual function that override one with an implementation. So now, with this design, if some initialization code is added in ASTConsumer::Initialize(...)
it will not be called from RewriteObjCFragileABI
object.
String literals should not be immediately followed by macros (C++, Code Smell, cpp11, lock-in)
了解更多信息,查看发布说明:
https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10090&version=13324
http://www.sonarsource.com/2016/08/25/sonarqube-ccobjective-c-4-1-released/
下载: