Visual Studio 2017 - measuring "Lines of code" - visual-studio-2017

I'm unable to find a good option for my Visual Studio 2017.
I tried right clicking the projects, but there wasn't an option for "Analyze".
Just a few hours ago, I installed "Roslyn Code Analysis" using Nuget package manager. It's installed as "Archimetrics.Analysis".
How do I get "Lines of code" using this package. I have tried all the tried all the common ways of right clicking and trying to fins something but to no avail. That's why I installed this package "Roslyn" for code analysis, which is installed as "Archimetrics.Analysis".

A little hacky way that works quite well is to use a RegEx with Find in Files
Ctrl-Shift-F or Edit -> Find and Replace -> Find in Files
Use ^(?([^\r\n])\s)*[^\s+?/]+[^\n]*$ in the 'Find what:' field
Check 'Use Regular Expressions'
Set 'Look in:' and 'Look at these file types:' to your desired search scope
Hit enter and scroll to the bottom after the find is complete and you'll see Matching lines: 25843. That's the line count

You can use the Analyze -> Calculate Code Metrics -> For Solution option.
It will calculate the Maintainability Index, Cyclomatic Complexity, Depth of Inheritance, Class Coupling and Lines of Code.
For Further Details, you can consult the documentation at: Measure code maintainability with code metrics

I use the famous "Supercharger" extension and among the many functions,it has just that:
Result:
Code structure statistics for project 'SysMonitor_1'
C# classes : 14
C# interfaces : 1
C# structs : 1
C# enums : 0
C# functions : 49
C# properties : 11
Code line count statistics for project 'SysMonitor_1'
C# comment lines : 128
C# empty lines : 105
C# pure code lines: 722
-----------------------------
Total C# lines : 955
Non-C# lines : 607
=============================
All lines : 1.562

Related

How can I change the line style of the indent guides?

