Showing 170 of 392 total issues
Function mergeMDay
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
mergeMDay (source, min) {
let out = []
if (source !== undefined && !isEmptyArray(source.value)) {
out = copyArrayOfDeep(source.value)
Function checkLayout
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function checkLayout (layout) {
const scale = _systemInfo.scale
layout.margin.top *= scale
layout.margin.left *= scale
layout.margin.bottom *= scale
Function onPaint
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
onPaint (key) {
if (key !== undefined) this.hotKey = key
this.data = this.source.getData(this.hotKey)
if (this.info.labelX === undefined) this.info.labelX = 'time'
Function matchDayToMon
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function matchDayToMon (daydata) {
let month
const out = []
const zipday = []
Function matchDayToWeek
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function matchDayToWeek (daydata) {
const out = []
const zipday = []
const field = FIELD_DAY
Function getMoveData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getMoveData (index) {
let lines = this.config.lines
const out = []
if (!Array.isArray(lines)) return out
- 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 formatInfo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function formatInfo (value, format, coindot, volzoom, middle) {
let out
if (format === 'rate') {
out = formatRate(value, middle)
} 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 emitEvent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
emitEvent (eventName, config) {
const event = copyJsonOfDeep(config)
const mousePos = this.getMousePos(config)
// 这里生成一个相对鼠标位置
event.mousePos = {
- 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 beforeLocation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
beforeLocation () {
this.linkInfo.rightMode = 'forword'
this.data = this.source.getData(this.father.hotKey)
const lastDate = this.data.value[this.data.value.length - 1][this.data.fields.time]
- 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 drawReports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
drawReports () {
if (this.reportData === undefined || this.reportData.value.length < 1) return
const maxlines = Math.floor(this.rectReport.height / this.layout.digit.height) - 1 // 屏幕最大能显示多少条记录
const recs = this.reportData.value.length
const beginIndex = recs > maxlines ? recs - maxlines : 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 flushMin
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
flushMin (nowdata, fields) {
if (this.InData['MIN'] === undefined) {
this.InData['MIN'] = {
key: 'MIN',
fields: FIELD_MIN,
- 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 drawOrder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
drawOrder ()
{
if (this.tickData === undefined || this.tickData.value.length < 1) return
const maxlines = Math.floor(this.rectTick.height / this.layout.digit.height) - 1 // 屏幕最大能显示多少条记录
const recs = this.tickData.value.length
- 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 formatVolume
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function formatVolume (value, volzoom) {
if (value === undefined || isNaN(value)) return '--'
if (typeof value === 'string') value = parseFloat(value)
if (volzoom === undefined) volzoom = 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"
Further reading
Function touchend
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
touchend (e) {
const event = this.eventBuild(e)
clearTimeout(this.longTapTimeout)
const point = event.changedTouches ? event.changedTouches[0] : event
const timestamp = Date.now()
- 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 drawTick
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
drawTick () {
if (this.tickData === undefined || this.tickData.value.length < 1) return
const maxlines = Math.floor(this.rectTick.height / this.layout.digit.height) - 1 // 屏幕最大能显示多少条记录
const recs = this.tickData.value.length
const beginIndex = recs > maxlines ? recs - maxlines : 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 checkMDay
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function checkMDay (source, tradeDate, tradetime) {
const out = []
if (source.length < 1) return out
const lastDate = getDate(source[source.length - 1][FIELD_MDAY.time])
- 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 onPaint
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
onPaint (key) {
if (key !== undefined) this.hotKey = key
this.data = this.source.getData(this.hotKey)
const len = _getTxtWidth(this.context, '▲', this.symbol.font, this.symbol.pixel)
Function formatShowTime
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatShowTime (key, value, minute) {
let out = value
switch (key) {
case 'M5':
case 'M15':
Function mergeDay
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
mergeDay (source, now, rightMode) {
let out = copyArrayOfDeep(source.value)
if (now !== undefined && !checkZero(now.value, now.fields)) {
const checked = findDateInDay(source, getDate(now.value[now.fields.time]))
if (checked.finded) {
Function _setTransColor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function _setTransColor (scolor, trans, style) {
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
let sColor = scolor.toLowerCase()
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {