C++ Tools - JetBrains ReSharper C++ is slowly winning me over

| 2 Comments

I've been looking at Resharper C++ by JetBrains for a while now and I expect I'm nearing the end of the trial period. Initially I found it got in my way but slowly I think it's training me to ignore the niggles and I'm finding the functionality quite compelling.

At present, I'm most interested in the "code inspection" report from Resharper. Comparing it to the similar functionality in PC-Lint and CppDepend, etc. As such the integration with the Visual Studio editor was, initially, of less interest to me. With the code inspection functionality you can run a report and then work your way through a list of issues rather than just seeing icons pop up as you're navigating in the editor. With the ability to suppress warnings that you don't care about this kind of "list of issues" approach is useful for spotting regressions and examining large code bases.

Initially I'd spoken to support and been told how to turn off the inspection in the addin to help reduce the lag that I was seeing in the editor. This worked, to a point, didn't really reduce the lag that much but removed the inspection functionality from the addin which affects how useful the inspection report is. The problem with the inspection report is that it's just a report that lets you navigate to the code in question. The idea is that you then use the addin's squiggles and icons to help you fix the issues. I was hoping for there to be a 'just fix it' option from the report, but there isn't.

With the addin's inspection enabled again the inspection report is more useful. You produce a list of issues, brute force exclude issues of types that you're not interested in right now and then work through the issues. As you click on each issue you get dumped in the editor at the point where it occurs and can use the addin to fix the problem or refactor.

For some issues I'd like to see the option of a global change being possible. A "fix ALL of these violations" option. There aren't many situations where you'd want to do this, but when moving from old style C++ to a slightly more modern style you may decide that, yes, you want to use 'override' everywhere that it's appropriate...

Most issues need a bit of "per issue thought" though and so the existing approach works fine.

I'm liking the fact that there's the option to refactor the problems away, it means that some issues that I would previously have added PC-Lint suppressions for are being fixed because it's so easy to rename variables. I have always hated "static analysis comment warts" in code ( //lint !e578 (Declaration of symbol 'i' hides symbol 'i')) but sometimes they were a necessary evil to get clean reports. With Resharper you're pointed towards an easy way to fix the issue and it's easier to fix than it is to suppress.

As far as suppression goes I think I need to investigate more. Ideally I want to be able to suppress a message for a specific situation (class/file/whatever) and store that suppressing in a file somewhere. I want to be able to have 'global' suppressions and 'local' ones. Ideally I'd like 'per project' supressions so that, for example, this lib has it's own suppression file that is found and used automatically whenever it's used (as source) in another project... Finally I think the ability to say to the tool 'ignore all my suppressions and let me have the results raw' is also important. I need look into this side of things.

As I mentioned before, the support is excellent. Very prompt responses that show that the person actually understands what you want to do and, generally, providing helpful advice either for solving the issue or for "using the tool the correct way".

I'm now thinking that I probably will end up buying a license...

2 Comments

Len, thanks for evaluating ReSharper C++!
In the R++ 2016.3 release, we also aim to add C++ support to ReSharper Command Line Tools (CLT, https://www.jetbrains.com/resharper/features/command-line.html). CLT are free and standalone, and they can be used to run all ReSharper inspections on your project (with results dumped to an XML file).

Yes, support told me about this. I've yet to manage to get it to work. I will try again next week using the EAP release...

Leave a comment

About this Entry

Practical Testing: 36 - Timeout handle wrap was the previous entry in this blog.

Practical Testing: 37 - Bringing the code up to date is the next entry in this blog.

I usually write about C++ development on Windows platforms, but I often ramble on about other less technical stuff...

Find recent content on the main index or look in the archives to find all content.

I have other blogs...

Subscribe to feed The Server Framework - high performance server development
Subscribe to feed Lock Explorer - deadlock detection and multi-threaded performance tools
Subscribe to feed l'Hexapod - embedded electronics and robotics
Subscribe to feed MegèveSki - skiing