Share the code statistician, another small tool written by myself.

Source: Internet
Author: User

After reading the code statistics tools provided by the bianchenglang sub, I was reminded of a similar tool written this summer. At that time, he wrote at the request of a friend. Later, he was used to prove his work workload as a boss, which was totally unexpected to me.
.

As follows:

Function:

1. You can modify the configuration file to provide a certain degree of scalability. (The corresponding Xml file description will be provided later)

2. You can generate RTF files and PDF files based on statistical results. (Because of the time at that time, the HTML generation function is not provided)

3. Statistics on the entire directory are supported. Similarly, statistics on a single file are not supported. In my opinion, there is no need to calculate the number of lines of code for a single file.

Defects:

1. because when I wrote this tool, I used. net 2002, without selecting the control of the entire directory. Therefore, I wrote one myself, which is not very well written and may have some problems.

2. This tool does not provide good support for multithreading when transferring to the selected directory structure and analytical computing, which is related to its own weak capabilities in this aspect.
If you have time and the tool does work, I will try to improve it.



Note: The PDF generation function of this tool depends on the ITextSharp open source component.

Next, we will introduce the structure of the configuration file.

<Deployments>

<Ages>

<Language type = "CSharp">

<! -- File type (extension list) -->

<FileType> cs; aspx. cs; asmx. cs </FileType>

<WrapSign isCounted = "1" >;</WrapSign>

<Signature pair = "0"> // </Signature>

<Signature pair = "1">/* | */</Signature>

<Signature pair = "0"> // </Signature>

</Language>

<Language type = "Delphi">

<FileType> pas </FileType>

<Signature pair = "0"> // </Signature>

<Signature pair = "1"> (* | *) </Signature>

</Language>

<Language type = "VB">

<FileType> frm; bas; ctl; cls </FileType>

<WrapSign isCounted = "0" >_</WrapSign>

<Signature pair = "0"> '</Signature>

</Language>

<Language type = "C">

<FileType> c; h; cpp </FileType>

<WrapSign isCounted = "1" >;</WrapSign>

<Signature pair = "0"> // </Signature>

<Signature pair = "1">/* | */</Signature>

</Language>

<Language type = "Javascript">

<FileType> js </FileType>

<Signature pair = "0"> // </Signature>

<Signature pair = "1">/* | */</Signature>

</Language>

</Ages>

<UI>

<Options>

<OptionItem id = "IsRecursive" desc = "recursive directory"> 1 </OptionItem>

<OptionItem id = "IsAutoExpandAllNodes" desc = "show all nodes automatically"> 1 </OptionItem>

</Options>

</UI>

</Deployments>

The preceding figure shows the configuration file Config. xml structure that this tool depends on. Obviously,LanguageElements define information related to parsing in a programming language. I believe everyone can understand it. If you want this tool to support a new Language, you only need to add a Language element and define the corresponding child element.Note:,UIDo not modify the content in the element because it is controlled by the program. Of course, you really want to change it, and I have no way.

: Download (the upload is successful. It seems that the home network is a bit faulty .)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.