Function install
has 52 lines of code (exceeds 25 allowed). Consider refactoring.
install (Vue) {
Vue.processQueue = () => {
setImmediate(function () {
const queue = store.state.graphqlModule.mutationsQueue
if (!store.state.graphqlModule.mutationsQueueLock && !_.isEmpty(queue)) {
Function install
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
install (Vue) {
Vue.processQueue = () => {
setImmediate(function () {
const queue = store.state.graphqlModule.mutationsQueue
if (!store.state.graphqlModule.mutationsQueueLock && !_.isEmpty(queue)) {
Function itemManager
has 47 lines of code (exceeds 25 allowed). Consider refactoring.
export function itemManager (config) {
let itemName = config.itemName || config.singleQuery.definitions[0].selectionSet.selections[0].name.value
return function () {
let fullConfig = _.clone(config)
fullConfig.itemName = config.itemName || config.singleQuery.definitions[0].selectionSet.selections[0].name.value
Function install
has 35 lines of code (exceeds 25 allowed). Consider refactoring.
install (Vue) {
if (localStorage.getItem(AUTH_TOKEN)) {
apolloClient.query({query: ME_QUERY}).then((res) => {
store.commit(types.SET_USER, res.data.me)
})
Function defineAbilitiesFor
has 31 lines of code (exceeds 25 allowed). Consider refactoring.
export default function defineAbilitiesFor (user) {
return AbilityBuilder.define(
{ subjectName },
can => {
if (user && user.username) {
Function refetch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
refetch (itemName, immediate = true) {
let itName = getItemName(this, itemName)
if ((REFETCH_ATTEMPS === -1) || ((this.config[itName].intervalCount || 0) < REFETCH_ATTEMPS)) {
this.loading += 1
this.config[itName].intervalCount = (this.config[itName].intervalCount || 0) + 1
Function timeDifference
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
function timeDifference (current, previous) {
const milliSecondsPerMinute = 60 * 1000
const milliSecondsPerHour = milliSecondsPerMinute * 60
const milliSecondsPerDay = milliSecondsPerHour * 24
const milliSecondsPerMonth = milliSecondsPerDay * 30
Avoid too many return
statements within this function.
return Math.round(elapsed / milliSecondsPerMonth) + ' mo ago'
Avoid too many return
statements within this function.
return Math.round(elapsed / milliSecondsPerYear) + ' years ago'
Avoid too many return
statements within this function.
return Math.round(elapsed / milliSecondsPerDay) + ' days ago'
Function cssLoaders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {