seerline/clchart

View on GitHub

Showing 392 of 392 total issues

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

  onPaint (key) {
    if (key !== undefined) this.hotKey = key
    this.data = this.source.getData(this.hotKey)
    // console.log('ClDrawZVBar:', this.maxmin, this.linkInfo, this.rectMain);
    
Severity: Minor
Found in src/chart/cl.draw.zvbar.js - About 1 hr to fix

    Function drawButton has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      drawButton () {
        if (this.config.direct === 'horizontal') {
          const spaceY = (this.rectChart.height - this.layout.scroll.height) / 2
          if (this.config.txt.head !== undefined) {
            _drawTxt(this.context, this.rectChart.left + this.scale, this.rectChart.top + spaceY,
    Severity: Minor
    Found in src/chart/cl.chart.scroll.js - About 1 hr to fix

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

        onPaint (key) {
          if (key !== undefined) this.hotKey = key
          this.data = this.source.getData(this.hotKey)
      
          _drawBegin(this.context, this.color.red)
      Severity: Minor
      Found in src/chart/cl.draw.vbar.js - About 1 hr to fix

        Function onMouseMove has 36 lines of code (exceeds 25 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 1 hr to fix

          Function _drawSignVLine has 36 lines of code (exceeds 25 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 1 hr to fix

            Function constructor has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor (options) {
                super()
            
                this.calls = []
            
            
            Severity: Minor
            Found in client/index.js - About 1 hr to fix

              Function drawButton has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                drawButton () {
                  if (this.config.direct === 'horizontal') {
                    const spaceY = (this.rectChart.height - this.layout.scroll.height) / 2
                    if (this.config.txt.head !== undefined) {
                      _drawTxt(this.context, this.rectChart.left + this.scale, this.rectChart.top + spaceY,
              Severity: Minor
              Found in src/chart/cl.chart.scroll.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 _setTransColor has a Cognitive Complexity of 12 (exceeds 5 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) {
              Severity: Minor
              Found in src/util/cl.draw.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 fromTradeTimeToIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export function fromTradeTimeToIndex (ttime, tradetime) { // time_t 返回0-239
                const minute = getMinute(ttime)
              
                let nowmin = 0
                let index = -1
              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 onPaint has 35 lines of code (exceeds 25 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 1 hr to fix

                Function getZipDay has 35 lines of code (exceeds 25 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 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        value = formatInfo(
                          this.maxmin.max,
                          this.axisY[this.align].format,
                          this.static.coindot,
                          this.static.volzoom,
                  Severity: Major
                  Found in src/chart/cl.draw.axisY.js and 1 other location - About 1 hr to fix
                  src/chart/cl.draw.axisY.js on lines 101..106

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        value = formatInfo(
                          this.maxmin.min,
                          this.axisY[this.align].format,
                          this.static.coindot,
                          this.static.volzoom,
                  Severity: Major
                  Found in src/chart/cl.draw.axisY.js and 1 other location - About 1 hr to fix
                  src/chart/cl.draw.axisY.js on lines 86..91

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                        _drawHline(this.context, this.rectTitle.left, this.rectTitle.left + this.rectTitle.width, this.rectTitle.top + this.rectTitle.height)
                  Severity: Major
                  Found in src/chart/cl.chart.board.js and 2 other locations - About 1 hr to fix
                  src/chart/cl.chart.board.js on lines 279..279
                  src/chart/cl.draw.grid.js on lines 56..56

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                        _drawHline(this.context, this.rectMain.left, this.rectMain.left + this.rectMain.width, this.rectMain.top + this.rectMain.height)
                  Severity: Major
                  Found in src/chart/cl.draw.grid.js and 2 other locations - About 1 hr to fix
                  src/chart/cl.chart.board.js on lines 279..279
                  src/chart/cl.chart.board.js on lines 456..456

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                        _drawHline(this.context, this.rectTitle.left, this.rectTitle.left + this.rectTitle.width, this.rectTitle.top + this.rectTitle.height)
                  Severity: Major
                  Found in src/chart/cl.chart.board.js and 2 other locations - About 1 hr to fix
                  src/chart/cl.chart.board.js on lines 456..456
                  src/chart/cl.draw.grid.js on lines 56..56

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function flushMin has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    flushMin (nowdata, fields) {
                      if (this.InData['MIN'] === undefined) {
                        this.InData['MIN'] = {
                          key: 'MIN',
                          fields: FIELD_MIN,
                  Severity: Minor
                  Found in src/data/cl.data.js - About 1 hr to fix

                    Function touchstart has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      touchstart (e) {
                        const event = this.eventBuild(e)
                        this.__timestamp = new Date()
                        const point = event.touches ? event.touches[0] : event
                        this.startX = point.pageX
                    Severity: Minor
                    Found in src/event/cl.event.handler.js - About 1 hr to fix

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

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                          if (!isBegin) {
                            zipday[field.time] = daydata[daydata.length - 1][field.time]
                            out.push(copyArrayOfDeep(zipday))
                          }
                        Severity: Major
                        Found in src/data/cl.data.tools.js and 1 other location - About 1 hr to fix
                        src/data/cl.data.tools.js on lines 785..788

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 61.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language