code-analysis

Resharper 5.0 slows down VS 2008 after license is added. Especially ASPX pages

I just purchased a license to ReSharper 5.0 and it has been almost impossible to edit ASPX pages. I read somewhere that I can disable code analysis on a single page with the following command "Ctrl+Shift+Alt+8". But it also hasn't worked. Is there a way to disable ReSharper Code Analysis on all ASPX pages? ...

Visual Studio Code Analysis Rule - "Do not expose generic lists"

Do not expose generic lists IF all my methods, need to expose a collection, then I need to user the Linq Extension .ToList(), almost everywhere I need to use lists, or user Collections in all my code. If that’s the case, .ToList() is ignoring the rule right? Or is there a technique like copying the list o something to fix the violation...

What is the best way to start breaking down an existing Application?

Currently, I have a project, where I have to add some features on to it, but the coding hasn't maintained any standards and it is extremely tough to break it down into manageable and understandable parts, to get started. And there is no documentation, to help out? How would you start such project, if you had to? ...

How to analyze a problem to match it with suitable design patterns?

Hi, I am wondering what should be the step by step analyzing approach to a well defined problem for figuring out the possible Design Patterns that can fit in the solution. Any guidance you can recommend? thanks ...

FxCop/StyleCop equivalent for ruby on rails?

Is there any static code analysis tools for ruby on rails? I am looking for something on the lines of "tests vs code analysis" as well as rules based analysis provided by FxCop. As an additional feature, an integration with hudson would be cool too. ...

Tools to detect duplicated code (Java)

I am in a project where previous programmers have been copy-pasting codes all over the place. These codes are actually identical (or very similar) and they could have been refactored into one. I have spent countless hours refactoring these codes manually but I think there must be a better way. Some are very trivial static methods that c...

CA2202 Warning from Code Analysis for OracleConnection disposal

We are getting the following warning from Code Analysis in Visual Studio 2010 and I'm wondering if this is a false positive that we can safely ignore or the code should be refactored to correctly dispose the object. The relevant code: public void MyFunction() { OracleConnection oraConnection = null; OracleCommand oraCommand = n...

Visual Studio only runs code analysis on common.cpp

I tried to enable Code Analysis in my Visual C++ 9 project. When I build the project Visual Studio only compiles common.cpp, emits a set of warnings and stops without proceeding to other .cpp files. How do I make Visual Studio analyze all the .cpp files? ...

Javascript code visualization

I want to visualize the code dependencies in my Javascript projects - is there a package out there that will do this? ...

Visual Studio add-in for C#-development

Hi there. I want to write my first Visual Studio 2010 add-in. My aim is to create an add-in that helps to automatically generate code for things like: implement superclass constructors create delegation methods for composed object etc. Of course, in order to know what to generate, my add-in must have a knowledge of the code-file the...

Question from bit twiddling site

Here is the code: unsigned int v; // word value to compute the parity of v ^= v >> 16; v ^= v >> 8; v ^= v >> 4; v &= 0xf; return (0x6996 >> v) & 1; It computes the parity of given word, v. What is the meaning of 0x6996? The number 0x6996 in binary is 110100110010110. ...

XCode's Build and Analyze - mistake or correct in finding Potential Leaks?

How reliable is Xcode's "Build and Analyze" ? I keep looking for the "potential leak" that it finds - but don't understand it. Here the code: -(void)viewDidLoad{ self.navigationItem.leftBarButtonItem = self.editButtonItem; UIBarButtonItem *aBI = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd ...

CA1500 vs. SA1309 - Which one wins?

I'll prefix by saying that I understand that both Code Analysis and StyleCop are meant as guidelines, and many people chose to ignore these anyway. But having said that, I'd like to see what the general consensus is with regard to these two rules. Rule CA1500 says don't make parameter names and private field names the same. Rule SA130...

Javascript code analysis and best practices

Are there any tools out there to help programmers that REALLY want type safety and the more stringent rules of a language like c# or java with javascript? For example, something that say analyzed source files and found things like undeclared variables or a js file of defined type objects like int or string? ...

Troubleshoot code analysis

I try running code analysis on my solution. It fails with a generic error message that doesn't give any information. What is the best way to troubleshoot this sort of thing? For example is there a log file? ...

PHP Static code Analysis - Finding Class Dependancies

Hi, I am about to start a large refactoring job on a big PHP project. I have successfully used pdepend to generate dependancy reports on the packages outlined in the PHPDoc blocks at the start of every file. The information is really usefull, it outlines dependancies between packages (which packages are used by which, cyclic dependanc...

How to configure VSTS2008 Code Analysis?

In VS2008 Team System how do I select some Code Analysis rules? The window is empty. When I build, there is the error: CA0053 : * Failed to load rules file '\rules': Unable to find the specified file. Obviously this means the rules file isn't found and that is the problem. What is the remedy? In other words, how do I use the pro...

SuppressMessage scope=type

Hi, how can I do suppress FxCop warnings for whole type? I have Hi guys, how to suppress warnings for all members in type namespace ConsoleApplication1 { public static class Serializer<T> { public static string Serialize(T obj) { return string.Empty; } public static T Deserialize...

Code Analysis warning CA2000: Call Dispose on object 'new ContainerControlledLifetimeManager()'

I'm getting a code analysis warning on some of my unit tests: WidgetManagerTests.cs (40): CA2000 : Microsoft.Reliability : In method 'WidgetManagerTests.TestInitialize()', call System.IDisposable.Dispose on object 'new ContainerControlledLifetimeManager()' before all references to it are out of scope. I'm using Unity ...

Which, if any, java code analyser?

Possible Duplicate: What static analyzers do you make a point of running on Java code, and why? This link has a few open source java code analysers. I was wondering if you used any of them and if so which ones would you recommend and why. ...