Skip to content

Commit c04c011

Browse files
committed
improved sut table
1 parent 5d2d159 commit c04c011

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

statistics/analyze.R

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ markdown <- function (){
6464
}
6565

6666

67-
latex <- function(TABLE,SUTS,auth){
67+
latex <- function(TABLE,SUTS,auth, databases){
6868

6969
# TODO what columns to include further could be passed as boolean selection.
7070
# will implement when needed
@@ -76,9 +76,15 @@ latex <- function(TABLE,SUTS,auth){
7676
unlink(TABLE)
7777
sink(TABLE, append = TRUE, split = TRUE)
7878

79-
cat("\\begin{tabular}{l rrrr}\\\\ \n")
79+
cat("\\begin{tabular}{l rrr")
80+
if(auth) cat("r")
81+
if(databases) cat("r")
82+
cat("}\\\\ \n")
8083
cat("\\toprule \n")
81-
cat("SUT & \\#SourceFiles & \\#LOCs & \\#Endpoints & Auth\\\\ \n")
84+
cat("SUT & \\#SourceFiles & \\#LOCs & \\#Endpoints ")
85+
if(auth) cat("& Auth")
86+
if(databases) cat("& Databases")
87+
cat("\\\\ \n")
8288
cat("\\midrule \n")
8389

8490
for (i in 1:nrow(dt)){
@@ -90,9 +96,14 @@ latex <- function(TABLE,SUTS,auth){
9096
cat(" & ", row$LOCS)
9197
cat(" & ", row$ENDPOINTS)
9298

93-
cat(" & ")
94-
if(row$AUTHENTICATION){
99+
if(auth){
100+
cat(" & ")
101+
if(row$AUTHENTICATION){
95102
cat("\\checkmark")
103+
}
104+
}
105+
if(databases){
106+
cat(" & ",row$DATABASE)
96107
}
97108

98109
cat(" \\\\ \n")
@@ -106,8 +117,14 @@ latex <- function(TABLE,SUTS,auth){
106117
cat(sum(dt$LOCS))
107118
cat(" & ")
108119
cat(sum(dt$ENDPOINTS))
109-
cat(" & ")
110-
cat(sum(dt$AUTHENTICATION))
120+
if(auth){
121+
cat(" & ")
122+
cat(sum(dt$AUTHENTICATION))
123+
}
124+
if(databases){
125+
cat(" & ")
126+
cat(sum(!is.na(dt$DATABASE) & trimws(dt$DATABASE) != ""))
127+
}
111128

112129
cat(" \\\\ \n")
113130

statistics/data.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ TRUE,restcountries,REST,Java,JDK 8,Maven,24,1977,,MPL,22,FALSE,https://github.co
2828
TRUE,scout-api,REST,Java,JDK 8,Maven,93,9736,H2,MIT,49,TRUE,https://github.com/mikaelsvensson/scout-api
2929
TRUE,spring-actuator-demo,REST,Java,JDK 8,Maven,5,117,,UNDEFINED,2,TRUE,https://github.com/callicoder/spring-boot-actuator-demo
3030
TRUE,spring-batch-rest,REST,Java,JDK 8,Maven,65,3668,,Apache,5,FALSE,https://github.com/chrisgleissner/spring-batch-rest
31-
TRUE,spring-ecommerce,REST,Java,JDK 8,Maven,58,2223,MongoOB;Redis;Elasticsearch,UNDEFINED,26,TRUE,https://github.com/SaiUpadhyayula/SpringAngularEcommerce
31+
TRUE,spring-ecommerce,REST,Java,JDK 8,Maven,58,2223,MongoDB;Redis;Elasticsearch,UNDEFINED,26,TRUE,https://github.com/SaiUpadhyayula/SpringAngularEcommerce
3232
TRUE,spring-rest-example,REST,Java,JDK 17,Maven,32,1426,MySQL,MIT,9,FALSE,https://github.com/phantasmicmeans/spring-boot-restful-api-example
3333
TRUE,swagger-petstore,REST,Java,JDK 8,Maven,23,1631,,Apache,19,FALSE,https://github.com/swagger-api/swagger-petstore
3434
TRUE,genome-nexus,REST,Java,JDK 8,Maven,405,30004,MongoDB,MIT,23,FALSE,https://github.com/genome-nexus/genome-nexus

statistics/suts.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ suts <- function(){
6161
""
6262
)
6363

64-
latex(TABLE,SUTS)
64+
latex(TABLE,SUTS,TRUE,TRUE)
6565
}
6666

0 commit comments

Comments
 (0)