You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

fxCop

We use FxCop to check wether DelftShell sources follow correct coding standards such as

  • correct CapITalizaTION
  • exception throwing
  • naming

The reports are currently generated for core functionality only.

An fxcop report can be generated manually by running the fxcop project on Teamcity. To inspect the results we can use FxCopGraph and FxCopReport.

Common mistakes

Often I find people use System.Exception instead of a more specific one like ArgumentException or ReadOnlyException etc.
Assemblies are often missing the ClsCompliant attribute and SecurityPermission Attribute.

Example

[assembly: CLSCompliant(true)] //fxcop prerequisite
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)] //fxcop prerequisite

I found the following links on internet about coding standards while fixing some issues:
document on coding standards
Exception handling
FxCop, locale installatie

  • No labels