weareopensource/Node

View on GitHub
modules/auth/config/strategies/apple.js

Summary

Maintainability
A
0 mins
Test Coverage

Showing 0 of 3 total issues

Function prepare has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Wontfix

const prepare = async (req, accessToken, refreshToken, decodedIdToken, profile, cb) => {
// Set the provider data and include tokens
const providerData = decodedIdToken;
providerData.appleProfile = req.appleProfile;
providerData.accessToken = accessToken || null;
Severity: Minor
Found in modules/auth/config/strategies/apple.js - About 35 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Wontfix

const callbackURL = `${config.api.protocol}://${config.api.host}${config.api.port ? ':' : ''}${config.api.port ? config.api.port : ''}/${
config.api.base
}/auth/apple/callback`;
Severity: Major
Found in modules/auth/config/strategies/apple.js and 1 other location - About 2 hrs to fix
modules/auth/config/strategies/google.js on lines 10..12

Similar blocks of code found in 2 locations. Consider refactoring.
Wontfix

try {
const user = await auth.checkOAuthUserProfile(_profile, 'sub', 'apple');
return cb(null, user);
} catch (err) {
return cb(err);
Severity: Minor
Found in modules/auth/config/strategies/apple.js and 1 other location - About 45 mins to fix
modules/auth/config/strategies/google.js on lines 36..41

There are no issues that match your filters.

Category
Status