2import NavBar from "../components/nav.js";
3import Footer from "../components/footer.js";
4import { darkMode } from "../globalStates/theme.js";
5import { getCookie, setCookie } from 'cookies-next'; 6import redirect from 'nextjs-redirect';
7
8export default function User(props) {
1import Head from 'next/head';
2import Link from "next/link"; 3import Footer from "../components/footer.js";
4import NavBar from "../components/nav.js";
5import { darkMode } from "../globalStates/theme.js";
1import Head from 'next/head';
2import Link from "next/link"; 3import Footer from "../components/footer.js";
4import NavBar from "../components/nav.js";
5import { darkMode } from "../globalStates/theme.js";
9import styles from "../components/page.module.css";
10
11export default function Home(props) {
12 const [triggerRefresh, setTriggerRefresh] = useState(0);13 return (
14 <div className={`${(darkMode % 2) ? "dark" : ""}`}>
15 <div className="transition ease-in-out flex flex-col min-h-screen w-full bg-zinc-100 dark:bg-zinc-700 dark:text-neutral-200">
9import styles from "../components/page.module.css";
10
11export default function Home(props) {
12 const [triggerRefresh, setTriggerRefresh] = useState(0);13 return (
14 <div className={`${(darkMode % 2) ? "dark" : ""}`}>
15 <div className="transition ease-in-out flex flex-col min-h-screen w-full bg-zinc-100 dark:bg-zinc-700 dark:text-neutral-200">
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular
text/javascript
scripts. Currently, we don't support variables that are not explicitly exported, and are injected into other scripts by being included in an HTML file
Unused variables are most often the result of incomplete refactoring. They can lead to confusing code and minor performance hitches.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
// Write-only variables are not considered as used.
let y = 10;
y = 5;
// A variable that modifies only itself isn't considered used.
let z = 0;
z = z + 1;
// Unused argument
(function(x) {
return 5;
})();
// Unused recursive functions also raise this issue.
function fact(n) {
if (n < 2) return 1;
return n * fact(n - 1);
}
// When a function definition destructures an array,
// unused entries from the array also cause warnings.
function getY([x, y]) {
return y;
}
let x = 10;
alert(x);
((arg1) => {
return arg1;
})();
let myFunc;
myFunc = (n) => {
// this is legal
if (n < 0) myFunc();
};
// this is also considered legal
console.log(declaredLater);
var declaredLater;
// Only the second argument from the descructured array is used.
function getY([, y]) {
return y;
}