static-analysis

Tools for finding Shared Mutable data bugs in Java

混江龙づ霸主 提交于 2019-12-03 09:03:02
问题 I have a large legacy system to maintain. The codebase uses threads all over the place and those threads share a lot of mutable data. I know, sounds bad. Anyway, don't answer "rewrite the whole application from scratch" or I'll vote you down :-) I have tried to run some static analysis tools on the codebase, but none of those seem to catch this case which occurs a lot in our source code: multiple threads are reading and writing variables which are not marked as volatile or synchronized at all

Static call graph generation for the Linux kernel

夙愿已清 提交于 2019-12-03 08:56:11
问题 I'm looking for a tool to statically generate a call graph of the Linux kernel (for a given kernel configuration). The generated call graph should be "complete", in the sense that all calls are included, including potential indirect ones which we can assume are only done through the use of function pointers in the case of the Linux kernel. For instance, this could be done by analyzing the function pointer types: this approach would lead to superfluous edges in the graph, but that's ok for me.

Tool to find all unused Code

≯℡__Kan透↙ 提交于 2019-12-03 08:40:03
问题 I need a tool I can run that will show me a list of unused methods, variables, properties, and classes. CSS classes would be an added bonus. I heard FXCop can do this? or NDepend or something? 回答1: Look at ReSharper. 回答2: Code Analysis in VSTS will generate warnings about this during the build process. You can set it up to treat Warnings As Errors. 回答3: You can use ReSharper to find unused code and Dust-Me Selectors to find unused CSS. 回答4: The tool NDepend can help find unused code in a .NET

phploc output explanation

試著忘記壹切 提交于 2019-12-03 07:53:37
If I run phploc against one of my PHP project (open source) I see this output. phploc 1.6.4 by Sebastian Bergmann. Directories: 3 Files: 33 Lines of Code (LOC): 2358 Cyclomatic Complexity / Lines of Code: 0.08 Comment Lines of Code (CLOC): 903 Non-Comment Lines of Code (NCLOC): 1455 Namespaces: 0 Interfaces: 3 Classes: 28 Abstract: 1 (3.57%) Concrete: 27 (96.43%) Average Class Length (NCLOC): 49 Methods: 149 Scope: Non-Static: 128 (85.91%) Static: 21 (14.09%) Visibility: Public: 103 (69.13%) Non-Public: 46 (30.87%) Average Method Length (NCLOC): 9 Cyclomatic Complexity / Number of Methods: 1

which free tools can I use to generate the program dependence graph for c codes

混江龙づ霸主 提交于 2019-12-03 07:04:33
问题 I want to generate a Program Dependence Graph (PDG) from C source code. I found papers that explain how do it, but all used the commercial CodeSurfer tool. Are there any free tools or open source projects that can do this job? 回答1: Frama-C is an Open Source static analysis platform with a slicer for C programs based on the computation of a Program Dependence Graph. Note that slicing actual programs written in a real programming language such as C involves many special cases and concepts that

Dependencies analysis tool - updating regression test cases

岁酱吖の 提交于 2019-12-03 07:01:11
问题 Problem Its quite a common problem I would like to think. Adding new code translates into regression - existing test cases become obsolete. Dependencies within the code mean even if you know how to fix this particular regression, there could be indirect regression at n more places in both directions - Afferent and Efferent. Requirement I have a shop running SVN, Maven+Nexus,Sonar,Jenkins and JIRA,QC,QTP. All in all a good CI environment. With every new build I'll have new cases of regression.

Lint-checking tools for Objective-C development [closed]

社会主义新天地 提交于 2019-12-03 06:08:13
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Large projects with multiple developers often result in code that is inconsistent in style. I am looking for a lint -like tool tailored to Objective-C that goes beyond the scope of the Clang Static Analyser and checks for adherence to stylistic conventions; e.g. braces, indentation, comment formatting, declaring variables at the top of functions and so on. I am aware of AnalysisTool , but it doesn't quite do what I'm

Closed type classes

寵の児 提交于 2019-12-03 05:54:46
Is it possible to create a typeclass that can no longer admit new members (perhaps by using module boundaries)? I can refuse to export a function necessary for a complete instance definition, but that only results in a runtime error if someone produces an invalid instance. Can I make it a compile time error? I believe the answer is a qualified yes, depending on what you're trying to achieve. You can refrain from exporting the type class name itself from your interface module 1 , while still exporting the names of the type class functions. Then no one can make an instance of the class because

Any tools to check for duplicate VB.NET code?

陌路散爱 提交于 2019-12-03 05:43:34
I wish to get a quick feeling for how much “copy and paste” coding we have, there are many tools for C# / Java to check for this type of thing. Are there any such tools that work well with VB.NET? (I have seen what looks like lots of repeated code, but wish to get some number to help me make a case for sorting it out) Update on progress. I have just tried Simian. It does not seem to be able to produce a nicely formatted report I can sent by email It does not cope when the names of local variables, or parameters etc may have been changed, e.g it just matches on lines of text being the same.

How to find unclosed I/O resources in Java?

自闭症网瘾萝莉.ら 提交于 2019-12-03 05:15:18
Many I/O resources in Java such as InputStream and OutputStream need to be closed when they are finished with, as discussed here . How can I search my project for places where such resources are not being closed, e.g. this kind of error: private void readFile(File file) throws IOException { InputStream in = new FileInputStream(file); int nextByte = in.read(); while (nextByte != -1) { // Do something with the byte here // ... // Read the next byte nextByte = in.read(); } // Oops! Not closing the InputStream } I've tried some static analysis tools such as PMD and FindBugs, but they don't flag