metriculator
metriculator copied to clipboard
use of metriculator with .c files?
Hi,
I couldn't use metriculator for .c files. It would be great to have it work with .c files as well, even when I have to tell CDT that those are C++ files in the project.
Thanks Peter.
Although we know that there is some (reasonable) demand to support C files, we are not planning to implement it in the near future. But support is always welcome, so if someone feels like doing, that would be appreciated.
Then why do you call it "Run C/C++ Code Analyzer"?
this is very sad... was very surprised to see this feature missing. why would supporting .c files a big issue ? thank you
You can tell CDT that your .c files (settings/properties for file extensions) are C++ code and then it should just work, IMHO. Might be quicker than extending the plug-in, which you'd be free to do :-)
+1 for C support. In the source code (AbstractMetricChecker.java, around line 70) I saw that you explicitly ignore c files. So I assume mapping .c files to C++ in CDT does not have an effect. Are there good reasons not to support C?
When we built metriculator, some C constructs did not work as expected. Thats why we have focussed on C++ and decided to simply ignore C files. Technically it should be possible though. At that time, we simply didn't have enough time for it :)
Hi, When I change the file extension from .c to .cpp, Metriculator parses more thinks than when I just comment the c file ignoration (AbstractMetricChecker.java, around line 70). Can you please give us some clues about what to change to make it work? I really need this feature. Thank you
@PeterSommerlad, I tested your tips and it seems fill my expectation!
Hi I'm trying to follow the @PeterSommerlad suggestion but my File Types in Eclipse are locked. Do you know how I could unlock them? I checked online by I'm not able to find anything abut thant. thanks
It is a really nice plugin, but I need it for c-files as well. If I define "*.c" files as C++ code in my project it has no effect. Can somebody build this plugin for c-developer without "c file ignoration (AbstractMetricChecker.java, around line 70)"?
@tuttoaldoc @tema13tema The reason, why metriculator is not accepting C files is that the internal data for representing the languages is not identical and metriculator was written for C++. Without further details, I unfortunately can not understand, why the workaround to mark all C source files to be parsed as C++ does not work for you. May be you can provide a screenshot of your failed attempt to change the settings. The file types can be changed globally or on a per-project base. However, you might also need to change your project type to be C++ instead of C instead of only changing the file type of .c files. also the capitalization of .c vs. .C could be an issue depending on your platform.