As I described
here I got problems with the Code Statistics Plugin and a project importet from Microsoft Visual Studio .NET 2003 on Linux.
Seems as I now discovered the problem. It is not really a problem of the Code Statistics plugin (although the issue I described in the bug report could be solved there) but the problem lies in the Code::Blocks SDK. The problematic class is 'ProjectFile' and especially its member 'file', which is from type 'wxFileName'. This class uses different path formats for the filenames and the format defaults to the format which is used on the specific plattform, that means it will allow '/' als path delimiter on linux/etc. and '/' and '\\' on Windows. That means: If the filename contains a '\\' on Linux (which is the case for all filenames of the project I imported and even for all filenames of Code::Blocks, thus the plugin didn't even work with the Code::Blocks sources.) wxFileName::FileExists will return false even if the file exists. Therefore the Code Statistics plugin will ignore all files and then produce this silly output.
As a consequence the problem with the plugin can be easily solved if the wxFileName instance in the plugin uses wxPATH_DOS as format. I wrote a patch with this change and it seems to work quite well (I'll submit the patch to sourceforge later).
But I don't really like this solution as it only reduces the symptoms and not the real problem. The 'file' member of 'ProjectFile' still uses wxPATH_NATIVE as path-format, that means the problem could easily appear again on another place. Even more problematic: 'file' is a
public member of 'ProjectFile'. That is not only bad style (my opinion
) but makes it hard or even impossible to control it and to make sure that it uses the right style or contains only pathnames which are correct according to the current style. As I didn't write this class I don't know why it was written in that way - maybe there is even a good reason for this. But as there will be bigger changes to sdk in the near future I think we should think about a possible re-design of this class, too.