Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1430,8 +1430,10 @@ function finalizeFooterDot(core, ping) {
document.getElementById("footer-surge-button").style.cursor = "default";
}

// Re-initialize skills after Surprise scroll or any DOM changes
window.addEventListener("DOMContentLoaded", () => {
/**
* INITIALIZATION
*/
document.addEventListener("DOMContentLoaded", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function has a cyclomatic complexity of 8 with "medium" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

initSkillXP();

const unlockedEggs = JSON.parse(localStorage.getItem("unlockedEggs") || "[]");
Expand All @@ -1441,12 +1443,7 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("footer-dot-ping"),
);
}
});

/**
* INITIALIZATION
*/
document.addEventListener("DOMContentLoaded", () => {
const devToolsVisible = localStorage.getItem("devToolsVisible") === "true";
const devPanel = document.getElementById("dev-tools");

Expand Down