dotnet, ndepend comments edit

NDepend 6 was recently released with a ton of new features. I’ve been working with NDepend for quite some time (my earliest blog entry on it was for version 2.7) and every release gets better. It’s been a couple of years since version 5 came out. What’s new?

The first thing you notice that’s new when you start things up is the additional integrations they’ve added. It used to be just “install the extension for Visual Studio” but now there are icons for TFS, TeamCity, SonarQube, and Reflector integration.

NDepend 6 integrations

I’m particularly interested in the TeamCity integration because that’s the build server I use. I have manually integrated it in the past using MSBuild and some manual TeamCity configuration, but with the new add-in, I can just drop NDepend on the build server and have all that work done for me. There’s even a specific NDepend build step type added and the report magically shows up in the dashboard. There are some great step-by-step walkthrough videos on the NDepend site showing how to set this up.

I decided to analyze some of the new code I’ve been working on. It was pretty easy to get my project started. I love how NDepend helps you figure out where to go next if you haven’t used it before.

NDepend beginner dialog

The report has improved by adding “how to fix” information to rule failures. One of the challenges I’ve had in the past is that you could see what things might have failed a rule, but you didn’t really have anything clearly “actionable” you could tell folks to fix. You had to kind of “know” what a rule meant. Now there’s no guesswork.

Report showing how to fix violations

One of my huge complaints with other tools (coverage, analysis) has been addressed - handling of async/await methods. A lot of what I’ve been working on lately has been Web API code, which is async/await from the ground up. Have you ever looked at that stuff in a decompiler like Reflector? Or a code coverage tool? I’ve found you don’t get any information on it (“Let’s just omit it!”); you get incorrect information on it (“You don’t have full coverage because you didn’t cover all the cases in the generated state machine!”); or you get confusing information (“I’ll show you all of the compiler generated methods that don’t make sense!”).

Reports are very clean and complete, but you don’t see the compiler generated state machine junk. Finally!

The metrics view just doubled in value by adding a second “dimension” to its display. You used to be able to just change the size of an item in the view based on a specific metric; now you can compare one metric to a second metric by adding a sort of “heat map” style coloration to it.

My favorite combination so far is to set the box size by “# IL Instructions” and set the color of the boxes by “IL Cyclomatic Complexity.” It gives you a pretty good indication of things that need to be refactored - just look for the huge red boxes!

NDepend metrics view

My favorite new feature is the shareable rule files. We have a standard FxCop ruleset we use on all of our projects. We have a standard StyleCop ruleset we use on all of our projects. We can finally have a standard NDepend ruleset we use on all of our projects.

You can create a rule file with all of your analysis rules stored outside the project file and then tell projects to reference the central/common NDepend rules file.

Create a rules file

Once you have a custom rules file, you can reference it from your project. You will probably want to switch the paths in your project to be relative to the project file so it works on your machine and the build server.

Change paths to relative

With every iteration, NDepend just gets more compelling. I get so much insight from it about our code and areas we need to improve - things that are hard to see when you’re neck deep in code and NuGet package references and under a deadline. You owe it to yourself to check it out.

Full disclosure: I got a free personal license from Patrick at NDepend. However, we have also purchased several licenses at work and make use of it to great benefit.

lastpass, security comments edit

I use LastPass for a lot of things including storing my personal software license files. I use the “secure note” function to save the license information and attach the license file to the secure note.

I was working on something today and trying to save a license to my machine and kept getting a dialog saying, “Error opening attachment. Error C.” Nothing really specific and very confusing. I was able to save the attachment from the LastPass web site but not through the browser extension.

I ended up finding the solution in this forum post.

  1. LastPass Icon > Tools > Advanced Tools > Clear Local Cache
  2. LastPass Icon > Tools > Advanced Tools > Refresh Sites

After doing a clear and refresh, the attachment saved correctly. These are probably good steps to try whenever you get any sort of error with the LastPass browser extensions. Filed for future reference.

vs, coderush comments edit

CR_Documentor version 4.0.0 has been released to the Visual Studio Gallery and adds support for Visual Studio 2015.

Head over to the gallery to get your copy or get it through “Extensions and Updates” in the Visual Studio “Tools” menu.

Note: In VS 2015 RC you may notice that after installing the add-in the only add-in that shows up for CodeRush is CR_Documentor. I’m not sure why this is, but it seems to be fixed by clearing out the files in your loader cache in these folders:

%appdata%\CodeRush for VS .NET\1.1\Settings.xml\Loader
%appdata%\CodeRush for VS .NET\1.1\Settings.xml\_Scheme_FrictionFree\Loader

