seerline/clchart

View on GitHub
src/util/cl.draw.js

Summary

Maintainability
F
5 days
Test Coverage

File cl.draw.js has 388 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright (c) 2018-present clchart Contributors.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
Severity: Minor
Found in src/util/cl.draw.js - About 5 hrs to fix

    Function _drawSignHLine has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    export function _drawSignHLine (context, config, item) {
      _drawBegin(context, config.clr)
      _drawDashLine(context, config.xx, config.yy, config.right - config.pixel / 2, config.yy, 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

    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

    Function _drawSignHLine has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function _drawSignHLine (context, config, item) {
      _drawBegin(context, config.clr)
      _drawDashLine(context, config.xx, config.yy, config.right - config.pixel / 2, config.yy, 7)
      _drawEnd(context)
    
    
    Severity: Minor
    Found in src/util/cl.draw.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 _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 _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

          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

            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 _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 _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 _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 _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 _clearRect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

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

                        Function _drawCircleAndFilled has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function _drawCircleAndFilled (context, x, y, r, clr) {
                        Severity: Minor
                        Found in src/util/cl.draw.js - About 35 mins to fix

                          Function _getImageData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

                            Function _drawSignPlot has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

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

                              Function _drawRect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

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

                                Function _drawline has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                export function _drawline (context, xx1, yy1, xx2, yy2) {
                                Severity: Minor
                                Found in src/util/cl.draw.js - About 35 mins to fix

                                  Function _drawTxtRect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  export function _drawTxtRect (context, xx, yy, txt, config) {
                                  Severity: Minor
                                  Found in src/util/cl.draw.js - About 35 mins to fix

                                    Function _drawKBar has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export function _drawKBar (context, config, item) {
                                      const xx = config.rect.left + config.index * (config.unitX + config.spaceX)
                                      const xxm = xx + Math.floor(config.unitX / 2)
                                      const yyh = config.rect.top + Math.round((config.maxmin.max - item[1]) * config.unitY)
                                      const yyl = config.rect.top + config.rect.height - Math.round((item[2] - config.maxmin.min) * config.unitY)
                                    Severity: Minor
                                    Found in src/util/cl.draw.js - About 35 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 _drawTxtRect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export function _drawTxtRect (context, xx, yy, txt, config) {
                                      const spaceX = config.spaceX || 2
                                      const spaceY = config.spaceY || 2
                                      const tr = __getTxtRect(context, txt, config)
                                    
                                    
                                    Severity: Minor
                                    Found in src/util/cl.draw.js - About 25 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

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

                                      if (Arc2 !== undefined && Arc2.r > 0) {
                                        _drawBegin(context, Arc2.clr)
                                        _drawCircleAndFilled(context, x, y, Arc2.r, Arc2.clr)
                                        _drawEnd(context)
                                      }
                                    Severity: Major
                                    Found in src/util/cl.draw.js and 3 other locations - About 1 hr to fix
                                    src/util/cl.draw.js on lines 530..534
                                    src/util/cl.draw.js on lines 535..539
                                    src/util/cl.draw.js on lines 540..544

                                    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

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

                                      if (Arc3 !== undefined && Arc3.r > 0) {
                                        _drawBegin(context, Arc3.clr)
                                        _drawCircleAndFilled(context, x, y, Arc3.r, Arc3.clr)
                                        _drawEnd(context)
                                      }
                                    Severity: Major
                                    Found in src/util/cl.draw.js and 3 other locations - About 1 hr to fix
                                    src/util/cl.draw.js on lines 513..517
                                    src/util/cl.draw.js on lines 530..534
                                    src/util/cl.draw.js on lines 535..539

                                    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

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

                                      if (Arc1 !== undefined && Arc1.r > 0) {
                                        _drawBegin(context, Arc1.clr)
                                        _drawCircleAndFilled(context, x, y, Arc1.r, Arc1.clr)
                                        _drawEnd(context)
                                      }
                                    Severity: Major
                                    Found in src/util/cl.draw.js and 3 other locations - About 1 hr to fix
                                    src/util/cl.draw.js on lines 513..517
                                    src/util/cl.draw.js on lines 535..539
                                    src/util/cl.draw.js on lines 540..544

                                    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

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

                                      if (Arc2 !== undefined && Arc2.r > 0) {
                                        _drawBegin(context, Arc2.clr)
                                        _drawCircleAndFilled(context, x, y, Arc2.r, Arc2.clr)
                                        _drawEnd(context)
                                      }
                                    Severity: Major
                                    Found in src/util/cl.draw.js and 3 other locations - About 1 hr to fix
                                    src/util/cl.draw.js on lines 513..517
                                    src/util/cl.draw.js on lines 530..534
                                    src/util/cl.draw.js on lines 540..544

                                    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

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

                                          if (config.top && yy < config.top + tr.height / 2) {
                                            yy = config.top + 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 580..582
                                    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

                                    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

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

                                          if (config.left && xx < config.left + tr.width / 2) {
                                            xx = config.left + tr.width / 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 580..582

                                    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

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

                                      const yy = config.rect.top + Math.round((config.maxmin.max - item[0]) * config.unitY)
                                    Severity: Minor
                                    Found in src/util/cl.draw.js and 1 other location - About 50 mins to fix
                                    src/util/cl.draw.js on lines 655..655

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

                                    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

                                      const yyh = config.rect.top + Math.round((config.maxmin.max - item[1]) * config.unitY)
                                    Severity: Minor
                                    Found in src/util/cl.draw.js and 1 other location - About 50 mins to fix
                                    src/util/cl.draw.js on lines 659..659

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

                                    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 690..694

                                    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

                                    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

                                    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

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

                                          if ((yy + item[i].maxR) > config.bottom) yy = config.bottom - item[i].maxR
                                    Severity: Minor
                                    Found in src/util/cl.draw.js and 1 other location - About 35 mins to fix
                                    src/util/cl.draw.js on lines 566..566

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

                                    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 ((xx + item[i].maxR) > config.right) xx = config.right - item[i].maxR
                                    Severity: Minor
                                    Found in src/util/cl.draw.js and 1 other location - About 35 mins to fix
                                    src/util/cl.draw.js on lines 616..616

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

                                    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

                                    export function _drawVline (context, xx, yy1, yy2) {
                                      context.moveTo(xx, yy1)
                                      context.lineTo(xx, yy2)
                                    }
                                    Severity: Minor
                                    Found in src/util/cl.draw.js and 1 other location - About 30 mins to fix
                                    src/util/cl.draw.js on lines 83..86

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

                                    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

                                    export function _drawHline (context, xx1, xx2, yy) {
                                      context.moveTo(xx1, yy)
                                      context.lineTo(xx2, yy)
                                    }
                                    Severity: Minor
                                    Found in src/util/cl.draw.js and 1 other location - About 30 mins to fix
                                    src/util/cl.draw.js on lines 70..73

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

                                    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

                                    There are no issues that match your filters.

                                    Category
                                    Status