12

Does anyone know of an equivalent to FxCop/StyleCop for Delphi? I would really like to get the automatic checking of style, etc. into Continuous Integration.

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
mmmm
  • 2,431
  • 2
  • 35
  • 56
  • 2
    similar question: http://stackoverflow.com/questions/532986/are-there-any-static-code-analysis-tools-for-delphi-pascal – mjn May 27 '11 at 16:25

8 Answers8

12

There's Pascal Analyzer from Peganza: http://www.peganza.com/products_pal.htm

I don't know how the features compare to FxCop, since I haven't really used either one.

Harriv
  • 6,029
  • 6
  • 44
  • 76
11

The closest I've seen is CodeHealer from SOCK software. We use it, and we have integrated it into our FinalBuilder build. It differs from FxCop in one important way: It analyzes the source code, rather than the produced executable. It also doesn't check quite as much as FxCop does. But I think it is the best thing which is available in this category for Delphi.

Delphi 2009 support isn't there just yet, but they say they're working on it.

Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273
  • 1
    I've just tried CodeHealer, and whilst it looks OK, it doesn't support D2009, so this is a non-starter at the moment unfortunately – mmmm May 04 '09 at 14:00
  • Codehealer 2.6 (released 2009-10-20) includes support for Delphi 2009 and 2010 according to their web site – mjn Sep 24 '10 at 16:19
  • @mjustin Just in time for Delphi XE :) – Craig Stuntz Sep 24 '10 at 16:36
  • **CodeHealer 2.8 for Delphi XE1 now in beta testing** - according to the Code Healer Group Home Page :) – mjn May 27 '11 at 16:22
2

Delphi Code Analyzer is another one that is open source.

YWE
  • 2,849
  • 28
  • 42
1

There is a new Delphi plugin for Sonar, which uses a Delphi grammar to run automatic tests over the source code.

mjn
  • 36,362
  • 28
  • 176
  • 378
1

The DGrok project started with something like FxCop some years ago. The parser and analysis parts are still available, read more at "DGrok 0.8.1: multithreading, default options, GPL" - The parser is a .Net project but

DGrok is a set of tools for parsing Delphi source code and telling you stuff about it. Read more about it on the DGrok project page.

mjn
  • 36,362
  • 28
  • 176
  • 378
0

I've heard of something called Delforex but haven't used it myself (yet)

Stijn Sanders
  • 35,982
  • 11
  • 45
  • 67
0

Delforex is great for actually formatting the code. It does not do much more than that though. (we have/do use it).

I would second the votes for either Pascal Analyzer or Code Healer.

Vaccano

Vaccano
  • 78,325
  • 149
  • 468
  • 850
0

Doesn't Delphi output .net compatible IL code? I haven't used it in an age but I thought newer versions output .net assemblies.

If so then I would have thought FXcop would work and you could always add some of your own custom rules to it. Stylecop would not work but you could at least get FXCop running.

Tollo
  • 505
  • 4
  • 14