seerline/clchart

View on GitHub

Showing 392 of 392 total issues

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

  onClick (/* e */) {
    if (this.isIndex) return // 如果是指数就啥也不干
    if (this.style === 'normal') {
      this.style = 'tiny'
    } else {
Severity: Major
Found in src/chart/cl.chart.board.js and 1 other location - About 2 hrs to fix
src/chart/cl.chart.report.js on lines 93..101

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

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

  constructor (father, rectMain) {
    initCommonInfo(this, father)
    this.rectMain = rectMain

    this.linkInfo = father.father.linkInfo
Severity: Major
Found in src/chart/cl.draw.vbar.js and 2 other locations - About 2 hrs to fix
src/chart/cl.draw.kbar.js on lines 36..43
src/chart/cl.draw.zvbar.js on lines 35..43

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

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

  constructor (father, rectMain) {
    initCommonInfo(this, father)
    this.rectMain = rectMain

    this.linkInfo = father.father.linkInfo
Severity: Major
Found in src/chart/cl.draw.kbar.js and 2 other locations - About 2 hrs to fix
src/chart/cl.draw.vbar.js on lines 35..43
src/chart/cl.draw.zvbar.js on lines 35..43

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

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

  constructor (father, rectMain) {
    initCommonInfo(this, father)
    this.rectMain = rectMain

    this.linkInfo = father.father.linkInfo
Severity: Major
Found in src/chart/cl.draw.zvbar.js and 2 other locations - About 2 hrs to fix
src/chart/cl.draw.kbar.js on lines 36..43
src/chart/cl.draw.vbar.js on lines 35..43

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

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

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

              _drawSignPlot(this.context, this.rectMain.left + center.xx,
                this.rectMain.top + center.xx, {
                  r: Math.round(this.layout.symbol.size / 2),
                  clr
                }
    Severity: Major
    Found in src/chart/cl.chart.button.js and 1 other location - About 2 hrs to fix
    src/chart/cl.chart.button.js on lines 144..147

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

    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

              _drawSignCircle(this.context, this.rectMain.left + center.xx, this.rectMain.top + center.xx, {
                r: Math.round(this.layout.symbol.size / 2),
                clr
              })
    Severity: Major
    Found in src/chart/cl.chart.button.js and 1 other location - About 2 hrs to fix
    src/chart/cl.chart.button.js on lines 134..139

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

    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 _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

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

          case 'MON':
            this.OutData['MON'] = {
              key,
              fields: FIELD_DAY
            }
    Severity: Major
    Found in src/data/cl.data.js and 2 other locations - About 2 hrs to fix
    src/data/cl.data.js on lines 276..283
    src/data/cl.data.js on lines 284..291

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

    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.rectMin = {
              left: start - this.layout.scroll.size / 2,
              top: this.rectMain.top + this.scale,
              width: this.layout.scroll.size,
              height: spaceY
    Severity: Major
    Found in src/chart/cl.chart.scroll.js and 1 other location - About 2 hrs to fix
    src/chart/cl.chart.scroll.js on lines 104..109

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

    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

          case 'DAY':
            this.OutData['DAY'] = {
              key,
              fields: FIELD_DAY
            }
    Severity: Major
    Found in src/data/cl.data.js and 2 other locations - About 2 hrs to fix
    src/data/cl.data.js on lines 284..291
    src/data/cl.data.js on lines 292..299

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

    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

          case 'WEEK':
            this.OutData['WEEK'] = {
              key,
              fields: FIELD_DAY
            }
    Severity: Major
    Found in src/data/cl.data.js and 2 other locations - About 2 hrs to fix
    src/data/cl.data.js on lines 276..283
    src/data/cl.data.js on lines 292..299

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

    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.rectMax = {
              left: stop - this.layout.scroll.size / 2,
              top: this.rectMain.top + this.scale,
              width: this.layout.scroll.size,
              height: spaceY
    Severity: Major
    Found in src/chart/cl.chart.scroll.js and 1 other location - About 2 hrs to fix
    src/chart/cl.chart.scroll.js on lines 98..103

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

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

              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

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

                export function inRangeX (rect, xx) {
                  if (rect === undefined || xx === undefined) return false
                  if (xx >= rect.left &&
                    xx < (rect.left + rect.width)) {
                    return true
                Severity: Major
                Found in src/util/cl.tool.js and 1 other location - About 2 hrs to fix
                src/util/cl.tool.js on lines 279..286

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

                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