seerline/clchart

View on GitHub

Showing 392 of 392 total issues

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

  onPaint (message) {
    if (this.titleInfo.display === 'none' || this.linkInfo.hideInfo) return

    _fillRect(this.context, this.rectMain.left + this.scale, this.rectMain.top + this.scale,
      this.rectMess.left + this.rectMess.width - 2 * this.scale,
Severity: Minor
Found in src/chart/cl.draw.info.js - About 45 mins 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 getDataRange has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  getDataRange (data) {
    const out = {
      minIndex: -1,
      maxIndex: -1
    }
Severity: Minor
Found in src/chart/cl.chart.line.js - About 45 mins 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 drawOrder has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  drawOrder () {
    const xpos = this.drawGridLine() // 先画线格
    if (this.orderData === undefined || this.orderData.value.length < 1) {
      return
    }
Severity: Minor
Found in src/chart/cl.chart.board.js - About 45 mins 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  drawReady () {
    if (this.tickData === undefined) {
      this.tickData = {
        key: 'TICK',
        fields: FIELD_TICK,
Severity: Minor
Found in src/chart/cl.chart.board.js - About 45 mins 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 _drawDashLine has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function _drawDashLine (context, x1, y1, x2, y2, dashLen) {
Severity: Minor
Found in src/util/cl.draw.js - About 45 mins to fix

    Function buildMinaTouchEvent has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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 getMTime has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function getMTime (ttime) { // 得到1970-1-1开始的毫秒数
      let mtime, seconds
      if (ttime === undefined) {
        mtime = new Date()
      } else {
    Severity: Minor
    Found in src/util/cl.tool.js - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

              if (this.who === 'min') {
                min = this.config.select.max
                max = curIndex
                this.who = 'max'
              } else if (this.who === 'max') {
    Severity: Major
    Found in src/chart/cl.chart.scroll.js - About 45 mins to fix

      Function _fillRect has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function _fillRect (context, xx, yy, ww, hh, fillclr) {
      Severity: Minor
      Found in src/util/cl.draw.js - About 45 mins to fix

        Function _BezierEllipse has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export function _BezierEllipse (context, x, y, a, b, h) {
        Severity: Minor
        Found in src/util/cl.draw.js - About 45 mins to fix

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

            onPaint () {
              _drawBegin(this.context, this.color.grid)
              _drawHline(this.context, this.rectMain.left, this.rectMain.left + this.rectMain.width, this.rectMain.top)
              if (this.axisY.lines > 0) {
                const offy = this.rectMain.height / (this.axisY.lines + 1)
          Severity: Minor
          Found in src/chart/cl.draw.grid.js - About 45 mins 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 _drawLineAlone has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          export function _drawLineAlone (context, xx, yy, xx1, yy1, clr) {
          Severity: Minor
          Found in src/util/cl.draw.js - About 45 mins to fix

            Function _drawSignCircle has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export function _drawSignCircle (context, x, y, Arc1, Arc2, Arc3) {
            Severity: Minor
            Found in src/util/cl.draw.js - About 45 mins to fix

              Function touchstart has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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 updateMinute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                updateMinute (source) {
                  let out = copyArrayOfDeep(source.value)
              
                  let allmoney
                  for (let k = 0; k < out.length; k++) {
              Severity: Minor
              Found in src/data/cl.data.js - About 45 mins 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 fromTTimeToStr has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              export function fromTTimeToStr (ttime, format, ttimePre) {
                const mtime = getMTime(ttime)
                switch (format) {
                  case 'minute':
                    if (ttimePre === undefined) {
              Severity: Minor
              Found in src/util/cl.tool.js - About 45 mins 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

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

                    const tr = __getTxtRect(context, item[i].txt, {
                      font: config.font, pixel: config.pixel, spaceX, spaceY
                    })
              Severity: Minor
              Found in src/util/cl.draw.js and 1 other location - About 45 mins to fix
              src/util/cl.draw.js on lines 622..624

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

              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

                    const tr = __getTxtRect(context, item[i].txt, {
                      font: config.font, pixel: config.pixel, spaceX, spaceY
                    })
              Severity: Minor
              Found in src/util/cl.draw.js and 1 other location - About 45 mins to fix
              src/util/cl.draw.js on lines 572..574

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

              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)
              Severity: Major
              Found in src/chart/cl.chart.board.js and 2 other locations - About 45 mins to fix
              src/chart/cl.chart.board.js on lines 455..455
              src/chart/cl.draw.grid.js on lines 48..48

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

              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 (config.filled) {
                  _fillRect(context, xx, yy, config.unitX, hh, config.fillclr)
                } else {
                  _drawRect(context, xx, yy, config.unitX, hh)
                }
              Severity: Minor
              Found in src/util/cl.draw.js and 1 other location - About 45 mins to fix
              src/util/cl.draw.js on lines 670..674

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

              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