It is safe to delete these files because they will be re-created on the next restart of VS. This will get all the CodeRush features to show up again.

I filed an issue with DevExpress about this. If you are having this problem, please add a comment to that issue so they know it’s not just me.

media comments edit

Back in March 2014 I started converting my DVD rips into MP4 files for use with Plex. I ran two laptops (both with 2.3GHz dual-core CPUs) 24/7 until early March 2015 when I added a third computer - an eight-core 4GHz machine.

Today I finally finished converting all of my disc-based video content to MP4.

Some quick statistics:

  • Total number of files: 4998
  • Total content runtime: 134 days, 8 hours, 56 minutes, 47 seconds
    • SD runtime: 115 days, 12 hours, 25 minutes, 17 seconds
    • HD runtime: 18 days, 20 hours, 31 minutes, 30 seconds
  • Total file size: 5182.3GB
    • SD file size: 3042.04GB
    • HD file size: 2140.26GB
  • Average MB/minute for SD content: 18.73
  • Average MB/minute for HD content: 80.72

I’m pretty pleased with how everything has come together. Seeing it all in Plex, nicely organized… it’s a good feeling.

I can definitely say CPU power is important in video conversion. My laptops could convert an average SD movie in three or four hours, but an HD movie… I couldn’t get one converted in a day. The eight-core behemoth can take the same SD movie and finish in an hour or less; and HD movies take about four hours - same as SD content on my laptops.

Anyway, if you’re looking to convert a bunch of video, it’s worth investing in some hefty CPU power. It’ll save you tons of time.

Finally, as part of this, I’d like to introduce my media center documentation on ReadTheDocs.

It’s a work in progress, so this is sort of a “soft launch,” but I think it’s fleshed out enough to be of some use. I will probably do a more dedicated blog entry for it when I’ve got more of it filled out.

Information about how I converted my stuff with Handbrake, including the script I used to pull the report data above, as well as the specs for my behemoth conversion/Plex server, is all over there.

process, security comments edit

I feel like I should write a book. It’d be epic like Moby Dick but would start with, “Call me Yossarian.” This is going to sound confusing and comedic, straight out of Catch-22, but I assure you it’s entirely true. It is happening to me right now.

Serenity Now!

We write a lot of documentation to a wiki at work. I’ve got permissions on it to add pages, rename pages, move pages… but not delete pages. If I want to delete a page, I have to find someone who has delete rights and ask them to do that, which doesn’t make sense because I’m a pretty heavy contributor to the wiki.

I decided to seek out delete permissions for myself.

The wiki is managed by an overseas team. The previous process to get permissions to the wiki was to send an email to their infrastructure distribution list with your request and the issue would be dealt with in a day or two. It was fairly effective from a customer perspective.

The new process to get wiki permissions is to file a ticket in this custom-built ticketing system they’ve adopted. You find this out by sending an email to the infrastructure distribution list and reading the “out of office” autoresponder thing that comes back.

You can’t file a ticket unless you have an account on the ticketing system. That’s… well, not unheard of, but a bit inconvenient. Fine, I need to create an account.

In order to get an account on the ticketing system, you need to file a ticket. No joke. As one colleague put it, this is sort of like a secret society - you can’t get in unless you already know someone who’s in and will “vouch for you” by creating a ticket on your behalf.

Three working days later, I have an account so I log in. The ticketing system is a totally custom beast that was initially written starting in 2001 and hasn’t really been updated since 2008. It looks and behaves exactly like you think - it’s very bare-bones, there’s no significant help, and it’s entirely unintuitive to people who don’t already use it every day.

Seeking out help, I notice in the autoresponder email there’s a wiki link to a guide on how to file tickets. Cool. I visit that link and… I don’t have permissions to see the wiki link.

In order to see the guide on how to file tickets, I have to file a ticket. Of course, I’m not sure what kind of ticket to file, since I can’t see the guide.

I search around to see if there’s any hint pointing me to which ticket type to file since they all have great titles like “DQT No TU Child Case.” Totally obvious, right? I end up stumbling onto a screen shot someone has taken and posted to a comment section on an unrelated wiki page referring me to the type of case I need to file.

I don’t see the right case type on the list of available tickets I can file. Turns out I don’t have ticket system permissions to file that kind of ticket.

I have now opened a ticket so I can get permissions to open a ticket to get permissions to delete pages from the wiki. This is after, of course, the initial “secret society” ticket was filed to get me an account so I can file tickets.