Krazy2 plugin for KDevelop

Andreas Pakulat apaku at gmx.de
Tue Oct 30 08:04:13 UTC 2012


Hi,

On Tue, Oct 30, 2012 at 2:14 AM, Daniel Calviño Sánchez
<danxuliu at gmail.com> wrote:
> 2012/10/29 Aleix Pol <aleixpol at kde.org>:
>> It might be interesting to integrate it with the language Problems? I
>> don't really like the idea of having another toolview for finding
>> problems.
>
> When I started writing the plugin my idea was to integrate it with the
> language Problems. But after giving it a thought I realized that I had
> not enough time to properly integrate it with the language Problems,
> and that a custom view was better than nothing.
>
> The main reason is that Krazy2 needs a lot more time to analyze a
> project than the time needed by the current problem providers. For
> example, it takes around 14-15 minutes to analyze KTutorial (other of
> my projects ;) ), which contains around 450 files. And that only with
> the default checkers, with no extra checker. I felt that such a wait
> didn't fit with the rest of language Problems, which are analyzed
> quite fast.

If you think so, then it shows that KDevelop's parser works quite
well. An initial parsing of a complete codebase like KDevelop or
KDevPlatform also takes quite some time (haven't measured this
recently). However the parser is built so that it does this in the
background, until you start to open files, these will be added to the
list with higher priority so basically once you open a file its being
parsed at that point and you get the problems.

Once the initial parse is done, the parser only needs to re-run on
files that changed. So it runs over all project files initially on
project load and checks their modification time and it gets notified
by the text editor when the file was changed.

Something similar could be done for krazy too, if letting it handle a
single file is at least fast-enough, i.e. around a second at most for
all enabled checkers. If it takes longer than that, you'd indeed be
right that it should be a separately triggered action. Nonetheless I
think you should populate the problems toolview, since most of the
things krazy finds are problems. That does not mean it has to run
automatically - at least I'd hope so (I don't know the
language/problem framework that well).

That behaviour is done by static code analyzers integrated in other
IDE's, i.e. you have a separate "start analyzing" button, but they
populate the standard "errors/warnings" toolview.

Andreas




More information about the KDevelop-devel mailing list