seerline/clchart

View on GitHub

Showing 170 of 392 total issues

Function mergeNowMinToMin has a Cognitive Complexity of 23 (exceeds 5 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 3 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 onPaint has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  onPaint (mousePos, valueX, valueY) {
    if (typeof this.context._beforePaint === 'function') {
      this.context._beforePaint()
    }
    if (inRangeX(this.rectChart, mousePos.x) === false) return
Severity: Major
Found in src/chart/cl.draw.cursor.js - About 3 hrs to fix

    Function setButtons has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      setButtons () {
        let chart
        let xx, yy
        let ww = 25 * this.scale
        if (this.hasButton('zoomin', this.buttons) || this.hasButton('zoomout', this.buttons)) {
    Severity: Major
    Found in src/chart/cl.chart.line.js - About 3 hrs to fix

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

        onPaint (mousePos, valueX, valueY) {
          if (typeof this.context._beforePaint === 'function') {
            this.context._beforePaint()
          }
          if (inRangeX(this.rectChart, mousePos.x) === false) return
      Severity: Minor
      Found in src/chart/cl.draw.cursor.js - About 3 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 onPaint has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        onPaint () {
          if (this.axisY[this.align].display === 'none') return
          if (this.linkInfo.hideInfo) return
      
          let xx, yy
      Severity: Major
      Found in src/chart/cl.draw.axisY.js - About 2 hrs to fix

        File cl.chart.init.js has 282 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/chart/cl.chart.init.js - About 2 hrs to fix

          Function _drawSignHLine has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          export function _drawSignHLine (context, config, item) {
            _drawBegin(context, config.clr)
            _drawDashLine(context, config.xx, config.yy, config.right - config.pixel / 2, config.yy, 7)
            _drawEnd(context)
          
          
          Severity: Minor
          Found in src/util/cl.draw.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 transExrightDay has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          export function transExrightDay (days, rights, mode, start, end) {
            if (rights.length < 1 || days.length < 1) return days
            if (mode === undefined) mode = 'forword' // 以最近的价格为基准,修正以前的价格;
            if (start === undefined || start < 0 || start > days.length - 1) start = 0
            if (end === undefined || end < 0) end = days.length - 1
          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

          Function transExrightMin has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          export function transExrightMin (days, rights, mode, start, end) {
            if (rights.length < 1 || days.length < 1) return days
            if (mode === undefined) mode = 'forword' // 以最近的价格为基准,修正以前的价格;
            if (start === undefined || start < 0 || start > days.length - 1) start = 0
            if (end === undefined || end < 0) end = days.length - 1
          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

          Function onPaint has 61 lines of code (exceeds 25 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) {
          Severity: Major
          Found in src/plugins/cl.seer.js - About 2 hrs to fix

            Function readyDraw has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

              readyDraw () { // 计算最大最小值等
                // 画滚动块
                this.readyScroll()
            
                // 求最大最小值
            Severity: Minor
            Found in src/chart/cl.chart.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 checkHotWin has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

              checkHotWin (event, charts) {
                for (let k = 0; k < charts.length; k++) {
                  let finded = false
                  for (let i = 0; i < this.hotWin.length; i++) {
                    if (!inRect(this.hotWin[i].rectMain, event.mousePos)) {
            Severity: Minor
            Found in src/event/cl.event.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 drawReady has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              drawReady () {
                if (this.tickData === undefined) {
                  this.tickData = {
                    key: 'TICK',
                    fields: FIELD_TICK,
            Severity: Major
            Found in src/chart/cl.chart.board.js - About 2 hrs to fix

              Function _drawSignVLine has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

              export function _drawSignVLine (context, config, item) {
                _drawBegin(context, config.clr)
                _drawDashLine(context, config.xx, config.yy, config.xx, config.bottom - config.pixel / 2, 7)
                _drawEnd(context)
              
              
              Severity: Minor
              Found in src/util/cl.draw.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 onPaint has 55 lines of code (exceeds 25 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: Major
              Found in src/chart/cl.draw.kbar.js - About 2 hrs to fix

                Function onPaint has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  ClChart has 21 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  export default class ClChart {
                    /**
                  
                     * Creates an instance of ClChart.
                     * @param {Object} syscfg
                  Severity: Minor
                  Found in src/chart/cl.chart.js - About 2 hrs to fix

                    Function drawReports has 53 lines of code (exceeds 25 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
                    Severity: Major
                    Found in src/chart/cl.chart.report.js - About 2 hrs to fix

                      Function drawOrder has 53 lines of code (exceeds 25 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
                      Severity: Major
                      Found in src/plugins/cl.super.js - About 2 hrs to fix

                        Function drawTick has 53 lines of code (exceeds 25 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
                        Severity: Major
                        Found in src/chart/cl.chart.board.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language