Registered: Jul, 2005
Re: How Useful Are Code Metrics?
Posted: Apr 28, 2006 8:52 PM
> Now that I think more about it, I would rather just take
> java.* and javax.* off the diagram entirely, probably, as
> well as some other packages like log4j and such.
That's straightforward to do with a jdepend.properties file. I exclude everything not in the current project.
> But I did
> kind of want to combine everything under
> com.artima.jivecoupled.* under one package. We have a rule
> that certain packages can't talk to jivecoupled, because
> that's the legacy stuff that calls into Jive, which we're
> replacing. I don't care so much about the structure of
> jivecoupled itself, but would like to see one jivecoupled
> box on the diagram to make sure nothing depends on it that
You might be able to do that with the XSLT, creating a subgraph around the package(s) you're interested in.
> I am also planning on setting up some kind of script or
> tool that will enforce these package layerings by looking
> at the code, so it will be caught that way. But I somehow
> also would like to look at a dependency graph generated
> from the code.
I think you could do that by using XPath expressions into the JDepend output. We use that to detect cycles. It's pretty straightforward using either Ant or Maven.