seerline/clchart

View on GitHub

Showing 170 of 392 total issues

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

    Function checkLayout has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function checkLayout (layout) {
      const scale = _systemInfo.scale
      layout.margin.top *= scale
      layout.margin.left *= scale
      layout.margin.bottom *= scale
    Severity: Minor
    Found in src/chart/cl.chart.init.js - About 1 hr to fix

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

        onPaint (key) {
          if (key !== undefined) this.hotKey = key
          this.data = this.source.getData(this.hotKey)
      
          if (this.info.labelX === undefined) this.info.labelX = 'time'
      Severity: Minor
      Found in src/chart/cl.draw.vline.js - About 1 hr to fix

        Function matchDayToMon has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function matchDayToMon (daydata) {
          let month
          const out = []
          const zipday = []
        
        
        Severity: Minor
        Found in src/data/cl.data.tools.js - About 1 hr to fix

          Function matchDayToWeek has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function matchDayToWeek (daydata) {
            const out = []
            const zipday = []
          
            const field = FIELD_DAY
          Severity: Minor
          Found in src/data/cl.data.tools.js - About 1 hr to fix

            Function getMoveData has a Cognitive Complexity of 11 (exceeds 5 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

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

            export function formatInfo (value, format, coindot, volzoom, middle) {
              let out
              if (format === 'rate') {
                out = formatRate(value, middle)
              } else {
            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 emitEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              emitEvent (eventName, config) {
                const event = copyJsonOfDeep(config)
                const mousePos = this.getMousePos(config)
                // 这里生成一个相对鼠标位置
                event.mousePos = {
            Severity: Minor
            Found in src/event/cl.event.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 beforeLocation has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              beforeLocation () {
                this.linkInfo.rightMode = 'forword'
                this.data = this.source.getData(this.father.hotKey)
                const lastDate = this.data.value[this.data.value.length - 1][this.data.fields.time]
            
            
            Severity: Minor
            Found in src/plugins/cl.seer.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 drawReports has a Cognitive Complexity of 11 (exceeds 5 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: Minor
            Found in src/chart/cl.chart.report.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 flushMin has a Cognitive Complexity of 11 (exceeds 5 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

            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 11 (exceeds 5 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: Minor
            Found in src/plugins/cl.super.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 formatVolume has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            export function formatVolume (value, volzoom) {
              if (value === undefined || isNaN(value)) return '--'
              if (typeof value === 'string') value = parseFloat(value)
            
              if (volzoom === undefined) volzoom = 1
            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 touchend has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              touchend (e) {
                const event = this.eventBuild(e)
                clearTimeout(this.longTapTimeout)
                const point = event.changedTouches ? event.changedTouches[0] : event
                const timestamp = Date.now()
            Severity: Minor
            Found in src/event/cl.event.handler.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 drawTick has a Cognitive Complexity of 11 (exceeds 5 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: Minor
            Found in src/chart/cl.chart.board.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 checkMDay has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            export function checkMDay (source, tradeDate, tradetime) {
              const out = []
              if (source.length < 1) return out
            
              const lastDate = getDate(source[source.length - 1][FIELD_MDAY.time])
            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 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              onPaint (key) {
                if (key !== undefined) this.hotKey = key
                this.data = this.source.getData(this.hotKey)
            
                const len = _getTxtWidth(this.context, '▲', this.symbol.font, this.symbol.pixel)
            Severity: Minor
            Found in src/chart/cl.draw.trade.js - About 1 hr to fix

              Function formatShowTime has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function formatShowTime (key, value, minute) {
                let out = value
                switch (key) {
                  case 'M5':
                  case 'M15':
              Severity: Minor
              Found in src/util/cl.tool.js - About 1 hr to fix

                Function mergeDay has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  mergeDay (source, now, rightMode) {
                    let out = copyArrayOfDeep(source.value)
                    if (now !== undefined && !checkZero(now.value, now.fields)) {
                      const checked = findDateInDay(source, getDate(now.value[now.fields.time]))
                      if (checked.finded) {
                Severity: Minor
                Found in src/data/cl.data.js - About 1 hr to fix

                  Function _setTransColor has 30 lines of code (exceeds 25 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
                    Severity
                    Category
                    Status
                    Source
                    Language