Showing 170 of 392 total issues
File cl.chart.line.js
has 794 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function calcMaxMin
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
calcMaxMin (data, extremum, start, stop) {
const mm = {
max: 0.0,
min: 0.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 drawHotSeer
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawHotSeer (no) {
let idx = findNearTimeToIndex(this.data, getValue(this.sourceSeer, 'start', no), 'time', 'forword')
if (idx === -1) idx = this.linkInfo.maxIndex
const offset = idx - this.linkInfo.minIndex
if (offset < 0) return // 不在视线内就不画
File cl.data.tools.js
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File cl.chart.def.js
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File cl.seer.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File cl.data.js
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File cl.draw.js
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
ClChartLine
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
export default class ClChartLine {
/**
* Creates an instance of ClChartLine.
* @param {Object} father line chart's parent context
Function onPaint
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
onPaint () {
if (this.axisY[this.align].display === 'none') return
if (this.linkInfo.hideInfo) return
let xx, yy
- 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
File cl.chart.board.js
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function onPaint
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
onPaint () {
if (!this.config.visible) return
_setLineWidth(this.context, this.scale)
let clr = this.color.button
Function drawHotSeer
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
drawHotSeer (no) {
let idx = findNearTimeToIndex(this.data, getValue(this.sourceSeer, 'start', no), 'time', 'forword')
if (idx === -1) idx = this.linkInfo.maxIndex
const offset = idx - this.linkInfo.minIndex
if (offset < 0) 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
File cl.tool.js
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) 2018-present clchart Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function updateJsonOfDeep
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export function updateJsonOfDeep (obj, source) {
let out
if (source instanceof Object) {
if (Array.isArray(source)) {
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 onPaint
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
onPaint (key) {
// if (key !== undefined) this.hotKey = key
// this.data = this.source.getData(this.hotKey)
// 设置可见
for (const k in this.showSeer) {
- 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 touchmove
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
touchmove (e) {
const event = this.eventBuild(e)
if (new Date() - this.__timestamp < 150) {
return event
}
- 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 setPublicRect
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
setPublicRect () { // 计算所有矩形区域
// rectChart 画图区
// rectTitle rectMess
// rectAxisX
// rectScroll
Function calcMaxMin
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
calcMaxMin (data, extremum, start, stop) {
const mm = {
max: 0.0,
min: 0.0
}
Function onMouseMove
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
onMouseMove (event) {
if (!this.mouseDown) return
const mousePos = event.mousePos
if (inRect(this.rectMin, mousePos) || inRect(this.rectMax, mousePos)) {
changeCursorStyle('col-resize')
- 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"