seerline/clchart

View on GitHub

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.
Severity: Major
Found in src/chart/cl.chart.line.js - About 1 day to fix

    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
        }
    Severity: Minor
    Found in src/chart/cl.chart.line.js - About 1 day 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 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 // 不在视线内就不画
    Severity: Major
    Found in src/plugins/cl.seer.js - About 7 hrs to fix

      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.
      Severity: Minor
      Found in src/data/cl.data.tools.js - About 7 hrs to fix

        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.
        Severity: Minor
        Found in src/cl.chart.def.js - About 6 hrs to fix

          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.
          Severity: Minor
          Found in src/plugins/cl.seer.js - About 5 hrs to fix

            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.
            Severity: Minor
            Found in src/data/cl.data.js - About 5 hrs to fix

              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.
              Severity: Minor
              Found in src/util/cl.draw.js - About 5 hrs to fix

                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
                Severity: Minor
                Found in src/chart/cl.chart.line.js - About 5 hrs to fix

                  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
                  Severity: Minor
                  Found in src/chart/cl.draw.axisY.js - About 4 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.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.
                  Severity: Minor
                  Found in src/chart/cl.chart.board.js - About 4 hrs to fix

                    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
                    Severity: Major
                    Found in src/chart/cl.chart.button.js - About 3 hrs to fix

                      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 // 不在视线内就不画
                      Severity: Minor
                      Found in src/plugins/cl.seer.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

                      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.
                      Severity: Minor
                      Found in src/util/cl.tool.js - About 3 hrs to fix

                        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 = []
                        Severity: Minor
                        Found in src/util/cl.tool.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 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) {
                        Severity: Minor
                        Found in src/plugins/cl.seer.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 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
                            }
                        Severity: Minor
                        Found in src/event/cl.event.handler.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 setPublicRect has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          setPublicRect () { // 计算所有矩形区域
                            // rectChart 画图区
                            // rectTitle rectMess
                            // rectAxisX
                            // rectScroll
                        Severity: Major
                        Found in src/chart/cl.chart.line.js - About 3 hrs to fix

                          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
                              }
                          Severity: Major
                          Found in src/chart/cl.chart.line.js - About 3 hrs to fix

                            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')
                            Severity: Minor
                            Found in src/chart/cl.chart.scroll.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

                            Severity
                            Category
                            Status
                            Source
                            Language