code-analysis

Tool to visualise code flow (C/C++)

Do you have any sugestions of tools to ease the task of understanding C/C++ code? We just inherited a large piece of software written by others and we need to quickly get up to speed on it. Any advice on tools that might simplify this task? ...

Tool to visualize code flow in Java?

I'm inspired by the C/C++ question for a code flow visualization tool. Is there such a thing for Java servlets or applications? ...

Understanding code metrics.

I recently installed the Eclipse Metrics Plugin and have exported the data for one of our projects. It's all very good having these nice graphs but I'd really like to understand more in depth what they all mean. The definitions of the metrics only go so far to telling you what it really means. Does anyone know of any good resources, bo...

Perl Challenge - Directory Iterator

You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem. Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation. So an example Perl problem: A simple script which recursively iterates through a directory structur...

How did you choose your Visual Studio productivity addon?

I'm evaluating Visual Studio productivity addons for my development team, which includes some folks who are very new to C# and some folks who are very experienced. We don't use VB.NET. I personally like ReSharper, but before I suggest something that I personally like, I would like some opinions for and reasoning behind using a different ...

What's is a good ratio of Class to Lines of Code for Object-Oriented languages?

What's is a good ratio for the number Classes to Lines of Code for an Object-Oriented language (say C++,C#,Java and their likes)? Many people, including managers, like the traditional LOC (lines of code) metric to measure the complexity of software, while many hard-boiled Object Oriented developers will say LOC is worthless its Class co...

What are the basic minimum set of Code Analysis rules that you would recommend?

What are the basic minimum set of Code Analysis rules that you would recommend for a 200K LOC solution? We're using unit testing but code analysis has been turned off. Ideally all rules would be turned on by default but I'd like to do this gently and turn on rules in batches so we do not have to deal with everything at once. So, what r...

checkstyle + suppression filters

I have a checkstyle suppression filter setup (e.g. ignore magic numbers in unit test code). The suppression xml file resides in the same folder as the checkstyle xml file. However, where this file actually is varies: on my windows dev box it is in d:\dev\shared\checkstyle\config on the Linux CI server it will be in /root/repo/shared/che...

Code Coverage Analysis for Embedded C++ projects

I have recently started working on a very large C++ project that, after completing 90% of the implementation, has determined that they need to demonstrate 100% branch coverage during testing. The project is hosted on an embedded platform (Green Hills Integrity). I'm looking for suggestions and experiences from others on StackOverflow t...

Can you configure VS2008 Code Analysis to use a British English Dictionary?

VS2008 Code Analysis will flag a spelling mistake in an identifier using the IdentifiersShouldBeSpelledCorrectly warning type. This process is using an American dictionary by default because words are being flagged that are correctly spelt using the British spelling. For example, words like "Organisation" and "Customisation", etc... I ...

Which rule from FxCop do you deactivate?

I personally don't use FxCop yet. We want to work out the unit testing first before going with code analysis. However, which rules would you permanantly deactivate? Which rules would you deactivate temporarily and in which situation? ...

Collection<T> versus List<T> what should you use on your interfaces?

The code looks like below: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Test { public interface IMyClass { List<IMyClass> GetList(); } public class MyClass : IMyClass { public List<IMyClass> GetList() { return new List<IMyClass>(); } ...

Sharing Code Analysis Rules in MSBuild

I am trying my hardest to define a list of CodeAnalysisRules that should be omitted from the Code Analysis tools when MSBuild executes my TFSBuild.proj file. But each time I test it, my list of Code Analysis Rules to exclude are ignored and Team Build just simply honors the Code Analysis Rules settings for each project. Anyone have an ...

Finding all methods that handle form events using NDepend

Hi all, I was wondering if someone would be able to help me write a CQL query for NDepend that will show me all the methods in my form class that handle the form events. So I would like to be able to find all the methods that look like this: Private Sub AddFolderButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) ...

Alternative to StyleCop for Visual Studio?

I like StyleCop's static code analysis and rules enforcement. However, it is severely lacking in several key departments. Adding new rules isn't officially supported and from what I hear pretty difficult. Automatic "fixing" of trivial rules violations would be nice! Perhaps not with variable naming but with method ordering (static,...

Ndepend and other automatic code analyser revelence?

Since yesterday, I am analyzing one of our project with Ndepend (free for most of its features) and more I am using it, and more I have doubt about the real value of this type of software (code-analysis software). Let me explain, The system build a report about the health of the system and class by Rank every metric. I thought it would ...

Is it possible for the findbugs plugin for eclipse to report as errors instead of warnings?

I am working on a very large legacy code base. We are looking to introduce findbugs into the development practice. I intend to have findbugs run whenever the code is built by eclipse. I would like to be able to make the findbugs warnings appear as errors in the code much in this way you can change the severity level in eclipse Is it ...

Erlang - code analysis

I have to analyse some existing Erlang code. Does anybody knows about a tool able to visually / graphically trace the modules calls ? The behaviour should be : give a directory containing the source code, and get a gui / picture / file of the calls (module1->module2->module3....). Something like an UML reverse-engineering, but ala Erl...

JavaScript Source Code Analyzer

Does anyone know of a good, extensible source code analyzer that examines JavaScript files? ...

VS2005 Code Analysis: CA1063 (call dispose(true) and supress finalize) - with logging.

I'm trying to adhere to the VS2005 code analysis rules for a new project. I have this method: public void Dispose() { Console.WriteLine("Dispose() called"); Dispose( true ); GC.SuppressFinalize(this); } (The console call will become a log4net call at some point, and we're always interested in logging dispose for some of o...