DZone
Performance Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Performance Zone > Analyzing RavenDB 4.0 With NDepends

Analyzing RavenDB 4.0 With NDepends

RavenDB can provide you with good insight into your project, but you should probably start using it as soon as you begin working on your project.

Oren Eini user avatar by
Oren Eini
·
Mar. 08, 17 · Performance Zone · Opinion
Like (1)
Save
Tweet
2.40K Views

Join the DZone community and get the full member experience.

Join For Free

I have a… difficult relationship with NDepends. On the one hand, it is an invaluable tool to provide you with good insight into your project. On the other hand, I don’t always agree with its recommendation and I have to teach it what I consider valuable. In my mind, it is the kind of tool that you reach for when you need to be in expert mode.

We use it for exploring our API surface area and seeing that it makes sense, to validate breaking changes, and, in general, to get detailed view into troublesome spots in the codebase.

For example, it pointed out this guy as having to many parameters. I can’t say that I disagree, and it is a prime candidate to refactor to make it simpler.

image

On the other hand, it didn’t get to be this way by accident; it was added to slowly over time. Each new feature or bug fix needed just a bit more, and this grew and grew. At this point, however, this is extremely stable code that rarely changes, and modifying it will take a lot of work.

Just having tools around doesn’t mean that you get to turn off your head.

One important thing is that if you are considering NDepends: you probably want to start doing so very early in the project lifecycle. One of the things that I find most interesting in the new version is the notion of estimated debt. Here is what this looks like for RaveDB 4.0:

image

Here is the value for RavenDB 3.5:

image

This is composed from estimated amount of effort that you need to put to fix things.

The really interesting part is that it does a pretty good job of finding troublesome locations even when you don’t have history/coverage information. For example, here is the list from RavenDB 3.5:

image

I find it highly amusing to see this, mostly because the client-side implementation is more complex (and is more frequently modified).

Digging a little bit deeper gives us this:

image

This is where I start arguing with the tool — or, to be rather more exact, I have more information than NDepends on this usage. AsyncServerClient is how the entire client talks to the server, so it isn’t cohesive and it is certainly too big, but it is pretty much by design.

The details about boxing/unboxing, however, are much more interesting — and this is where you can start doing a lot of interesting things. In particular, you can customize NDepends to give you a lot of details and enforce rules about your codebase.

For example, given our recent need, here is all the big structures in our code:

image

You can do that for exploring, or you can add that as a rule (warnif).

NDepend

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Screen Sharing in Java
  • Are All Kubernetes Ingresses the Same?
  • Hard Things in Computer Science
  • A Brief History of the DMCA

Comments

Performance Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo