Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Static analysis framework enhancement request

Hi Andrew, thanks for your answer.

Am 04.08.2009 um 14:58 schrieb Andrew Gvozdev:

Hi Konrad,

On Mon, Aug 3, 2009 at 9:40 AM, Konrad Windszus <konrad_w@xxxxxx> wrote: I try to write an extension for cppcheck ( ) with the help of your great static analysis framework.

As far as I understand cppcheck would produce error report given a source code. Codan framework provides AST. How do you manage to wire them together?

I use the Codan framework only for reporting capabilities. Not for AST. But Codan framework is also helpful, if you just try to embed external static analyzers. The options and the "run with build"- possibility also work well with external tools. I therefore derived my class only from AbstractChecker and not from AbstractIndexAstChecker.

My first tests were successfull, but it would be great, if there could be an enhancement in org.eclipse.cdt.codan.core.model.CodanProblemReporter. So far I have to give an id which must be specified in an extension point of my plug-in. I now only call cppcheck in my plug-in and don't know all the types of the errors in advance (they are also highly dynamic, since many new checks are added with new versions). I therefore plan to call reportError for all types of errors reported by cppcheck with the same id. Unfortunately I'm not able to overwrite the given extension points defaultSeverity. Therefore optimal would be a new method reportError which would allow to override the provided severity.

I suggest to file an enhancement request in Bugzilla, but add some more details as the mechanics of what you are doing is not quite clear (well, at least to me).
Okay, I will open an enhancement request in Bugzilla, which should be fairly simple to implement although I described it a little complicated I guess. I only want an reportError method with a new parameter to overwrite the defaultSeverity set in the plugin extension. This is not possible so far.

Another question regarding releasing that plugin: Is it possible to share the code in your CVS

Not sure what you are asking for. The code is shared and everybody has read access to CVS. Aren't you ripping the benefits of sharing already?
I don't talk about the Codan framework in general but about my plug-in with the possibility to embed cppcheck in Eclipse. Is it possible to share that in the eclipse cvs?

and what about any release plans for the framework. Is it included with the next version of CDT?

There are too few checks, and frankly the framework is new and not well rounded yet. Release plans? It depends on popularity of the framework measured as amount of contributions to the project. So far there is some interest but not too much contributions yet. If anybody is interested I encourage to submit enhancement requests (to bugzilla), bug reports, patches etc. You can help.
I guess if cppcheck could be used together with (a small part of) codan, that might boost interest in that framework. Since there are other static checkers like cppcheck not written in java, I think reinventing the wheel in java might be a little bit to much, although only then you could take advantage of the AST that comes with CDT. But normally performance is not that important for static analysis and everyone developing in C++ should be able to compile a tool like cppcheck ;-) which also runs on every platform.



Back to the top