static-analysis

Ruby source code analyzer (something like pylint)

别来无恙 提交于 2019-11-26 18:59:46
问题 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! 回答1: 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

How to raise warning if return value is disregarded?

这一生的挚爱 提交于 2019-11-26 18:41:33
I'd like to see all the places in my code (C++) which disregard return value of a function. How can I do it - with gcc or static code analysis tool? Bad code example: int f(int z) { return z + (z*2) + z/3 + z*z + 23; } int main() { int i = 7; f(i); ///// <<----- here I disregard the return value return 1; } Please note that: it should work even if the function and its use are in different files free static check tool You want GCC's warn_unused_result attribute: #define WARN_UNUSED __attribute__((warn_unused_result)) int WARN_UNUSED f(int z) { return z + (z*2) + z/3 + z*z + 23; } int main() {

Static Actionscript code analysis possibilities

*爱你&永不变心* 提交于 2019-11-26 17:59:15
问题 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? 回答1: 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

Header file inclusion static analysis tools?

妖精的绣舞 提交于 2019-11-26 15:47:39
问题 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

Dead code identification (C++)

亡梦爱人 提交于 2019-11-26 15:44:38
问题 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.

Static analysis tool to detect ABI breaks in C++

徘徊边缘 提交于 2019-11-26 15:41:43
问题 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

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

好久不见. 提交于 2019-11-26 15:35:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . 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. 回答1: Pascal Analyzer is nice. 回答2: If you want something that will give you various software

Is there a static analysis tool like Lint or Perl::Critic for shell scripts?

自作多情 提交于 2019-11-26 15:23:48
问题 Are there any shell (specifically bash or ksh) checkers that test shell scripts for style, best practices, naming conventions, etc? (Something like Lint for C, or Perl::Critic for Perl.) I know with ksh you can do syntax checking by running ksh -n script.ksh but I was hoping for something more than just sytax checking - something that parses/analyzes the actual code? I'm probably out of luck, but I guess it doesn't hurt to ask. 回答1: The Debian and Ubuntu projects use a script checkbashisms,

How to determine maximum stack usage in embedded system with gcc?

穿精又带淫゛_ 提交于 2019-11-26 15:20:53
问题 I'm writing the startup code for an embedded system -- the code that loads the initial stack pointer before jumping to the main() function -- and I need to tell it how many bytes of stack my application will use (or some larger, conservative estimate). I've been told the gcc compiler now has a -fstack-usage option and -fcallgraph-info option that can somehow be used to statically calculates the exact "Maximum Stack Usage" for me. ( "Compile-time stack requirements analysis with GCC" by

Are there any JavaScript static analysis tools? [closed]

纵饮孤独 提交于 2019-11-26 14:59:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm used to having my compiler complain when I do something stupid like a typo on a variable name but JavaScript has a habit of letting this pass. Are there any static analysis tools for JavaScript? 回答1: I agree that JSLint is the best place to start. Note that JavaScript Lint is distinct from JSLint. I’d also