plmercereau/platyplus

View on GitHub

Showing 12 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

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    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

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          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

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          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

              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

                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

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                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

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Severity
                Category
                Status
                Source
                Language