Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save the information about SATD removal and refactoring #15

Open
EmanAlOmar opened this issue Apr 4, 2021 · 0 comments
Open

Save the information about SATD removal and refactoring #15

EmanAlOmar opened this issue Apr 4, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@EmanAlOmar
Copy link

Automatically saving the results that combine the SATD comments with refactoring in one table. Currently, the below query needs to be run after crawling the data to get the information about refactoring and the SATD comments.

Set
@projectid = 1;
SELECT
SecondCommit.commit_hash as resolution_commit,
SATD.satd_id,
-- SATD.resolution as satdResolution,
FirstFile.f_comment as removed_SATD_comment,
FirstFile.f_path,
FirstFile.containing_class,
FirstFile.containing_method,
datediff(DATE(endCommit.commit_date), DATE(startCommit.commit_date)) as daysAlive,
IF(startCommit.author_email = endCommit.author_email,'Yes','No') as resolvedBySameAuthor,
RefactoringsRMV.refactoringID,
RefactoringsRmv.type as refactoring_type,
RefactoringsRMV.description as refactoring_description
FROM
satd.SATD
INNER JOIN
satd.SATDInFile as FirstFile
ON SATD.first_file = FirstFile.f_id
INNER JOIN
satd.SATDInFile as SecondFile
ON SATD.second_file = SecondFile.f_id
INNER JOIN
satd.Commits as FirstCommit
ON SATD.first_commit = FirstCommit.commit_hash
AND SATD.p_id = FirstCommit.p_id
INNER JOIN
satd.Commits as SecondCommit
ON SATD.second_commit = SecondCommit.commit_hash
AND SATD.p_id = SecondCommit.p_id
INNER JOIN
satd.Projects
ON SATD.p_id = Projects.p_id
INNER JOIN
satd.RefactoringsRMV
ON RefactoringsRmv.commit_hash = SecondCommit.commit_hash
INNER JOIN
satd.Commits as startCommit ON startCommit.commit_hash = SATD.first_commit
INNER JOIN
satd.Commits as endCommit ON endCommit.commit_hash = SATD.second_commit
WHERE
(Projects.p_id = @projectid )

AND SATD.resolution = "SATD_REMOVED"
ORDER BY SATD.satd_id

@EmanAlOmar EmanAlOmar added the enhancement New feature or request label Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant