Skip to content

Commit

Permalink
Add commit network to showcase
Browse files Browse the repository at this point in the history
show how to construct commit network in showcase. Also fixed bug that
resulted in showcase crashing.

Signed-off-by: Leo Sendelbach <s8lesend@stud.uni-saarland.de>
  • Loading branch information
Leo-Send committed May 29, 2024
1 parent 15f373a commit ca6ebbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion showcase.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
## Copyright 2021 by Niklas Schneider <s8nlschn@stud.uni-saarland.de>
## Copyright 2022 by Jonathan Baumann <joba00002@stud.uni-saarland.de>
## Copyright 2024 by Maximilian Löffler <s8maloef@stud.uni-saarland.de>
## Copyright 2024 by Leo Sendelbach <s8lesend@stud.uni-saarland.de>
## All Rights Reserved.


Expand Down Expand Up @@ -65,6 +66,7 @@ ARTIFACT = "feature" # function, feature, file, featureexpression (only relevant

AUTHOR.RELATION = "mail" # mail, cochange, issue
ARTIFACT.RELATION = "cochange" # cochange, callgraph, mail, issue
COMMIT.RELATION = "commit.interaction" # commit.interaction, cochange


## / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
Expand All @@ -73,13 +75,16 @@ ARTIFACT.RELATION = "cochange" # cochange, callgraph, mail, issue
## initialize project configuration
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT)
proj.conf$update.value("commits.filter.base.artifact", TRUE)
proj.conf$update.value("commit.interactions", TRUE)
## specify that custom event timestamps should be read from 'custom-events.list'
proj.conf$update.value("custom.event.timestamps.file", "custom-events.list")
proj.conf$print()

## initialize network configuration
net.conf = NetworkConf$new()
net.conf$update.values(updated.values = list(author.relation = AUTHOR.RELATION, artifact.relation = ARTIFACT.RELATION))
net.conf$update.values(updated.values = list(author.relation = AUTHOR.RELATION,
artifact.relation = ARTIFACT.RELATION,
commit.relation = COMMIT.RELATION))
net.conf$print()

## get ranges
Expand Down Expand Up @@ -141,6 +146,7 @@ x$get.author.network()
x$update.network.conf(updated.values = list(author.directed = FALSE))
x$get.author.network()
x$get.artifact.network()
x$get.commit.network()
x$reset.environment()
x$get.networks()
x$update.network.conf(updated.values = list(author.only.committers = FALSE, author.directed = FALSE))
Expand Down Expand Up @@ -201,6 +207,7 @@ y$update.network.conf(updated.values = list(edge.attributes = c("date")))
y$get.author.network()
y$update.network.conf(updated.values = list(edge.attributes = c("hash")))
y$get.artifact.network()
y$get.commit.network()
y$get.networks()
y$update.network.conf(updated.values = list(author.only.committers = FALSE, author.directed = TRUE))
h = y$get.bipartite.network()
Expand Down
2 changes: 1 addition & 1 deletion util-networks.R
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ NetworkBuilder = R6::R6Class("NetworkBuilder",
logging::logdebug("get.commit.network.cochange: starting.")

## do not compute anything more than once
if (!is.null(private$artifacts.network.cochange)) {
if (!is.null(private$commit.network.cochange)) {
logging::logdebug("get.commit.network.cochange: finished. (already existing)")
return(private$commit.network.cochange)
}
Expand Down

0 comments on commit ca6ebbb

Please sign in to comment.