Source code analysis tools for C# [duplicate] - c#

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What static analysis tools are available for C#?
Guys, I'm looking for an open source or free source code analysis tool for C#. The tool should be able to generate metrics from the source code such as cyclomatic complexity, number of lines, number of commented lines, SEI maintainability etc.
Does anyone know of any such tool?

NDepend will give you a vast number of stats for your code:
http://codebetter.com/blogs/patricksmacchia/archive/2008/11/25/composing-code-metrics-values.aspx
There is a free 'Trial' version which contains fewer features than the Professional product, but which is free to use for Open Source and Academic development. The Trial version on the download page gets updated with a new version before the previous one runs out:
http://www.ndepend.com/NDependDownload.aspx

NDepend isn't free for non-academic or open-source software use, but it is awesome, and will give you those metrics (and many others, using its built-in Code Query Language).
This question is more or less a dupe of this one: Calculate code metrics, and you'll find an entire series of good suggestions there.

Gendarme is totally open source and free. It's a subproject under mono. You can run the tools in three ways: wizard, console, NAnt. It will generate a html report which summarize all the violated rules. Worthy have a look.

SourceMonitor is a free C# metrics tool, it's fairly old but it could still be useful.

There are many plugins for reflector (which is also free):
Reflector Add-Ins
I believe the CodeMetrics plugin does what you need

Axivion Bauhaus Suite is free for academic use but not for commercial use.
It includes:
Software Architecture visualization
Software Architecture rule checking
Interface analysis
Cycle detection
Clone (copy) detection
Dead code detection
Detection of code style violations
A full set of predefined software metrics
The ability to add your own metrics and analyses...
Supports C / C++, C#, Java on various platforms

Visual Studio's Code Metrics

Most of these capabilities are included with Visual Studio 2008 Team System.
Under the Tools | Analyze menu there are options for Code Metrics. Most of your desired features are all there: Cyclomatic Complexity, LOC, and Microsoft's (a variant of the SEI maintainability index that instead goes from 0-100, where 100 is most maintainable) - as well as Depth of Inheritance, and Class Coupling as bonus features. It does not include number of commented lines.

I wrote a (completely) free code analysis app for .Net - Nitriq

Related

An alternative for .NET Script Editor

I am developing an API for some application. And I need to attach there a script engine to make it possible to invoke API from script.
It would be quite nice to have autocomplete, syntax highlight and debug in scripts.
I have found this solution: http://www.codeproject.com/Articles/27744/Net-Script-Editor-C-Vb-net-Mini-IDE
But there are a lot of bugs.
Does anybody have any ideas of alternative solution?
LinqPad has many of the features you are looking for - some of them cost a small extra fee, but it's probably worth the fee!
http://www.linqpad.net/
Snippet Compiler is a nice tool.
You don't mention which language your scripts are in, but based on your other question about debuggers I'll assume you are using IronPython.
The most complete (free/open source) option that I've been able to find is SharpDevelop. It includes all of the features you've mentioned for IronPython as well as a debugger. It is open source and includes many useful extensibility points, so it should provide a good starting point to fix bugs and add additional language support if needed (provided your use conforms to its license terms).
If your situation requires use beyond what is provided by the LGPL then the best choice (though not standalone or free) is to extend Visual Studio (there's already an extension for IronPython though I'm unsure if it supports debugging).
It doesn't sound like you're looking to do much, if any, development of your own for this but if I'm misreading your question then there are some editor controls available that provide the features listed (and then some) for .NET (not exhaustive):
Scintilla.Net
AvalonEdit (used by SharpDevelop)
An example of a project that uses Scintilla.Net is Peter.
You can try with SharpDevelop .

Classification Library

