My Feeds

Recent Activities

How to get rid of the errors CA0055 and CA0052

Tuesday, September 06, 2011

During the last weeks some users were complaining about the error messages CA0055 and CA0052, which will be reported by the Power Tool, if an invalid target file is specified. The extension tries to obtain the assembly filename from the project file by using MSBuild property evaluation (it´s looking for the TargetPath-property). In some situations the property evaluation fails, if the OutputPath- and [...]

Small things, big impact (-:

Wednesday, August 24, 2011

Howdy! A new release is available. You can now open the Code Metrics Viewer from within the Solution Explorer; just right click the solution node, there you´ll find the “Code Metrics Viewer” menu item… The configuration of the Code Metrics Tool Path is now a bit easier… if you have successfully installed the Code Metrics [...]

Better feedback for the user about errors

Tuesday, July 12, 2011

Today, I improved the feedback for the user about errors happening on calculation. The tool reads now the standard error output of the Power Tool and displays error messages directly within the grid… For instance, the following error will be shown, if the Power Tool could not load or locate the assembly.

Is it possible to compare metric results?

Wednesday, July 06, 2011

Yes, it is! The latest version of the extension has basic comparison functionality. I thought this could be very helpful, if one would use the extension during code review and/or refactoring. When I used the tool during re-factoring, I had the problem that it was hard to see, if values were getting better or worser. So, I thought it would [...]

Calculated results can be kept for further analysis

Wednesday, July 06, 2011

In accordance to the test tools for Visual Studio Professional, the extension stores a compound report containing all calculated results of the solution in a folder named “MetricResults” below the solution directory. The output path can be changed in the “Reports” options page. The output path can either be a relative or an absolute path, but Visual Studio macro´s are not supported. The “Auto-Save”-feature is [...]

The /directory-option is now supported

Wednesday, July 06, 2011

If you have missed support for the /directory-option of the Power Tool, then the latest version (v1.3.7) might make you happy. Code Metrics Viewer allows you now to specifiy a directoy location, which can be used by the Power Tool to search for assembly dependencies. The option can be enabled per project; all you need to do is to [...]

How to interpret received metrics results?

Sunday, June 26, 2011

Okay; let´s face it… calculating numbers is one thing. Getting a feeling for what the numbers are telling us is another one. The power tool calculates five metrics; the maintainability index, cyclomatic complexity, depth of inheritance, class coupling and lines of code. But what do the numbers really mean? Well, I would say there is no unique answer [...]

How to get results for code behind XAML-files

Sunday, June 26, 2011

In June, a user reported a problem where he does not see any results for code behind XAML files. I dove into the problem and figured out that code behind XAML files was handled by the power tool like generated code, which I had disabled by default using the /igc switch. The latest version of the [...]

Where can I find the Code Metrics Viewer in Visual Studio?

Sunday, June 26, 2011

After you have installed the extension, the Code Metrics Viewer window is accesible via the “Other Windows” menu.

How can I calculate code metrics?

Sunday, June 26, 2011

After a solution was loaded and successfully build, it can be analyzed by pressing the “Analyze Solution” button. The Code Metrics Viewer will utilize the power tool to create the code metric report for each assembly in the solution. Depending on the solution size, this can take a while… The results will be shown in [...]

Code Metrics Viewer

Sunday, June 12, 2011

Am 26. Januar 2011 hat Microsoft das Code Metrics Power Tool 10.0 als kostenlosen Download  bereitgestellt. Es kann verwendet werden, um Code Metriken für verwaltete Assemblies zu berechnen – die Ergebnisse werden in einer XML Datei gespeichert. Bei dem Power Tool handelt es sich um eine Konsolenanwendung, die eine einfache Integration in einen Buildprozess ermöglicht; die Integration in Visual [...]

Meine erste Windows Phone 7 Anwendung…

Friday, February 11, 2011

Seit Anfang dieses Jahres beschäftige ich mich verstärkt mit der Windows Phone 7 Platform und Silverlight 4. Die Knaller-App-Idee hatte ich bislang noch nicht, dennoch habe ich versucht erste einfache Anwendungen für Windows Phone zu entwickeln und diese auch in den Marketplace zu bringen (ja, auch ich habe die 100 Euro dafür abgedrückt und werde [...]

Interprocess-Communication mit der WCF

Wednesday, May 19, 2010

Bisher habe ich die WCF ausschließlich dazu genutzt, SOAP-Dienste zu implementieren, die ich dann in einer IIS-Umgebung bereitgestellt habe. Letztendlich ist dies aber nur ein spezieller Zweck für den sich die WCF bestens eignet – genau genommen lässt sich die WCF nämlich generell einsetzen, wenn es darum geht seperate Systeme miteinander zu verbinden. Dies können beispielsweise auch [...]

Streaming in WCF-Dienst nutzen

Tuesday, May 11, 2010

Schon toll was die WCF alles so kann. In einem meiner aktuellen Projekte arbeite ich an einem WCF-Dienst. Dieser soll auch binäre Daten empfangen können. Also habe ich ganz pragmatisch folgenden Service-Contract implementiert…  Das ist funktional – aber nicht wirklich toll. Denn diese Art des Contract verhindert, das die Daten an den Server gestreamt werden [...]

ConfigurationElement.GetKey()

Wednesday, April 14, 2010

Wenn Sie eigene ConfigurationElementCollection-Ableitungen implementieren, müssen Sie die GetElementKey-Methode überschreiben, die einen Schlüssel liefert, über den das angegebene ConfigurationElement-Objekt aus der Auflistung abgerufen werden kann. Meistens entsteht dabei Code, der dem Folgenden Beispiel ähnlich sein könnte… Da ich in den meisten meiner Projekten stehts verschiedenste ConfigurationCollection-Klassen entstehen und ich Redundanzen gern vermeiden möchte, nutze ich [...]

NameValueConfigurationCollection.ToDictionary()

Wednesday, April 14, 2010

In einem vorangegangenem Post habe ich eine Extension vorgestellt, die eine ConfigurationElementCollection in ein IEnumerable<T> umwandelt. Darauf aufbauend stelle ich hier eine eine weitere Erweiterungsmethode vor, die eine NameValueConfigurationCollection in ein Dictionary umwandelt. Meine erste Implementierung erzeugt aus der NameValueConfigurationCollection ein Dictionary<string, string>, was mir am gebräuchlichsten erscheint. Denkbar ist allerdings auch eine Variante, die [...]

ConfigurationElementCollection.AsEnumerable

Wednesday, April 14, 2010

Haben Sie schon einmal versucht, Elemente einer ConfigurationElementCollection via LINQ abzufragen? Dann haben Sie sicher festgestellt, das dies nicht ohne Weiteres möglich ist, da die ConfigurationElementCollection-Klasse das IEnumerable<T>-Interface nicht implementiert. Zur Lösung des Problems kann die folgende Extension eingesetzt werden… Es folgt nun ein kurzes Beispiel zur Verwendung…

MemberInfo.GetAttribute

Thursday, April 08, 2010

Mit folgenden Extension-Methoden können Attribute eines Members abgerufen werden. So wird die GetAttribute-Methode verwendet…

LIB Viewer – .h-Dateien exportieren

Wednesday, April 07, 2010

Haben Sie sich schon einmal gefragt, welche Funktionen eine Bibliothek (.lib) exportiert? Manchmal beinhalten Bibliotheken versteckte Methoden, die in einer mitgelieferten Header-Datei nicht enthalten sind, oder Sie möchten einfach die Syntax der Funktionen in der Header-Datei mit der Bibliothek vergleichen. Ich habe dazu einen Artikel auf codeproject.com gefunden, das Projekt funktionierte für mich allerdings nicht [...]

Option Strict Off = Option Shit On

Wednesday, April 07, 2010

Visual Basic ermöglicht die Konvertierung vieler Datentypen in andere Datentypen – dabei bleibt allerdings die starke Typisierung auf der Strecke. In der Zusammenarbeit mit Entwicklern im Projekt, oder bei Trainings habe ich immer wieder festgestellt, dass dieses „tolle“ Feature, eher hinderlich als nützlich ist, da es negative Auswirkungen auf die Code-Qualität haben kann. Option Strict [...]