mkungla/atom-aframe

View on GitHub

Showing 11 of 13 total issues

File provider.js has 359 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use babel'

import APRIMITIVES from '../../data/primitives.json'
import AATTRIBUTES from '../../data/attributes.json'
import ACOMPONENTS from '../../data/components.json'
Severity: Minor
Found in src/autocomplete/provider.js - About 4 hrs to fix

    Function buildMappingAttributeCompletion has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

      buildMappingAttributeCompletion (attribute, tag, options, v) {
        let description, value, url, cp
        if (this.attributeDefaults) {
          value = v != null && typeof v !== 'undefined' ? v.value : null
          if (value == null && options != null && options.mapping != null) {
    Severity: Minor
    Found in src/autocomplete/provider.js - About 2 hrs 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

    AutocompleteProvider has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class AutocompleteProvider {
      constructor () {
        // selector (required): Defines the scope selector(s) (can be comma-separated)
        // for which your provider should receive suggestion requests
        this.selector = '.text.html, .source.js'
    Severity: Minor
    Found in src/autocomplete/provider.js - About 2 hrs to fix

      Function listen has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        listen (cp) {
          if (!this.subscriptions) {
            this.subscriptions = new CompositeDisposable()
          } else {
            this.subscriptions.dispose()
      Severity: Minor
      Found in src/pjw.js - About 1 hr to fix

        Function buildMappingAttributeCompletion has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          buildMappingAttributeCompletion (attribute, tag, options, v) {
            let description, value, url, cp
            if (this.attributeDefaults) {
              value = v != null && typeof v !== 'undefined' ? v.value : null
              if (value == null && options != null && options.mapping != null) {
        Severity: Minor
        Found in src/autocomplete/provider.js - About 1 hr to fix

          Function getComponentOrAttributeNameCompletions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

            getComponentOrAttributeNameCompletions ({ prefix, editor, bufferPosition }) {
              const completions = []
              const tag = this.getPreviousTag(editor, bufferPosition)
              const tagAttributes = this.getTagAttributes(tag)
          
          
          Severity: Minor
          Found in src/autocomplete/provider.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 check has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            check () {
              this.clear()
              return new Promise((resolve, reject) => {
                let c
                if (this.pkgj.existsSync()) {
          Severity: Minor
          Found in src/pjw.js - About 1 hr to fix

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

              getComponentOrAttributeNameCompletions ({ prefix, editor, bufferPosition }) {
                const completions = []
                const tag = this.getPreviousTag(editor, bufferPosition)
                const tagAttributes = this.getTagAttributes(tag)
            
            
            Severity: Minor
            Found in src/autocomplete/provider.js - About 1 hr to fix

              Function isComponentOrAttributeStart has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                isComponentOrAttributeStart ({
                  prefix,
                  scopeDescriptor,
                  bufferPosition,
                  editor
              Severity: Minor
              Found in src/autocomplete/provider.js - About 1 hr to fix

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

                  getComponentValue (component) {
                    if (component.value != null) {
                      return component.value
                    }
                    if (this.componentDefaults) {
                Severity: Minor
                Found in src/autocomplete/provider.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

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

                async function updateVersions (npmData) {
                  console.info('updating versions...')
                  const versions = {}
                  let docsVer = 'master'
                
                
                Severity: Minor
                Found in scripts/update.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