static-analysis

Tool to detect missing disposes

落爺英雄遲暮 提交于 2019-12-08 01:01:40
问题 im searching for any tool that can detect any missing dispose calls on classes that do data access and file operations. And if it checks another performance issues it will be nice. BTW, i need to run the tool over the code, not on the execution. Thanks! 回答1: DevExpress CodeRush does this for you: see this article: Code Issues – Undisposed local Code Rush home: DevExpress CodeRush I have used the express version of this tool and personally I like it more than ReSharper. 回答2: The open-source

Find code that depends on .NET 3.5 SP1

白昼怎懂夜的黑 提交于 2019-12-07 19:01:35
问题 Is there a way to run some sort of code analysis to find code which will compile with .NET 3.5 SP1 but not 3.5 RTM? FxCop works for assemblies introduced with SP1, but for code that simply calls new methods and properties it does not detect that usage. 回答1: Sure, you can highlight this stuff with fxcop or VS team system. Make sure you have a read this answer. There is a bug with the current rules that ship with fxcop, so you need to do a bit of hand holding to get it to work. 来源: https:/

How can I count number of times an overloaded operator was used in a code base with particular type of operands

柔情痞子 提交于 2019-12-07 18:16:52
问题 I have a templated class SafeInt<T> (By Microsoft). This class in theory can be used in place of a POD integer type and can detect any integer overflows during arithmetic operations. For this class I wrote some custom templatized overloaded arithmetic operator (+, -, *, /) functions whose both arguments are objects of SafeInt<T> . I typedef'd all my integer types to SafeInt class type. I want to search my codebase for instances of the said binary operators where both operands are of type

clang-tidy cmake exclude file from check

▼魔方 西西 提交于 2019-12-07 12:03:26
问题 I have a dependency as source in my project that I have no control over. I'm using cmake's clang-tidy integration to analyze my code, and this dependency is firing A LOT of warnings. Is there a way to tell cmake not to run clang-tidy on specific files ? I tried to add the files to the -line-filter option of clang-tidy, but this doesn't work: set_target_properties(target PROPERTIES CXX_CLANG_TIDY "${clang_tidy_loc};\ ${TIDY_CONFIG} \ -line-filter=\"[\ {\"name\":\"path/to/file.cpp\"},\ {\"name\

Is there a good Eclipse plugin for checking @Nonnull and @Nullable annotations?

百般思念 提交于 2019-12-07 09:58:42
问题 The checking of the @Nonnull and @Nullable annotations in Eclipse is an early beta. The largest problem is that there it no knowing over the null behavior of the Java API. Are there any other plugins that are better currently? 回答1: It's now integrated in Eclipse Kepler. 回答2: I have found that FindBugs works well and is easy to use. FindBugs Plugin 回答3: Get Eclipse SDK 3.7(or Indigo) Enter this update URL: http://download.eclipse.org/objectteams/updates/contrib Select and install : JDT Null

Class dependency graph with doxygen

≡放荡痞女 提交于 2019-12-07 06:31:48
问题 I want to generate a class dependency graph for a large project in C++. I'm trying to do it with doxygen. Here is the sample code: class Used { public: void bar(); }; class Base { }; class Derived : public Base { public: void foo(Used*); // Dependency on class Used }; Here is the collaboration diagram generated by doxygen: Nice, but Derived depends on Used through the method foo , and I want to see this on the diagram, like this: Unfortunately, doxygen generates such dependency only if Used

How to check entire rails project for compilation errors

随声附和 提交于 2019-12-07 00:45:31
问题 I am new to ruby and rails. I am used to working in IDEs (Xcode, Visual Studio, etc.) where I can perform project-wide/workspace-wide "build/compile" operations. Let's say that I modify a number of ruby files in my rails project. I haven't yet written tests that will exercise all of my changes. Is there a way to ensure that all of my *.rb files compile without directly exercising them at runtime? I'd really just like to perform a "compile all of my ruby/erb files" operation so that I know

Find code that depends on .NET 3.5 SP1

孤街浪徒 提交于 2019-12-06 13:36:27
Is there a way to run some sort of code analysis to find code which will compile with .NET 3.5 SP1 but not 3.5 RTM? FxCop works for assemblies introduced with SP1, but for code that simply calls new methods and properties it does not detect that usage. Sam Saffron Sure, you can highlight this stuff with fxcop or VS team system. Make sure you have a read this answer . There is a bug with the current rules that ship with fxcop, so you need to do a bit of hand holding to get it to work. 来源: https://stackoverflow.com/questions/640057/find-code-that-depends-on-net-3-5-sp1

what's the meaning of the circle node in pdgs which is generated by frama-c

佐手、 提交于 2019-12-06 11:51:51
I use frama-c tool to analyse the code below. int main (int argc, char *argv[]) { int i,a; for (i = 0; i < 100; i += 1) { a=0; if (a==0) { continue; } else { break; } } return 0; } the cmd is frama-c -pdg -dot-pdg graph main.c My question is about the control dependence. what's the circle node means? I try to explain the "while" node, maybe it stand for one time loop , because a loop start from "i<100",so there a control dependence ("i<100" ------o "while" ). Is what I guess right ? but what is the "break" node mean? I guess that node "goto __Cont;" is related to the "break;" statement in the

Any tips for speeding up static analysis tool PC-Lint? Any experiences using .LOB files?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 10:11:51
I'm interested in learning the main factors which affect PC-lint-ing time. I'm aware of a few such as -passes(#) which will increase the time PC-Lint takes (increase linearly?) or that reducing the messages which are output does not affect the linting time. I'm hoping to verify my understanding of lint's performance by having one of you who is more experienced with lint list the main factors they've encountered that affect linting time. Also, do any of you have experience using .lob files with PC-Lint. How much would you say it affected linting time? The main speedup I got was when I started