code-analysis

C/C++ Free alternative to Lint?

I'm interested in a free tool that can statically check my C++ code like Lint does. Any hints? ...

Are there any tools that can determine perform code analysis for Big-O complexity?

I haven't seen anything out there, and I suspect the difficulty with defining "n" since for generally for analyzing a complex function there'd be more than just one or two variables for defining. There are analysis tools for cyclomatic complexity but are there ones for time (and/or space) complexity? If so which ones, if not, why not...

Find code that depends on .NET 3.5 SP1

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. ...

C# CA2104 - Automated Code Analysis dislikes static readonly mutable types

I've got a code like this: public abstract class Base { // is going to be used in deriving classes // let's assume foo is threadsafe protected static readonly Foo StaticFoo = new Foo(); } Visual Studio 2008's Code Analysis pops up this message: CA2104 : Microsoft.Security : Remove the read-only designation from 'Base.S...

Why doesn't the "Namespace Provider" property get saved within a project file for a given subdirectory?

Sub directories within VS2008 projects are mainly used to physically represent on disk the namespace structure for the project. Each folder has a Boolean property called “Namespace Provider”, which when set to True causes ReSharper to validate that the physical location of a given class corresponds to the logical namespace location. Occ...

Naming: Pricelist vs. PriceList

Which is more correct, "PriceList" or "Pricelist"? FxCop says: CA1702 : Microsoft.Naming : The compound word 'PriceList' in type name 'PriceList' exists as a discrete term. If your usage is intended to be single word, case it as 'Pricelist'. Edit: This is an object with Title, Start/End date etc. ...

Lint for C#

Is there a lint-like tool for C#? I've got the compiler to flag warnings-as-errors, and I've got Stylecop, but these only catch the most egregious errors. Are there any other must-have tools (especially for newbie C#ers like me) that point out probably-dumb things I'm doing? ...

What duplication detection threshold do you use?

We all agree that duplication is evil and should be avoid (Don't Repeat Yourself principle). To ensure that, static analysis code should be used like Simian (Multi Language) or Clone Detective (Visual Studio add-in) I just read Ayende's post about Kobe where he is saying that : 8.5% of Kobe is copy & pasted code. And that is with t...

Normalization of Strings With String.ToUpperInvariant()

I am currently storing normalized versions of strings in my SQL Server database in lower case. For example, in my Users table, I have a UserName and a LoweredUserName field. Depending on the context, I either use T-SQL's LOWER() function or C#'s String.ToLower() method to generate the lower case version of the user name to fill the Low...

Identifying the types of all variables in a C project

I am trying to write a program to check that some C source code conforms to a variable naming convention. In order to do this, I need to analyse the source code and identify the type of all the local and global variables. The end result will almost certainly be a python program, but the tool to analyse the code could either be a python...

C# Code Analysis dislikes protected static s_Foo (CA1709, CA1707)

I usually add an m_ in front of private fields and an s_ before static members. With a code like protected static readonly Random s_Random = new Random (); I get the following warnings by VS2008's Code Analysis: CA1709: Microsoft.Naming : Correct the casing of 's' in member name 'Bar.s_Random' by changing it to 'S'. CA1707: Microso...

C# Call Graph Generation Tool

I just got a heaping pile of (mostly undocumented) C# code and I'd like to visualize it's structure before I dive in and start refactoring. I've done this in the past (in other languages) with tools that generate call graphs. Can you recommend a good tool for facilitating the discovery of structure in C#? UPDATE In addition to the too...

What is your favourite tool for impact analysis

What is your favourite tool for impact analysis? Especially in the the context of web-applications where an IDE cannot always help you considering that your code references might be in at least 4 languages (java, jsp, velocity templates, javascript, html and the ominous xml). Thus far I've managed with find and grep are there any bette...

Looking for a tool to help me analyze and understand others' code

I am looking for a tool to help me to more quickly grasp someone else's code. Usually I am working with 10-15 method call chunks scattered across 3-5 modules (DLLs or .NET assemblies). What I am after is a tool which could be used to draw an annotated call diagram in 10-30 minutes. I think it should look like a some kind of combination...

Tool to determine what lowest version of Python required?

Is there something similar to Pylint, that will look at a Python script (or run it), and determine which version of Python each line (or function) requires? For example, theoretical usage: $ magic_tool <EOF with something: pass EOF 1: 'with' statement requires Python 2.6 or greater $ magic_tool <EOF class Something: @classmeth...

What's a good PL/SQL source code analysis tool?

What's a good PL/SQL source code analysis tool? ...

Oracle deadlock detection tool

I am looking for a static analyser of Oracle queries and PL/SQL procedures (triggers, constrains, ...) - a tool that will pass on our DB scheme and point to potential deadlocks. Just like FindBugs for Java. If such a tool does not exist, would you like to have it ? ...

statically analysing Lua code for potential errors

I'm using a closed-source application that loads Lua scripts and allows some customization through modifying these scripts. Unfortunately that application is not very good at generating useful log output (all I get is 'script failed') if something goes wrong in one of the Lua scripts. I realize that dynamic languages are pretty much res...

Analyzing Code for Efficiency?

What kinds of tools do you use to determine the efficiency of code? Do you use home grown applications that run a statistically significant number of tests, or some commercial product? Do you use your own knowledge to test certain areas of your code, or some tool that analyzes your code for weak spots? ...

Code Analysis tool for Delphi 4

I need a Code analysis tool that supports Delphi 4. I tried some of the following Tools: Code healer (Supports from Delphi 5) Pascal analyzer Could you please say which will be the best tool for analyzing Delphi 4 code files. ...