122 }
123}
124
125exports.getUserByEmail = async (request, reply) => {126 try {
127 return await userServices.getUserByEmail(request.params.email)
128 } catch (err) {
114 }
115}
116
117exports.logoutUser = async (request, reply) => {118 try {
119 return await userServices.logoutUser(request.body)
120 } catch (err) {
89 }
90}
91
92exports.loginUser = async (request, reply) => { 93 try {
94 const { email, password } = request.body
95 const user = await userServices.getUserByEmail(email)
81 }
82}
83
84exports.deleteUserAll = async (request, reply) => { 85 try {
86 return await userServices.deleteUserAll()
87 } catch (err) {
81 }
82}
83
84exports.deleteUserAll = async (request, reply) => { 85 try {
86 return await userServices.deleteUserAll()
87 } catch (err) {
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;
}