app/frontend/src/plugins/keycloak.js
Showing 7 of 7 total issues
Function init
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init(config, watch, options) { const ctor = sanitizeConfig(config); const keycloak = Keycloak(ctor); watch.$once('ready', function (cb) {
Function install
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
install: function (Vue, params = {}) { if (installed) return; installed = true; const defaultParams = {
Function data
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data() { return { ready: false, authenticated: false, userName: null,
Function updateWatchVariables
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateWatchVariables(isAuthenticated = false) { watch.authenticated = isAuthenticated; watch.loginFn = keycloak.login; watch.login = keycloak.login; watch.createLoginUrl = keycloak.createLoginUrl;
Function assertOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
function assertOptions(options) { const { config, init, onReady, onInitError } = options; if (typeof config !== 'string' && !_isObject(config)) { return { hasError: true, error: `'config' option must be a string or an object. Found: '${config}'` }; }
- Read upRead up
Avoid too many return
statements within this function. Open
Open
return { hasError: false, error: null };
Parsing error: 'import' and 'export' may appear only with 'sourceType: module' Open
Open
import Keycloak from 'keycloak-js';
- Read upRead up
- Exclude checks