static-analysis

Header file inclusion static analysis tools?

*爱你&永不变心* 提交于 2019-11-27 18:33:08
A colleague recently revealed to me that a single source file of ours includes over 3,400 headers during compile time. We have over 1,000 translation units that get compiled in a build, resulting in a huge performance penalty over headers that surely aren't all used. Are there any static analysis tools that would be able to shed light on the trees in such a forest, specifically giving us the ability to decide which ones we should work on paring out? UPDATE Found some interesting information on the cost of including a header file (and the types of include guards to optimize its inclusion) here

Should I use the final modifier when declaring case classes?

丶灬走出姿态 提交于 2019-11-27 18:28:14
According to scala-wartremover static analysis tool I have to put "final" in front of every case classes I create: error message says "case classes must be final". According to scapegoat (another static analysis tool for Scala) instead I shouldn't (error message: "Redundant final modifier on case class") Who is right, and why? It is not redundant in the sense that using it does change things. As one would expect, you cannot extend a final case class, but you can extend a non-final one. Why does wartremover suggest that case classes should be final? Well, because extending them isn't really a

jenkins + sonar + github integration

限于喜欢 提交于 2019-11-27 17:53:24
Problem: I am setting up jenkins + sonar + github integration for automatic pullrequest static code check through sonar. My Configuration: Installed Sonar with github Installed jenkins In jenkins post-build action I have the following properties -Dsonar.github.login=bhuwang -Dsonar.github.repository=company/repo -Dsonar.verbose=true -Dsonar.analysis.mode=preview -Dsonar.issuesReport.console.enable=true -Dsonar.forceUpdate=true -Dsonar.github.login=gitusername -Dsonar.github.oauth=token Token was generated from my github account. In this link I have read that I have to provide the following

Stack Size Estimation

落花浮王杯 提交于 2019-11-27 17:51:37
In multi-threaded embedded software (written in C or C++), a thread must be given enough stack space in order to allow it to complete its operations without overflowing. Correct sizing of the stack is critical in some real-time embedded environments, because (at least in some systems I've worked with), the operating system will NOT detect this for you. Usually, the stack size for a new thread (other than the main thread) is designated at the time that thread is created (i.e. in an argument to pthread_create() or the like). Often, these stack sizes are hard-coded to values that are known to be

Ruby source code analyzer (something like pylint)

你说的曾经没有我的故事 提交于 2019-11-27 17:28:14
Does Ruby have any tools along the lines of pylint for analyzing source code for errors and simple coding standards? It would be nice if it could be integrated with cruisecontrolrb for continuous integration. Or does everyone write such good tests that they don't need source code checkers! danmayer I reviewed a bunch of Ruby tools that are available here http://devver.wordpress.com/2008/10/03/ruby-tools-roundup/ most of the tools were mentioned by webmat, but if you want more information I go pretty in depth with examples. I also highly recommend using Metric-Fu it gives you a on gem/plugin

How to test binary compatibility automatically?

那年仲夏 提交于 2019-11-27 14:49:40
问题 Can it be done before compiling, by comparing code? Is there any tools already doing this? 回答1: You might find this interesting: Static analysis tool to detect ABI breaks in C++ 回答2: ABI Compliance Checker — a tool for checking backward API/ABI compatibility of a C/C++ library: abi-compliance-checker -lib NAME -old OLD.abidump -new NEW.abidump *.abidump files are ABI dumps of OLD and NEW library versions generated by the ABI Dumper tool. icheck - C interface ABI/API checker: icheck --canonify

Dead code identification (C++)

与世无争的帅哥 提交于 2019-11-27 11:45:51
I have a large legacy C++ project compiled under Visual Studio 2008. I know there is a reasonably amount of 'dead' code that is not accessed anywhere -- methods that are not called, whole classes that are not used. I'm looking for a tool that will identify this by static analysis . This question: Dead code detection in legacy C/C++ project suggests using code coverage tools. This isn't an option as the test coverage just isn't high enough. It also mentions a -Wunreachable-code. option to gcc. I'd like something similar for Visual Studio. We already use the linker's /OPT:REF option to remove

Static analysis tool to detect ABI breaks in C++

南楼画角 提交于 2019-11-27 11:42:04
It's not very hard to break binary backwards-compatibility of a DSO/shared library with a C++ interface. That said, is there a static analysis tool, which can help detecting such ABI breaks, if it's given two different sets of header files: those of an earlier state of the DSO and those of the current state (and maybe DSOs as well)? Both free and commercial product suggestions are welcome. If it could also warn about bad practices, e.g. inline functions and defaulted function parameters in DSO interfaces, it would be great. Artyom I assume that you are familiar with this tutorial: Binary

Are there any static code analysis tools for Delphi/Pascal? [closed]

对着背影说爱祢 提交于 2019-11-27 11:28:07
Are there any static code analysis tools for Delphi/Pascal? I have seen plenty of options for C++ and .NET, but nothing for Delphi/Pascal. Ideally something that could be integrated into a continuous integration system. Rauhotz Pascal Analyzer is nice. If you want something that will give you various software metrics (complexity etc.) for your code then I strongly recommend SourceMonitor from Campswood Software . It works for C and C++ too, and it's free. The Architect version of Delphi has a very powerful Audits and Metrics feature that does a complete analysis of your code. The feature

Static Actionscript code analysis possibilities

青春壹個敷衍的年華 提交于 2019-11-27 11:07:28
I want to see class, function and variable/property, dependencies visually, like NDepend , but for ActionScript 2 or AS3 code. Any programs or ideas? Use doxygen in some way? FlexUnit? Kevin Boyd Update Nov 2018: It would appear that Structure101 ( new download page ) no longer has an ActionScript variant. Original answer, links outdated: Download Structure101g and select the Actionscript flavor after installing the software. I've confirmed that it is able to map out class level and even function call dependencies in Flex/AS3 projects, and generate a visual map of the same. Take a look at the