I need to test various famous classification methods like kNN, ID3 and ... on a huge data-set of a project, and choose one for future use.
I have no limitation on language but performance and readable code both in learning and classification phase are very important.
therefore, I'm looking for a good library with following features:
includes various classification methods
high performance
easily usable
any suggestions?
You shuold take a look at PyBrain, a great machine learning module for Python. Can't tell you much about it, because I never really used it (just read about it and looked at several projects solved with it), but it seems to be very good.
You may also want to take a look at this list of Python machine learning modules:
http://web.media.mit.edu/~stefie10/technical/pythonml.html
Or at this SO question:
Is there a recommended package for machine learning in Python?
Try scikit learn - it is written in python and has variety classifiers and also metods for testing them.
Take a look at RapidMiner which comes with a Java-API and graphical tools for data mining. The community edition is free, I think.
I used the predecessor of this tool/library as a student but do not have professional experience with it, though.

writing a DSL for the .Net platform

I am thinking of writing a DSL to be run in the .Net environment. I am most likely to implement this in C#, though I am flexible on this.
Is there a recommended online resources that show the main steps involved in writing a DSL for the .Net platform?
Ideally, I would like a resource that would provide at least an overview on the following:
'Spec'ing a DSL
How to map the specs to the .Net framework
Preferably a helloworld example of a trivial DSL implemented in a .Net language
[Edit]
Actually, I have just seen this article - but it is slightly dated. Does anyone have a view on whether the article is a good starting point or not (the .Net framework and C# seem to evolve at a very rapid pace)
If you are willing to buy a book on the topic, I highly recommend "DSLs in Boo: Domain Specific Languages in .NET" by Ayende Rahien. Very informative and gently takes you through the process of writing a DSL. The author uses a lightweight .NET language called Boo to serve as basis for the DSL's syntax.
Also you can look into VS2012 corner:
Microsoft Visual Studio 2012 Visualization & Modeling SDK
Microsoft Visual Studio 2010 Visualization & Modeling SDK
There's a bunch of different solutions you could use, including the article you linked, but some other examples from MS...
FsLex/FsYacc - Ports of the popular Lex and Yacc lexer/parsers for F#, but don't be turned off right away. If you've not used it before, F# has a feature called "pattern matching", which allows you to match very complex constructs (such as walking a tree), without an extensive amount of if/else/or blocks all over. This is perfectly suited to language compiling - because almost all DSL solutions you will find will work by parsing the language into an AST (Abstract syntax tree). In this F# solution, you get a strongly typed tree to work with. You can grab the F# Parsed Language Started to get you going. (There's plenty of existing grammars for Lex/Yacc that can help you out too).
SQL Server Modeling Tools (formerly "Oslo") - Contains a language called M, formerly broken into several parts, one being MGrammar. It's quite an advanced parser and can save you plenty of time over other grammars - code patterns (or generic grammar rules) and precedence are built in and easy to use. I would perhaps recommend this if you're starting out with parsing, because it comes with a visual tool - Intellipad, which has a 3-panel DSL mode, where you type in your language and some example code - and it'll show you the output AST as you type - it's quite productive to use. The generated AST is a valid M language constructor (MGraph), which can be used with services like SQL and XML. A downside to MGrammar IMO, is that walking the AST from C# or elsewhere is a tiresome process. There's nothing strongly typed, and you're working with objects and searching with strings - awkward and easy to make mistakes. There's some samples on msdn, and some vids on channel9 which can help you get started like this lengthy overview
The Visualization and Modeling SDK - An entire solution built into VS, which focuses largely on building your with Visual Studio's design tools over code. It comes with a minimum language starter template to help you. Haven't any experience with this to recommend it.
There's plenty of other non-MS solutions, like the one you've mentioned, C# targets for ANTLR etc. These are particularly useful if you're re-using existing grammars - because there's dozens already out there.
You could try JetBrains' MPS. It is a very rich and robust ecosystem for generating DSLs. I've never used it myself, so caveat emptor, but it's free so I guess it can't hurt (much) to give it a go.
Check out my open source project meta#. It sounds like what you are looking for.

want to start programming [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I really want to learn how to program. A friend suggested I buy vs 2005 or a newer version if I'm serious about it. Is there a cheaper route? I would like to start with c#.
Visual Studio Express is available for free from MS and is perfect for getting started.
You can start with visual studio express - it is free
My path (so far):
From no programming I picked up Java for Dummies, then progressed to Head First Java.
I found I needed the Dummies book, and found that the Head First book helped me both understand some key concepts (such as inheritance and other OO fun) and gave great examples.
However the problem with an OO language can be that you need to understand a lot of OO concepts also. I jumped straight into Java, but in hindsight maybe I should have started with Python or C, get the hang of datastructures/loops etc. first THEN progress to OO.
I personally recommend using an IDE some books don't but unless you are really good at picking up typos, import statements etc. I found using just notepad only annoyed me.
If you have a support network of IRL friends that use a certain language you might consider learning those languages, as with the Web there are a lot of great tutorials but sometimes you can get information overload, and you have to wait for people to respond on forums.
C# is good for jobs where I live, so is Java and C++. After you get the hang of your first language, you can look around and learn new things based on area where you want to work in/program for eg Web, Business Apps. etc. Unless you do it just for a hobby. If not, consider what the market wants.
Hope this helps ^_^
If you're beginning programming, an express edition of Visual Studio should be far enough to discover C#.
You can find the latest Express editions here.
If you've never done any programming before then I'd recommend not jumping straight into Visual Studio and a .net language. The amount of stuff you'll have to learn just to get to the point where you can start writing code is just too great.
Start with a simple language like Python. Edit your code in notepad and run it in a command window. Write some simple programs to generate output and read input from the keyboard. Build-up slowly.
When you'be built-up a bit of knowledge, try taking the same approach with c# or vb.net. Then explore Visual Studio, and play with winforms or wpf.
Good luck!
Quick tip:
Simply buying the Visual Studio package and trying to use it might be an exercise in causing your brain to explode. At least, it was when I started.
I'd find a friend who is good at teaching to help you get started, or take a programming 101 class at a local college (community or technical colleges are perfect for this sort of thing). Or get a good tutorial from the Internet or a book. That's really the best way to get going, as they can help point you in a good direction. The Visual Studio software is very complicated if you aren't familiar with programming concepts coming in.
Also, find something cool to write, that solve problems you have:
Program that computes paintball trajectory
D&D die-roll generator, when you forget your dice
Tools to control your iPod
etc
You could also download the latest Eclipse IDE and try some Java.
Or if you want to go multi-platform, try MonoDevelop. Not as advanced as Visual Studio (yet), but certainly enough to learn to program.
Visual Studio 2005 is too old for you. Start learning on 2010 and .NET 4. And get Express version from this location http://www.microsoft.com/express/
I agree with Jay: I don't think there's any reason to purchase development tools when there are widely available free tools/languages.
Along with his java suggestion I would say checkout out Ruby!
Personally I think ruby is the easiest to start with out of the box. You don't have to worry about compilers or IDE's. Any text editor works and irb (Interactive Ruby) is a godsend for learning.
I do find that it's a bit nicer to have a good console (ie. on Linux/Unix and OSX) in order to really see the benefits of IRB, but I believe there's something similar on windows??
Best part is, it's free, and if you're looking to build webapps, Rails is probably the easiest framework you can find for building dynamic webapps.
Answer taken from here
You can download the free Visual Studio Express Edition, and also access to the MSDN library is free. And there is also Sql Server Express edition which is also free.
Add to this all the great free online resources, like stackoverflow, asp.net, codeproject, blogs etc. and you are ready to go.
If you want to start programming with C#, C++, Visual Basic.NET, F# and pals, VS Express is the way to go obviously.
If what you need, however, is focusing on basic programming concepts like conditional execution, iteration and recursion, they might be overkill. You should instead try simpler languages like C or Python.
I'm not aware of what the definitive IDE for C and Python would be, but I make do with Eclipse for the former and a simple text editor with generic completion and the support of iPython for the latter.
As others have said, Visual Studio Express edition is free, and there are newer versions than 2005. 2010 should be out soon (if it's not already available).
If you don't want to go VS Express there is also SharpDevelop which is Open Source and very nice. But I agree with what others have said in that you may want to check your starting learning language. Certain languages work well for doing certain types of programming. I always thought Java was a good language to start with because there are MANY tools that support it and lots of tutorials out there if you get stuck somewhere.
As others said: Visual Studio Express is great to start with and best of all it's completely free.
If you have previous experience with programming, c# is reasonably easy to learn. If you're completely new to programming you might find Visual Basic a lot easier. It does not matter which language you choose, as long as you're comfortable with it.
Finally, a good beginners book can help tremendously to get you started. The advantage of a book is that it takes you step by step through the learning process. This way you don't have to look all over the internet to find all kinds of unrelated samples.
Have fun!
For C++, use Dev-C++ from Bloodshed Software; super clean and easy to use.
http://www.brothersoft.com/dev-c++-download-65296.html
For Python, just use the IDE they provide. Super clean and useful.
http://www.python.org/download/
I would recommend RapidQ. It is a free semi-object-oriented BASIC programming language for Windows and Linux. IMHO, it is one of the easiest languages to learn and use (easier than VB for example). It comes with compiler, IDE and graphical GUI designer. Howevere, it is not too much different from VB.
Unfortunately RapidQ is not developed any more, but there is an active user community at Yahoo Groups. From the files section of the group, you can download the compiler/IDE and several extensions and applicatlion examples.
Objective C isn't particularly easy as a first language, but it's not that difficult either and it does have the advantage that programming for iPhone at the moment is "sexy" and "fun" and potentially commercially useful for you. Plus there are a bunch of educational videos on iTunes U (search for "Stanford" in iTunes).
XCode for iPhone development is free to download once you register at developer.apple.com
Buying VS 2005 is a terrible idea IMHO. Learn using free tools. Intellij IDEA community edition is amazing... and free.
It all depends where you want to start: Java, Python, Ruby, C, C++, C#... Just dive in and have fun with it.
I would recommend starting with these.
http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners
http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners
These cover the bare essentials needed to get started with programming. When I first decided to get into programming seriously (not so long ago) this would have been ideal.
I personally find videos to be a great start in learning. The use of sight and sound works great. Thereafter, when you get stuck, the MSDN Library is also a great resource, with an abundance of explanations, tutorials, and samples.
http://msdn.microsoft.com/en-us/library/ms123401.aspx
Check in regularly with MSDN http://msdn.microsoft.com/en-za/ which has all you need to get started.
Lastly, pick a project to start on. That is, think of an application you would like, or do like, and build it. Nothing tastes more like chocolate cake than deploying your first -- bug-ridden -- program. Finding an open-source application to compare yours too works well in these situations. Look here for many open-source applications:
http://codeplex.com AND
http://sourceforge.net
Happy Coding!

C# Windows Application Developer - 3rd Party Tools [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Scenario
I have recently graduated from university with a degree in Computer Science.
My degree mainly focused on C#.
I want to learn more and get better at what I do.
I notice a lot of companies always want their developers to know and use 3rd party tools.
Question
If I was developing C# Windows Forms applications, what 3rd party tools/libraries/controls etc. would be of use to me and for what reason?
The answer to this question depends on how you define "3rd party tools". I usually take that to mean products from companies other than MS but excluding free open source software. When it comes to 3rd party products (for-profit) I cannot think of any common products that I've used or been asked to learn over the last decade that I've been doing .Net development. Most MS shops I've worked with turn to MS solutions (for good or ill depending on your personal view).
That said, in recent years the number and quality of the various FOSS solutions out there has risen dramatically. I use the following whenever I can:
Logging: log4net
Inversion of Control Container (plus more): Castle Windsor
ORM: NHibernate
Unit Testing: NUnit
Mocks for unit testing: Rhino Mocks
For most of these projects there are many other options, these are just my current favorites. Learn to use these (and WHY they are needed) and you'll be many steps above the average .Net developer (sad but all to true).
The DevExpress and Telerik controls are pretty popular, but not free.
Some 3rd party .Net component providers that I've seen used in companies most often:
Telerik
Infragistics
They are not free. These kinds of providers offer large libraries of controls that you'd pick from to achieve your specific goals.
Many good suggestions here, I would also add a few other categories of tools:
Software configuration management/version control: CVS, Subversion, Git/Mercurial/Bazaar, Perforce, etc. Good use of SCM is essential for professional software development.
Issue tracking: Bugzilla, Trac, FogBugz, etc. I would also consider an issue tracking system to be a critical piece of software.
Documentation: Like it or not, it becomes very handy to know your way around Microsoft Word. Knowing how to manipulate styles, headings, numberings, cross-references, etc. can make your life a lot easier when writing documentation.
You'd probably want to have a look at Silverlight. It's a Microsoft alternative to Flash and uses C#. WPF are also something to look at for interfacing.
It might also be worthwhile looking at MOSS.
I've always liked the Xceed controls. In a lot of cases you could always build your own controls. The biggest advantage to using some of these packages is that it saves you the time and they have also been well tested (if not by the company then by the people that are using them).
I've used a couple of different packages over the years and found that if you can use one it's not that hard to use another. The biggest thing is knowing what is available out there so you don't spend two weeks building something that you could have just paid a few hundred dollars for.
You should know about resharper (helper for VS)
Crystal reports - for reports,
Some Grid tools (google it, there are many - I wouldn't bother to learn until need one)
and study advanced topics like: WCF, WPF
Cruise control or other building tool, bugnet or trac - bug management tools...
And of course - AQtime or other Profiling tools.
.NET Reflector
Hawkeye - The .Net Runtime Object Editor
Infragistics
I'd throw mono in there as well. Since you're looking to give yourself an advantage over other developers and improve your value to companies - having cross platform experience is advantageous as well.
There are a lot of 3rd party controls that will help you achieve more in less time. But I don't think many of them will really improve your coding skills (calling someone else to do all the work doesn't teach you much about how to actually do thise things yourself, but familiarity with them and the ability to learn new libraries is a good skill to practice)
Resharper is good for improving your coding skills (code analysis), coding style (autoformatting), and it's a great refactoring tool. It's expensive, though.
Microsoft do some free code analysis tools for Visual Studio (FXCop for code analysis, and there is also a Static Analysis addin) which will help improve your code quality.
AtomineerUtils (my own addin) encourages excellence in documentation and generally improves your code quality (by encouraging good naming style, etc)
Focus more on the tools used in the software development process. Enterprise Architect is used for designing applications from a high level. Once you design you application's business classes you can generate your classes' skeletons. You will be responsible for you code implementation once the class structure has been created.
For implementation purposes look at several C# platforms mentioned earlier. You want to focus Microsoft's WPF, WCF, WF. WPF is ok but it can not be used prior to .net 3.0 so check your client's requirements. I'm working on a project that targets the .net 2.0 because of restrictions by the client so the applicaiton was designed in WinForms. Silverlight is an option as well.
In addition, read up on design patterns as this will help you avoid creating high maintenance applications. A good book is Design Patterns in C#.
For testing look at the Visual Studio TFS system or third party programs like NUnit. You can google NUnit. This will help you ensure that your code does what you intended it to do on a granular scale.
Also, take a look at some of the source control software avaialbel like Subversion, Rational ClearCase, Visual SourceSafe. For large projects with multiple developers you'll need a source control tool that has multiple branches so that each developer has his or her own sandbox within the source control system.
I'm a big proponent of ComponentOne and use it in my new applications regularly. I find that if you're proficient in .NET winforms in general, C1 are very easy to pick up on and usually do what you want with little effort.
A couple people mentioned Telerik. I demoed it fairly extensively and found them to be a bit more complicated because they contain a ton of configuration options for look and feel. Awesome if you're some sort of graphic designer, but unless you're building the next Windows Media Player, I think it's overkill. The learning curve for the theming seemed a bit much for what I was trying to accomplish.
C1 and Telerik both run about $1000 to $1300 depending on what license you get.
You should also check out the Krypton toolkit. It free and has a lot of nice controls.

Categories

Resources