Exemple #1
0
 public void addRowToViewTable(fileStatistics file)
 {
     this.statsViewTable.Rows.Add(
         file.getPackageName(),
         file.getClassName(),
         file.getUniqueKeywords(),
         file.getUniqueUdis(),
         file.getUniqueConstants(),
         file.getUniqueSpecialChars(),
         file.getTotalKeywords(),
         file.getTotalUdis(),
         file.getTotalConstants(),
         file.getTotalSpecialChars(),
         file.getTotalChars(),
         file.getTotalWhiteSpace(),
         file.getTotalCommentChars(),
         file.getPercentWhitespace(),
         file.getPercentCommentsChars(),
         file.getFilepath());
 }
        public void addFileStat(fileStatistics file)
        {
            int foundPackageID = getPackageId(file.getPackageName());
            int foundClassID   = getClassId(file.getClassName());

            if (foundPackageID > 0 && foundClassID > 0)
            {
                String sql = String.Format(insertFileStatPrefix,
                                           statsTable, packageID, classID, uniqueKeywords, uniqueUDIs, uniqueConstants,
                                           uniqueSpecialChars, totalKeywords, totalUDIs, totalConstants, totalSpecialChars, totalChars,
                                           totalWhiteSpace, totalComments, percentWhitespace, percentComments, filePath,
                                           foundPackageID, foundClassID, file.getUniqueKeywords(), file.getUniqueUdis(),
                                           file.getUniqueConstants(), file.getUniqueSpecialChars(), file.getTotalKeywords(),
                                           file.getTotalUdis(), file.getTotalConstants(), file.getTotalSpecialChars(), file.getTotalChars(),
                                           file.getTotalWhiteSpace(), file.getTotalCommentChars(), file.getPercentWhitespace(),
                                           file.getPercentCommentsChars(), file.getFilepath());

                Console.WriteLine("Sql String: " + sql);
                executeSqlNonQuery(sql);
            }
            else
            {
                Console.WriteLine("ERROR in addFileStat: Package or Class ID are invalid.");
            }
        }