Showing 20 of 39 total issues
File node.js
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { markNodeData, NODE_KEY } from './util'
const objectAssign = Object.assign
const reInitChecked = function (node) {
Store
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Store {
constructor (options) {
this.currentNode = null
this.currentNodeKey = null
Function alert
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
const alert = (options) => {
const {title, message, effect, type, width, onConfirm, onHide, onShow} = options
const alert = new Vue({
el: createNode(),
mixins: [localeMixin('n3Modal')],
Function constructor
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
constructor (options) {
this.id = nodeIdSeed++
this.text = null
this.checked = false
this.indeterminate = false
- 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 confirm
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
const confirm = (options) => {
const {title, message, effect, type, width, onConfirm, onHide, onShow} = options
const confirm = new Vue({
el: createNode(),
data () {
Function constructor
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (options) {
this.id = nodeIdSeed++
this.text = null
this.checked = false
this.indeterminate = false
Function alert
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const alert = (options) => {
const {description, type, dismissable, duration, width, small, placement, message, content, icon} = options
let containerClass = 'n3-alert-container-' + (placement || 'top')
let container = document.querySelector('.' + containerClass)
Function mounted
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
mounted () {
if (!this.$refs.popover) return
this.$nextTick(() => {
let popover = this.$refs.popover
Function setChecked
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
setChecked (value, deep) {
this.indeterminate = value === 'half'
this.checked = value === true
const handleDescendants = () => {
- 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 filter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
filter (value) {
const filterNodeMethod = this.filterNodeMethod
const traverse = function (node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes
- 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 reInitChecked
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const reInitChecked = function (node) {
const siblings = node.childNodes
let all = true
let none = true
- 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 resize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
resize () {
let popover = this.$refs.popover
let triger = this.$refs.trigger.children[0]
popover.style.display = 'block'
triger.style.position = 'relative'
Function expand
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
expand (callback, expandParent) {
const done = () => {
if (expandParent) {
let parent = this.parent
while (parent.level > 0) {
- 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 calPosition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const calPosition = function (el) {
let w = el.offsetWidth
let h = el.offsetHeight
let x = getLeft(el) - document.body.scrollLeft
let y = getTop(el) - document.body.scrollTop
- 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 loadData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
loadData (callback, defaultProps = {}) {
if (this.store.lazy === true && this.store.load && !this.loaded && !this.loading) {
this.loading = true
const resolve = (children) => {
- 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 dispatch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
dispatch (componentName, eventName, params) {
var parent = this.$parent || this.$root
var name = parent.$options.name
while (parent && (!name || name !== componentName)) {
- 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 dispatch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
dispatch(componentName, eventName, params) {
var parent = this.$parent || this.$root;
var name = parent.$options.componentName;
while (parent && (!name || name !== componentName)) {
- 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 alert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const alert = (options) => {
const {description, type, dismissable, duration, width, small, placement, message, content, icon} = options
let containerClass = 'n3-alert-container-' + (placement || 'top')
let container = document.querySelector('.' + containerClass)
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor (options) {
this.currentNode = null
this.currentNodeKey = null
for (let option in options) {
- 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 setData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
setData (data) {
if (!Array.isArray(data)) {
markNodeData(this, data)
}
- 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"