1

we consider to use Klocwork Insight for code analysis in the near future and are just migrating our source to Team Foundation Server 2010.
Is it possible to tell Klocwork to create Work Items for issues found? Or would I need to create a script that would do this?

TFS 2010 is listed as "Supported software configuration management (SCM) system for Klocwork Inspect", but this may only refer to the ability to get the code form TFS. Sadly, the site does not elaborate any further.

Any ideas on this topic? Thanks in advance.


[EDIT] To elaborate:
After going productive on TFS there will probably be an initial phase of just getting the Workspace to the Klocwork Server and running Klocwork separately, having only its own IDE for processing its output. For big issues we'll have to manually create WIs, just as we do now (with another issue tool).

Soon after that, we'll probably include Klocwork into the Build Workflow for our weekly build, so TFS will be aware of its exit state at the least. I guess then TFS can create a WI if Klocwork "fails", but can it create, say, one WI for each issue of severency x and above or with a specific ID?

1 Answer 1

1

Without great knowledge of Klocwork (I had some minor experience in another job, but it was a UX universe - so my experience is probably not even relevant) I 'd say this should be possible with TFS.

If you plan to use your code analyzer as part of your build, then this is trivial since you 'll be able to delegate the work item(s) generation to the TFS build. The only prerequisite is that Klocwork can run as a console application.

If you 'd like to use it separately, there are two possibilities: (1) Either Klocwork itself is integrated with TFS & can generate the items you like on it's own, or (2) It isn't and you 'll have to create your WIs programatically.

I can support you with either option provided you elaborate on which variant you focus.

[Our code analyzer runs as a part of the build in TFS, in the older job I had Klocworks was a part of the build as well.]

EDIT (based on the comments below)
It should probably be no problem to invoke Klocworks with an "InvokeProcess" activity & catch it's resulting exit code. If it then equals a 'fail', it's really trivial to open ONE new WI using the already provided activity OpenWorkItem (here is a demonstration of its usage for a different situation)

In case you want to open multiple WIs per Build, things can get a bit more complicated: "InvokeProcess" still stands, but then you would have to parse the Klocwork output into a suitable <List>. Finally implement a foreach that contains an OpenWorkItem. The pain shall be to implement this 'parsing' within the build process template.

4
  • Thank you, so when using it as part of the build, TFS would make a WI that say something like "Job 'Klocwork' failed, that's its Output: ..."? That would be a start, but we'd like (as soon as there are only few isses found per build) to generate one WI per Klocwork issue, is this possible with that approach?
    – SvenS
    Aug 18, 2011 at 6:38
  • Concerning the scenarios for separate usage you mentioned @pantelif: Atm we use ClearCase for Source Control and have a weekly run for Klocwork. So the separate, weekly run will probably not change that fast after going productive on TFS, so we're most interested in scenario 1: Can I tell Klocwork (in its current or even a future version) to generate one WI per issue, without any other tools, scripts, hacks, workarounds etc.? Are there any known issues? Of course, if this is not the case, we will look into creating a program that does this for us. (Though this is low priority atm)
    – SvenS
    Aug 18, 2011 at 6:45
  • Yes, I figured that should work (having to Invoke Klocwork and parse its Output) with considerable effort. Part of my question was if Klocwork had a built-in feature to create WI in TFS. I guess as this hasen't been answered, my question remains open. Thanks for your effort! Sadly, I see no "partly answered" button :/
    – SvenS
    Aug 18, 2011 at 12:28
  • It's correct that you 're not closing the question, I'm happy to have helped out, even if partially ;)
    – pantelif
    Aug 18, 2011 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.