seerline/clchart

View on GitHub

Showing 170 of 392 total issues

Function onPaint has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  onPaint (key) {    
    if (key !== undefined) this.hotKey = key

    this.data = this.source.getData(this.hotKey)
    // console.log("lines:", this.hotKey, this.info.labelY, this.data)
Severity: Minor
Found in src/chart/cl.draw.line.js - About 2 hrs to fix

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 getZipDay has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export function getZipDay (daydata, rate) {
  if (rate < 1) return daydata
  const out = []
  const zipday = []

Severity: Minor
Found in src/data/cl.data.tools.js - About 2 hrs to fix

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.event.handler.js has 252 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.
Severity: Minor
Found in src/event/cl.event.handler.js - About 2 hrs to fix

    Function drawSuperBoard has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      drawSuperBoard () {
        this.orderData = this.father.getData('snapshot')
        this.orderData.coindot = this.static.coindot
        this.static.volzoom = 100
        
    Severity: Major
    Found in src/plugins/cl.super.js - About 2 hrs to fix

      Function drawOrder has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        drawOrder () {
          const xpos = this.drawGridLine() // 先画线格
          if (this.orderData === undefined || this.orderData.value.length < 1) {
            return
          }
      Severity: Major
      Found in src/chart/cl.chart.board.js - About 2 hrs to fix

        Function drawIndex has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          drawIndex () {
            _drawBegin(this.context, this.color.grid)
            _drawRect(this.context, this.rectMain.left, this.rectMain.top, this.rectMain.width, this.rectMain.height)
        
            const offy = this.rectOrder.height / 3
        Severity: Minor
        Found in src/chart/cl.chart.board.js - About 2 hrs to fix

          Function getData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getData (key, rightMode) {
              switch (key) {
                case 'DAY':
                  this.OutData['DAY'] = {
                    key,
          Severity: Minor
          Found in src/data/cl.data.js - About 1 hr to fix

            Function onPaint has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              onPaint (key) {
                if (key !== undefined) this.hotKey = key
                this.data = this.source.getData(this.hotKey)
                this.codeInfo = this.source.getData('INFO')
            
            
            Severity: Minor
            Found in src/chart/cl.draw.kbar.js - About 1 hr to fix

            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 mergeMDay has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              mergeMDay (source, min) {
                let out = []
            
                if (source !== undefined && !isEmptyArray(source.value)) {
                  out = copyArrayOfDeep(source.value)
            Severity: Minor
            Found in src/data/cl.data.js - About 1 hr to fix

            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 getValue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function getValue ({
              fields,
              value
            }, label, index = 0) {
              let val = 0
            Severity: Minor
            Found in src/data/cl.data.tools.js - About 1 hr to fix

            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 mergeNowMinToMin has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              mergeNowMinToMin (source, min, offset) {
                const curMin = []
                let sumVol = 0
                let sumMoney = 0
            
            
            Severity: Minor
            Found in src/data/cl.data.js - About 1 hr to fix

              Function touchmove has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                touchmove (e) {
                  const event = this.eventBuild(e)
                  if (new Date() - this.__timestamp < 150) {
                    return event
                  }
              Severity: Minor
              Found in src/event/cl.event.handler.js - About 1 hr to fix

                Function beforeLocation has 44 lines of code (exceeds 25 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]
                
                
                Severity: Minor
                Found in src/plugins/cl.seer.js - About 1 hr to fix

                  Function findNearTimeToIndex has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function findNearTimeToIndex (data, findvalue, label, direction) {
                    if (label === undefined) label = 'time'
                    if (direction && direction === 'forword') {
                      for (let idx = data.value.length - 1; idx >= 0; idx--) {
                        if (getValue(data, label, idx) > findvalue) continue
                  Severity: Minor
                  Found in src/chart/cl.chart.tools.js - About 1 hr to fix

                  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 onMouseMove has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                    onMouseMove (event) {
                      if (this.linkInfo.hideInfo) return
                      if (!this.linkInfo.showCursorLine) return
                      // this.draw_clear();
                      // 找到X坐标对应的数据索引
                  Severity: Minor
                  Found in src/chart/cl.chart.line.js - About 1 hr to fix

                  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 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                    onPaint () {
                      if (!this.config.visible) return
                      _setLineWidth(this.context, this.scale)
                  
                      let clr = this.color.button
                  Severity: Minor
                  Found in src/chart/cl.chart.button.js - About 1 hr to fix

                  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 checkBefore has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                    checkBefore () {
                      if (this.static.before <= 0)
                      {   
                        console.log(this.InData['NOW'],this.InData['DAY']);
                           
                  Severity: Minor
                  Found in src/data/cl.data.js - About 1 hr to fix

                  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 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                    onPaint () {
                      this.data = this.father.data
                      if (this.axisX.display === 'none') return
                  
                      let xx, value, spaceX
                  Severity: Minor
                  Found in src/chart/cl.draw.axisX.js - About 1 hr to fix

                  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 make_command_buffer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function make_command_buffer(sign, command) {
                    // console.log('<===', typeof command, command);
                    let cmd = sign + ':{'
                    let argv = false
                    for (let k = 0; k < command.length; k++) {
                  Severity: Minor
                  Found in cs/drive.js - About 1 hr to fix

                  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 drawGridLine has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    drawGridLine () {
                      _drawBegin(this.context, this.color.grid)
                      _drawRect(this.context, this.rectMain.left, this.rectMain.top, this.rectMain.width, this.rectMain.height)
                  
                      let mmpCount = 1
                  Severity: Minor
                  Found in src/chart/cl.chart.board.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language