metriculator icon indicating copy to clipboard operation
metriculator copied to clipboard

use of metriculator with .c files?

Open PeterSommerlad opened this issue 12 years ago • 11 comments

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.

PeterSommerlad avatar Feb 01 '13 10:02 PeterSommerlad

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.

ideadapt avatar Feb 27 '13 22:02 ideadapt

Then why do you call it "Run C/C++ Code Analyzer"?

mmosko avatar Apr 04 '14 18:04 mmosko

this is very sad... was very surprised to see this feature missing. why would supporting .c files a big issue ? thank you

hackrid avatar Jul 03 '15 11:07 hackrid

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 :-)

PeterSommerlad avatar Jul 10 '15 14:07 PeterSommerlad

+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?

skandi avatar Apr 05 '16 12:04 skandi

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 :)

ideadapt avatar Jun 18 '16 16:06 ideadapt

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

firstofus avatar Jul 21 '16 07:07 firstofus

@PeterSommerlad, I tested your tips and it seems fill my expectation!

firstofus avatar Jul 22 '16 12:07 firstofus

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

tuttoaldoc avatar Oct 29 '16 12:10 tuttoaldoc

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)"?

tema13tema avatar Oct 31 '16 11:10 tema13tema

@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.

PeterSommerlad avatar Nov 03 '16 15:11 PeterSommerlad