Visual Studio 2017 comes with built-in support for indent guides:
Indent Guides ­– dotted, gray vertical lines act as landmarks in code to provide context within your frame of view. You may recognize these from the popular Productivity Power Tools.
Here's a screenshot demonstrating this:
I've been using Steve Dower's Indent Guides extension for years now, which supports changing the line style:
Is it possible to change the line style in VS 2017? I had a look in the Options but couldn't find anything relevant.
From everything I can see, there is unfortunately no way to do this, aside from using a different extension. If you use ctrl+Q to search (FYI, ctrl+Q is a great feature that many people don't notice), and search for "guide" you will see it only returns a single configuration option:
Text Editor -> General -> Show structure guide lines
So apparently, all you can do is turn it on or off and change the color of the lines. This can be done by going to Environment -> Fonts and Colors and looking for "Structure Guide Lines."

Code Coverage Results: Export to Excel

There is a 'Code Coverage Results' window in Visual Studio which allows you to view the contents of a *.coverage file (generated by one of the VS performance tools). I was wondering if there was a way to export the Code Coverage Results to excel for further analysis. The tools in the Code Coverage Results window seem somewhat limited and was wondering if I was missing something.
I've queried quite a few statements and cannot find the answer I was hoping to find. There were three main questions which did not seem to have answers:
Can you search the data within the code coverage results? The typical VS search will not allow you to search within the Code Coverage Results window
Can the Code Coverage Results be exported to excel, or as a *.csv file? If not, then can the *.coveragexml file (which seems to be the only export option) be imported into excel in a way that i would get a table similar to the one in the Code Coverage Results window?
Is there an 'Expand All'/'Collapse All' button for the Code Coverage Results window? It would be nice to be able to expand all of the Code Coverage Result tree if possible ... or at least be able to expand a group of branches which have been expanded.
Any suggestions/input would be useful.
What you can do is this:
Export to XML (I renamed it to ...coverage.xml so it is recognized as an XML file but not sure if that's necessary)
Load with Visual Studio
Format in VS (Ctrl+K, Ctrl+D)
Now you can open this in Notepad++ for example (or any other good XML viewer). There you choose to close or open all text blocks.

Aptana Studio replace functions

I've been using Aptana Studio 3 for a few weeks now and I think it's somewhat ok.
One of the things that I miss from the code editor I used before (Macromedia Homesite: yeah, kinda old :P ) is the ability to find/replace text on multiple lines.
Is there a plugin that provides this?
Or is it possible to propose this feature to the developers?
Thank you.
Well Daniele This feature is already requested to Aptana developer team .
Take a look at this link
Enable multi-line search in find bar
Status : Open #Resolution: Unresolved
This one adds support for multi-line find and replace in the find bar.
and also
Via Tender: Multiline search
Status:Open #Resolution: Unresolved
Which adds a new multi-line search page to the existing set, with a few new options, taken from DreamWeaver and UltraEdit.[Please bring back the multiline search feature in aptana studio 2.0.x]
Now hope they Resolve this issues quickly.

Trying to find a syntax highlighter for ColdFusion in Notepad++

I use CFEclipse for most of my projects and heavy lifting but sometimes I find the need to do a quick fix on pages outside the project scope that is easier to accomplish in a simple text editor.
I have googled but can't seem to find an answer so either a link to a download or a link to how to build my own would be awesome. thanks.
Update: Brien Malone's answer below along with charlie arehart's comments are what people should use at this point as nppColdFusion is no longer maintained as of 23 Sept 2011.
Disregard
nppColdFusion is actively maintained
In notepadd ++, go to 'Plugins'> 'Plugin Manager'> 'show plugin manager'. 'Coldfusion Lexer' is listed as available plugin
This question is a few years old now, and unfortunately, the accepted answer involving nppColdFusion is no longer valid because the plug-in doesn't work with NP++ after version 5.x.x and is not being maintained. (It stopped working when Notepad++ switched their plug-in hooking mechanism in version 6.x.x)
The Notepad++ site points to a library of nearly every language highlighter available:
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files
ColdFusion (specifically CF9) is listed:
http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_CF9.xml
It's not as good as a full plug-in like nppColdFusion, but it is better than pages of black text.
Just a comment about Tony's answer (Aug 22 '14 at 13:00) : he wrote "In notepadd ++, go to 'Plugins'> 'Plugin Manager'> 'show plugin manager'."
However, in ver. 6.8 (maybe since before), there's no "Plugins" menu item on the menu bar. What I had to do is:
1- From the User Defined Language Page
http://docs.notepad-plus-plus.org/index.php?title=User_Defined_Language_Files
Download the ColdFusion User Defined Language file
http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_CF9.xml
Into the Notepad++ Folder
2- From the User Defined Language panel, import that file:
Language > Define your language... then press the Import button
ColdFusion will then appear at the bottom of the Language menu item selection list, and NotePad++ will automatically use it for any .CF file you open.
This link might help: http://howardscholz.wordpress.com/2007/06/01/notepad-support-for-coldfusion-8/
Disclaimer: I haven't tried it myself.
I found that nppColdFusion was working well, until I updated NP++ to version 7.6.6. I have tried just about everything to get it working, but to no avail.
I tried Delire Web's solution and it worked perfectly.
The different formatting (font and background colors) takes a bit of getting used to though.

Is there anything like GhostDoc for C++

When I'm developing in C#, I heavily use GhostDoc to speed up the process of commenting my code. I'm currently working on a C++ project and I haven't found an equivalent tool. I know about Doxygen, but from what I know it is used to create documentation outside the code, not comments in the code. Are there any good equivalent tools? I would prefer one that runs in VS, but I could handle one that works in any IDE.
(Before someone brings it up, I don't rely solely on GhostDoc to create comments. I just use it to create the starting point for my comments.)
I've written an add-in, Atomineer Pro Documentation, which is very similar to GhostDoc (it generates/updates documentation comments to save a lot of time and effort when documenting), but it parses the code directly for itself and thus is able to handle C, C++, C++/CLI, C#, Java and Visual Basic code, and doesn't require the surrounding code to be in a compiling state before it will work. It will also automatically add/update documentation for more tricky things such as exceptions thrown within the body of a method.
It runs under Visual Studio 11, 2010, 2008 and 2005, and supports Documentation-Xml, Doxygen, JavaDoc and Qt commenting formats, as well as the format/style of comment blocks and the auto-doc rules used being highly configurable. It has a number of other handy features such as aiding conversions of legacy doc-comments to the above formats, and word wrapping in doc-comments and normal block comments.
The above is just a summary of some key features - This comparison of features with other products serves as a more complete list of the many other features available.
Visual Assist helps by providing custom scripts executed while typing (or on other).
For example, you can have a script for comments like this :
/************************************************************************/
/* My comment : $end$ */
/************************************************************************/
That would be suggested (via a combo-box exactly like intellisense) when you start typing "/**" for example.
When you select this suggestion (via Enter/Space/Click - customizable), it will insert the script where your cursor is and just replace markers that are between '$' characters by special values (like the current file name for example).
Here the $end$ marker will make the cursor be at this position when the script is executed. This way, you continue typing smoothly. For example with the previous script set, typing exactly :
/** this is a test comment to show you one of the many features Visual Assit!
will simply give :
/************************************************************************/
/* My comment : this is a test comment to show you one of the many features Visual Assit! */
/************************************************************************/
It's really easy to customize and the behavior of the suggestion (read : intellisense++) system is customizable.
Visual Assist might do the job, though I'm not absolutely sure.