Click here to Skip to main content
12,397,244 members (61,329 online)
Click here to Skip to main content
Articles » Languages » C# » Utilities » Downloads

Stats

45.8K views
1.6K downloads
13 bookmarked
Posted

Visual FoxPro Lines of Code Analysis

, 5 Jan 2012 CPOL
Lines of Code Counter in C# that analyze FoxPro Projects (PJX)
using System;
using System.Data;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace VFPLOCCounter
{
	public partial class ReportForm : Form
	{
		private DataTable rptTable;

		public ReportForm()
		{
			InitializeComponent();
		}

		private void ReportForm_Load(object sender, EventArgs e)
		{
			foreach (DataRow r in rptTable.Rows)
			{
				DataRow newRow = ResultData.resultsTable.NewRow();
				newRow ["fileName"] = r ["fileName"].ToString();
				newRow ["fileType"] = r ["fileType"].ToString();
				newRow ["totalLines"] = Convert.ToInt64(r ["totalLines"].ToString());
				newRow["numberMethods"] = Convert.ToInt64(r["numberMethods"].ToString());
				
				newRow["codeLines"] = Convert.ToInt64(r["codeLines"].ToString());
				newRow["commentLines"] = Convert.ToInt64(r["commentLines"].ToString());
				newRow["blankLines"] = Convert.ToInt64(r["blankLines"].ToString());

				newRow["codePercent"] = Convert.ToDecimal(r["codePercent"].ToString());
				newRow["commentPercent"] = Convert.ToDecimal(r["commentPercent"].ToString());
				newRow["blankPercent"] = Convert.ToDecimal(r["blankPercent"].ToString());

				newRow["projectName"] = r["projectName"].ToString();
				newRow["projectPath"] = r["projectPath"].ToString();
				

				ResultData.resultsTable.Rows.Add(newRow);
			}
			rvResults.RefreshReport();
		}
		/// <summary>
		/// ReportTable is the dataTable to view in the report body
		/// </summary>
		public DataTable ReportTable
		{
			set { rptTable = value;}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mark Miller
Software Developer (Senior)
United States United States
I develop software for a leading healthcare system in Northern Illinois.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 5 Jan 2012
Article Copyright 2007 by Mark Miller
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid