plmercereau/platyplus

View on GitHub

Showing 23 of 24 total issues

Function install has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

install (Vue) {
Vue.processQueue = () => {
setImmediate(function () {
const queue = store.state.graphqlModule.mutationsQueue
if (!store.state.graphqlModule.mutationsQueueLock && !_.isEmpty(queue)) {
Severity: Major
Found in src/plugins/graphql-helper.js - About 2 hrs to fix

    Function install has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    install (Vue) {
    Vue.processQueue = () => {
    setImmediate(function () {
    const queue = store.state.graphqlModule.mutationsQueue
    if (!store.state.graphqlModule.mutationsQueueLock && !_.isEmpty(queue)) {
    Severity: Minor
    Found in src/plugins/graphql-helper.js - About 1 hr to fix

    Function itemManager has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    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
    Severity: Minor
    Found in src/mixins/dataItem.js - About 1 hr to fix

      Function install has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      install (Vue) {
      if (localStorage.getItem(AUTH_TOKEN)) { // TODO DRY as it is used elsewhere
      apolloClient.query({query: ME_QUERY}).then((res) => {
      store.commit(types.SET_USER, res.data.me)
      })
      Severity: Minor
      Found in src/plugins/auth.js - About 1 hr to fix

        Function defineAbilitiesFor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function defineAbilitiesFor (user) {
        return AbilityBuilder.define(
        { subjectName },
        can => {
        if (user && user.username) {
        Severity: Minor
        Found in src/constants/ability.js - About 1 hr to fix

          Function refetch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          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
          Severity: Minor
          Found in src/mixins/dataItem.js - About 45 mins to fix

          Function timeDifference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function timeDifference (current, previous) {
          const milliSecondsPerMinute = 60 * 1000
          const milliSecondsPerHour = milliSecondsPerMinute * 60
          const milliSecondsPerDay = milliSecondsPerHour * 24
          const milliSecondsPerMonth = milliSecondsPerDay * 30
          Severity: Minor
          Found in src/utils/index.js - About 35 mins to fix

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

          if (this.config[itName].upsertMutation) this.$set(this.formData, this.config[itName].formDataName, dataToForm(this[itName], this.config[itName]))
          Severity: Minor
          Found in src/mixins/dataItem.js and 2 other locations - About 35 mins to fix
          src/mixins/dataItem.js on lines 29..29
          src/mixins/dataItem.js on lines 38..38

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

          this.$set(this.formData, this.config[itName].formDataName, dataToForm(this[itName], this.config[itName]))
          Severity: Minor
          Found in src/mixins/dataItem.js and 2 other locations - About 35 mins to fix
          src/mixins/dataItem.js on lines 29..29
          src/mixins/dataItem.js on lines 57..57

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

          this.$set(this.formData, this.config[itName].formDataName, dataToForm(this[itName], this.config[itName]))
          Severity: Minor
          Found in src/mixins/dataItem.js and 2 other locations - About 35 mins to fix
          src/mixins/dataItem.js on lines 38..38
          src/mixins/dataItem.js on lines 57..57

          Avoid too many return statements within this function.
          Open

          return Math.round(elapsed / milliSecondsPerYear) + ' years ago'
          Severity: Major
          Found in src/utils/index.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return Math.round(elapsed / milliSecondsPerDay) + ' days ago'
            Severity: Major
            Found in src/utils/index.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return Math.round(elapsed / milliSecondsPerMonth) + ' mo ago'
              Severity: Major
              Found in src/utils/index.js - About 30 mins to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                if (ability.can(to.meta.action || 'route', {type: to.meta.type})) return next()
                Severity: Minor
                Found in src/router/index.js and 1 other location - About 30 mins to fix
                src/router/index.js on lines 110..110

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                if (ability.can(to.meta.action || 'route', {type: to.meta.type})) return next()
                Severity: Minor
                Found in src/router/index.js and 1 other location - About 30 mins to fix
                src/router/index.js on lines 106..106

                Function cssLoaders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.cssLoaders = function (options) {
                options = options || {}
                 
                const cssLoader = {
                loader: 'css-loader',
                Severity: Minor
                Found in build/utils.js - About 25 mins to fix

                Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = function () {
                const warnings = []
                for (let i = 0; i < versionRequirements.length; i++) {
                const mod = versionRequirements[i]
                if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
                Severity: Minor
                Found in build/check-versions.js - About 25 mins to fix

                Expected indentation of 12 spaces but found 14.
                Open

                ownedBy: {
                Severity: Minor
                Found in src/constants/ability.js by eslint

                Line length
                Open

                For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
                Severity: Info
                Found in README.md by markdownlint

                Expected indentation of 10 spaces but found 12.
                Open

                {
                Severity: Minor
                Found in src/constants/ability.js by eslint
                Severity
                Category
                Status
                Source
                Language