Skip to content

Instantly share code, notes, and snippets.

@Ruffo324
Last active July 24, 2020 15:19
Show Gist options
  • Save Ruffo324/71617a92e3907fd15d9a04dabc189bf3 to your computer and use it in GitHub Desktop.
Save Ruffo324/71617a92e3907fd15d9a04dabc189bf3 to your computer and use it in GitHub Desktop.
Views the total added lines in the gitlab merge-review page.
// Open the Merge-Review, navigate to the "Changes (x)" tab, and paste the following code into the developer console.
var totalRemoved = 0;
var totalAdded = 0;
for(var i = 0; i < $(".file-row-stats > .cgreen").length; i++)
{
totalAdded += parseInt($(".file-row-stats > .cgreen")[i].innerText);
totalRemoved += parseInt($(".file-row-stats > .cred")[i].innerText);
}
console.log(`Added: \t\t${totalAdded}\nRemoved: \t${totalRemoved}\nTotal: \t\t${totalAdded + totalRemoved}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment