1import { setCookie, getCookie, getCookies } from 'cookies-next'; 2import jwt from "jsonwebtoken";
3import { Redis } from "@upstash/redis";
4import nodemailer from "nodemailer";
1import Head from 'next/head';
2import { useRouter } from 'next/router'
3import NavBar from "../../../components/nav.js";
4import Footer from "../../../components/footer.js"; 5import { darkMode } from "../../../globalStates/theme.js";
6import useSWR from 'swr';
7
1import Head from 'next/head';
2import { useRouter } from 'next/router'
3import NavBar from "../../../components/nav.js"; 4import Footer from "../../../components/footer.js";
5import { darkMode } from "../../../globalStates/theme.js";
6import useSWR from 'swr';
1import Head from 'next/head'; 2import { useRouter } from 'next/router'
3import NavBar from "../../../components/nav.js";
4import Footer from "../../../components/footer.js";
7
8const fetcher = (...args) => fetch(...args).then(res => res.json());
9
10function capitalizeFirstLetter(string) {11 return string.charAt(0).toUpperCase() + string.slice(1);
12}
13
Found variables that are declared but not used anywhere.
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.
var y = 10;
y = 5;
// A variable that modifies only itself isn't considered used.
var 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;
}
var 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;
}