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'
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) {
- Read upRead up
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'
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()
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) {
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)
- Read upRead up
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()) {
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)
Function isComponentOrAttributeStart
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
isComponentOrAttributeStart ({
prefix,
scopeDescriptor,
bufferPosition,
editor
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) {
- Read upRead up
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'
- Read upRead up
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"