Showing 22 of 40 total issues
File script.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* This component made by Sagalbot
*
* https://github.com/sagalbot/vue-select
*/
Function getJSON
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function getJSON (url, header = []) {
let request = new window.XMLHttpRequest()
let data = {}
// p (-simulated- promise)
let p = {
- 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
`` has 23 functions (exceeds 20 allowed). Consider refactoring. Open
methods: {
close () {
this.displayDayView = this.displayMonthView = this.displayYearView = false
},
inputClick () {
File script.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import translations from '../_texts/translations.js'
export default {
props: {
value: {type: String},
Function setItems
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
setItems (data) {
if (this.async) {
this.items = this.asyncKey ? data[this.asyncKey] : data
this.items = this.items.slice(0, this.limit)
} else {
- 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 transition
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
transition (val, old) {
if (val === old) { return }
const el = this.$el
const body = document.body
if (val) {
- 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 getJSON
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function getJSON (url, header = []) {
let request = new window.XMLHttpRequest()
let data = {}
// p (-simulated- promise)
let p = {
Function beforeDestroy
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
beforeDestroy () {
if (this._tabGroup) {
this._tabGroup.tabs = this._tabGroup.tabs.filter(el => el !== this)
}
if (this._tabs) {
- 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 checkScroll
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
checkScroll () {
// if is hidden don't calculate anything
if (!(this.$el.offsetWidth || this.$el.offsetHeight || this.$el.getClientRects().length)) {
return
}
- 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 show
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
show (val) {
this.$emit('input', val)
this.$emit(this.show ? 'open' : 'close')
const body = document.body
const scrollBarWidth = getScrollBarWidth()
Function position
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
position () {
let popover = this.$refs.popover
let trigger = this.$refs.trigger.children[0]
this.$nextTick(() => {
if (trigger && popover) {
Function created
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
created () {
this._isTab = true
let tabs = this
while (!this._tabs && tabs.$parent) {
if (tabs._isTabGroup) {
- 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 action
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
action (val, p) {
if (this.sem) {
if (val === null) { return }
this.sem = false
if (val && this.callback instanceof Function) this.callback()
- 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 select
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
select (option) {
if (this.isOptionSelected(option)) {
this.deselect(option)
} else {
if (this.taggable && !this.optionExists(option)) {
- 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 toggleDropdown
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
toggleDropdown (e) {
if (e.target === this.$refs.openIndicator || e.target === this.$refs.search || e.target === this.$refs.toggle || e.target === this.$el) {
if (this.open) {
this.$refs.search.blur() // dropdown will close on blur
} else {
- 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 boolean
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
boolean: val => {
if (typeof val === 'string') {
if (val === '' || val === 'true') {
return 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 mutableValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
mutableValue (val, old) {
if (this.multiple) {
this.onChange ? this.onChange(val) : null
} else {
this.onChange && val !== old ? this.onChange(val) : 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
Function show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
show (val) {
this.$emit('input', val)
this.$emit(this.show ? 'open' : 'close')
const body = document.body
const scrollBarWidth = getScrollBarWidth()
- 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 show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
show (options) {
if (options) {
if (options.text) { this.text = options.text }
if (options.size) { this.size = options.size }
if (options.fixed) { this.fixed = options.fixed }
- 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 rangeLength42
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
rangeLength42 () {
if (this.dateRange.length < 42) {
const nextMonthNeed = 42 - this.dateRange.length
const nextMonth = this.getYearMonth(this.setupRange.year, this.setupRange.month + 1)
- 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"