File provider.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring.
'use babel'
import APRIMITIVES from '../../data/primitives.json'
import AATTRIBUTES from '../../data/attributes.json'
import ACOMPONENTS from '../../data/components.json'
Function buildMappingAttributeCompletion
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
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) {
AutocompleteProvider
has 22 functions (exceeds 20 allowed). Consider refactoring.
export class AutocompleteProvider {
constructor () {
this.selector = '.text.html, .source.js'
Function listen
has 45 lines of code (exceeds 25 allowed). Consider refactoring.
listen (cp) {
if (!this.subscriptions) {
this.subscriptions = new CompositeDisposable()
} else {
this.subscriptions.dispose()
Function buildMappingAttributeCompletion
has 43 lines of code (exceeds 25 allowed). Consider refactoring.
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) {
Function getComponentOrAttributeNameCompletions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
getComponentOrAttributeNameCompletions ({ prefix, editor, bufferPosition }) {
const completions = []
const tag = this.getPreviousTag(editor, bufferPosition)
const tagAttributes = this.getTagAttributes(tag)
Function check
has 38 lines of code (exceeds 25 allowed). Consider refactoring.
check () {
this.clear()
return new Promise((resolve, reject) => {
let c
if (this.pkgj.existsSync()) {
Similar blocks of code found in 2 locations. Consider refactoring.
static openWebsite () {
return atom.commands.add(
'atom-workspace',
'atom-aframe:open-website',
() => {
Similar blocks of code found in 2 locations. Consider refactoring.
static openGithub () {
return atom.commands.add(
'atom-workspace',
'atom-aframe:open-github',
() => {
Function getComponentOrAttributeNameCompletions
has 35 lines of code (exceeds 25 allowed). Consider refactoring.
getComponentOrAttributeNameCompletions ({ prefix, editor, bufferPosition }) {
const completions = []
const tag = this.getPreviousTag(editor, bufferPosition)
const tagAttributes = this.getTagAttributes(tag)
Function isComponentOrAttributeStart
has 28 lines of code (exceeds 25 allowed). Consider refactoring.
isComponentOrAttributeStart ({
prefix,
scopeDescriptor,
bufferPosition,
editor
Function getComponentValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
getComponentValue (component) {
if (component.value != null) {
return component.value
}
if (this.componentDefaults) {
Function updateVersions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
async function updateVersions (npmData) {
console.info('updating versions...')
const versions = {}
let docsVer = 'master'