seerline/clchart

View on GitHub

Showing 392 of 392 total issues

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

      if (config.bottom && yy > config.bottom - tr.height / 2) {
        yy = config.bottom - tr.height / 2
      }
Severity: Major
Found in src/util/cl.draw.js and 2 other locations - About 1 hr to fix
src/util/cl.draw.js on lines 577..579
src/util/cl.draw.js on lines 627..629

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 58.

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 onMouseMove has 28 lines of code (exceeds 25 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

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

          if (this.info.showSort === undefined) {
            idx = index
          } else {
            idx = getValue(this.data, this.info.showSort, index)
          }
    Severity: Major
    Found in src/chart/cl.draw.vline.js and 1 other location - About 1 hr to fix
    src/chart/cl.draw.line.js on lines 94..98

    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 57.

    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

          if (this.InData['TICK'].value[this.InData['TICK'].value.length - 1][FIELD_TICK.vol] < nowdata[fields.vol] ||
    Severity: Major
    Found in src/data/cl.data.js and 1 other location - About 1 hr to fix
    src/data/cl.data.js on lines 198..198

    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 57.

    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

            this.InData['TICK'].value[this.InData['TICK'].value.length - 1][FIELD_TICK.close] !== nowdata[fields.close]) {
    Severity: Major
    Found in src/data/cl.data.js and 1 other location - About 1 hr to fix
    src/data/cl.data.js on lines 197..197

    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 57.

    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

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

          if (this.info.showSort === undefined) {
            idx = index
          } else {
            idx = getValue(this.data, this.info.showSort, index)
          }
    Severity: Major
    Found in src/chart/cl.draw.line.js and 1 other location - About 1 hr to fix
    src/chart/cl.draw.vline.js on lines 71..75

    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 57.

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

    export function mergeJsonOfDeep (obj, source) {
      const out = updateJsonOfDeep(obj, source)
    
      for (const key in obj) {
        if (out[key] !== undefined) continue
    Severity: Minor
    Found in src/util/cl.tool.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 setChildLines has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      setChildLines () {
        // l_kbar,l_line,l_nowvol,l_vbar l_nowline
        let line
        let clr = 0
        for (let i = 0; i < this.config.lines.length; i++) {
    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 setPublicRect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      setPublicRect () { // 计算所有矩形区域
        // rectChart 画图区
        // rectTitle rectMess
        // rectAxisX
        // rectScroll
    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 setZoomInfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      setZoomInfo () {
        const info = this.config.zoomInfo
        info.index = info.index > info.list.length - 1 ? info.list.length - 1 : info.index
        info.index = info.index < 0 ? 0 : info.index
        const value = info.list[info.index]
    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 getMoveData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getMoveData (index) {
        let lines = this.config.lines
        const out = []
        if (!Array.isArray(lines)) return out
    
    
    Severity: Minor
    Found in src/chart/cl.chart.line.js - About 1 hr to fix

      Function setData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        setData (key, fields, value) {
          if (value === undefined) value = []
          if (this.InData[key] === undefined) this.InData[key] = {}
          switch (key) {
            case 'MDAY':
      Severity: Minor
      Found in src/data/cl.data.js - About 1 hr to fix

        Function open has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          open () {
            if (this.rawSocket) {
              return
            }
            this.closing = false
        Severity: Minor
        Found in client/socket.js - About 1 hr to fix

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

            on (event, callback) {
              if (!this.handlers[event]) {
                this.handlers[event] = []
              }
              this.handlers[event].push(callback)
          Severity: Major
          Found in client/eventemitter.js and 1 other location - About 1 hr to fix
          src/util/cl.ev.js on lines 53..60

          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 56.

          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

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

                this.rectOrder = {
                  left: this.rectChart.left,
                  top: this.rectChart.top,
                  width: this.rectChart.width,
                  height: yy
          Severity: Major
          Found in src/chart/cl.chart.board.js and 1 other location - About 1 hr to fix
          src/chart/cl.chart.board.js on lines 176..181

          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 56.

          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

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

            addEventListener (event, callback) {
              if (!this.handlers[event]) {
                this.handlers[event] = []
              }
              this
          Severity: Major
          Found in src/util/cl.ev.js and 1 other location - About 1 hr to fix
          client/eventemitter.js on lines 19..24

          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 56.

          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

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

                this.rectOrder = {
                  left: this.rectChart.left,
                  top: this.rectChart.top,
                  width: this.rectChart.width,
                  height: yy
          Severity: Major
          Found in src/chart/cl.chart.board.js and 1 other location - About 1 hr to fix
          src/chart/cl.chart.board.js on lines 169..174

          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 56.

          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 drawGridLine has 26 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 = 10
          Severity: Minor
          Found in src/plugins/cl.super.js - About 1 hr to fix

            Function buildMinaTouchEvent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function buildMinaTouchEvent (e) {
              const eventObj = {}
              if (e && Array.isArray(e.touches)) {
                eventObj.touches = []
                for (let i = 0; i < e.touches.length; i++) {
            Severity: Minor
            Found in src/event/cl.event.js - About 1 hr to fix

              Function _drawTxt has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              export function _drawTxt (context, xx, yy, txt, font, pixel, clr, pos) {
              Severity: Major
              Found in src/util/cl.draw.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language