• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

static code analysis to find dead code, which takes multiple projects into account?

Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a number of projects which interact with one another. A scenario which we often see in the wild is a "common" or "shared" project, which supports other projects.
I used the UCDetector plugin for Eclipse to detect unnecessary/dead code which found a couple of instances of "dead code," but upon further investigation we find that this code is actually being used outside the project, by another project.

Is there any decent static code analysis tool which will account for these multiple project scenarios?
Saloon Keeper
Posts: 12806
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that you can easily do this with static code analysis. It may not be obvious that some code is used until you configure your application a certain way.

Instead, you could write integration tests that cover all of your use cases and then attach a code coverage plugin to it. At the end of your integration tests, code coverage can report lines of code that are untested and therefore likely unused.
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
    Bookmark Topic Watch Topic
  • New Topic