Пример #1
0
        public void replaceFileStat(fileStatistics file)
        {
            int foundPackageID = getPackageId(file.getPackageName());
            int foundClassID   = getClassId(file.getClassName());


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

            Console.WriteLine("Sql String: " + sql);
            executeSqlNonQuery(sql);
        }
Пример #2
0
        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.");
            }
        }
Пример #3
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());
 }