RubyLouvre/anu

View on GitHub
packages/render/miniapp/apiForH5/canvas.js

Summary

Maintainability
F
5 days
Test Coverage

File canvas.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const CanvasContext = function(canvasId) {
    const canvasDom = document.getElementById(canvasId);
    if (!canvasDom || !canvasDom.getContext) {
        console.error('canvasId错误,或浏览器不支持canvas');
    } else {
Severity: Minor
Found in packages/render/miniapp/apiForH5/canvas.js - About 2 hrs to fix

    Function drawImage has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        imageResource,
        dx,
        dy,
        dWidth,
        dHeight,
    Severity: Major
    Found in packages/render/miniapp/apiForH5/canvas.js - About 1 hr to fix

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

          x,
          y,
          r,
          sAngle,
          eAngle,
      Severity: Minor
      Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix

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

            scaleX,
            skewX,
            skewY,
            scaleY,
            translateX,
        Severity: Minor
        Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix

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

          CanvasContext.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
          Severity: Minor
          Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix

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

                scaleX,
                skewX,
                skewY,
                scaleY,
                translateX,
            Severity: Minor
            Found in packages/render/miniapp/apiForH5/canvas.js - About 45 mins to fix

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

              CanvasContext.prototype.setTransform = function(
                  scaleX,
                  skewX,
                  skewY,
                  scaleY,
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 3 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 144..155
              packages/render/miniapp/apiForH5/canvas.js on lines 157..161
              packages/render/miniapp/apiForH5/canvas.js on lines 243..261

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

              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

              CanvasContext.prototype.arc = function(
                  x,
                  y,
                  r,
                  sAngle,
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 3 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 157..161
              packages/render/miniapp/apiForH5/canvas.js on lines 243..261
              packages/render/miniapp/apiForH5/canvas.js on lines 263..281

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

              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

              CanvasContext.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
                  this.missions.push(() => {
                      this.ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 3 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 144..155
              packages/render/miniapp/apiForH5/canvas.js on lines 243..261
              packages/render/miniapp/apiForH5/canvas.js on lines 263..281

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

              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

              CanvasContext.prototype.transform = function(
                  scaleX,
                  skewX,
                  skewY,
                  scaleY,
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 3 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 144..155
              packages/render/miniapp/apiForH5/canvas.js on lines 157..161
              packages/render/miniapp/apiForH5/canvas.js on lines 263..281

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

              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 6 locations. Consider refactoring.
              Open

              CanvasContext.prototype.strokeRect = function(x, y, width, height) {
                  this.missions.push(() => {
                      this.ctx.strokeRect(x, y, width, height);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 84..88
              packages/render/miniapp/apiForH5/canvas.js on lines 90..94
              packages/render/miniapp/apiForH5/canvas.js on lines 102..106
              packages/render/miniapp/apiForH5/canvas.js on lines 169..173
              packages/render/miniapp/apiForH5/canvas.js on lines 199..203

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

              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 6 locations. Consider refactoring.
              Open

              CanvasContext.prototype.rect = function(x, y, width, height) {
                  this.missions.push(() => {
                      this.ctx.rect(x, y, width, height);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 90..94
              packages/render/miniapp/apiForH5/canvas.js on lines 96..100
              packages/render/miniapp/apiForH5/canvas.js on lines 102..106
              packages/render/miniapp/apiForH5/canvas.js on lines 169..173
              packages/render/miniapp/apiForH5/canvas.js on lines 199..203

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

              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 6 locations. Consider refactoring.
              Open

              CanvasContext.prototype.fillText = function(text, x, y, maxWidth) {
                  this.missions.push(() => {
                      this.ctx.fillText(text, x, y, maxWidth);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 84..88
              packages/render/miniapp/apiForH5/canvas.js on lines 90..94
              packages/render/miniapp/apiForH5/canvas.js on lines 96..100
              packages/render/miniapp/apiForH5/canvas.js on lines 102..106
              packages/render/miniapp/apiForH5/canvas.js on lines 169..173

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

              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 6 locations. Consider refactoring.
              Open

              CanvasContext.prototype.quadraticCurveTo = function(cpx, cpy, x, y) {
                  this.missions.push(() => {
                      this.ctx.quadraticCurveTo(cpx, cpy, x, y);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 84..88
              packages/render/miniapp/apiForH5/canvas.js on lines 90..94
              packages/render/miniapp/apiForH5/canvas.js on lines 96..100
              packages/render/miniapp/apiForH5/canvas.js on lines 102..106
              packages/render/miniapp/apiForH5/canvas.js on lines 199..203

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

              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 6 locations. Consider refactoring.
              Open

              CanvasContext.prototype.fillRect = function(x, y, width, height) {
                  this.missions.push(() => {
                      this.ctx.fillRect(x, y, width, height);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 84..88
              packages/render/miniapp/apiForH5/canvas.js on lines 96..100
              packages/render/miniapp/apiForH5/canvas.js on lines 102..106
              packages/render/miniapp/apiForH5/canvas.js on lines 169..173
              packages/render/miniapp/apiForH5/canvas.js on lines 199..203

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

              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 6 locations. Consider refactoring.
              Open

              CanvasContext.prototype.clearRect = function(x, y, width, height) {
                  this.missions.push(() => {
                      this.ctx.clearRect(x, y, width, height);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 84..88
              packages/render/miniapp/apiForH5/canvas.js on lines 90..94
              packages/render/miniapp/apiForH5/canvas.js on lines 96..100
              packages/render/miniapp/apiForH5/canvas.js on lines 169..173
              packages/render/miniapp/apiForH5/canvas.js on lines 199..203

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

              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

              CanvasContext.prototype.setFillStyle = function(color = 'black') {
                  this.missions.push(() => {
                      this.ctx.fillStyle = color;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 1 other location - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 32..36

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

              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

              CanvasContext.prototype.setStrokeStyle = function(color = 'black') {
                  this.missions.push(() => {
                      this.ctx.strokeStyle = color;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 1 other location - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 26..30

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

              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 5 locations. Consider refactoring.
              Open

              CanvasContext.prototype.moveTo = function(x, y) {
                  this.missions.push(() => {
                      this.ctx.moveTo(x, y);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 4 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 138..142
              packages/render/miniapp/apiForH5/canvas.js on lines 175..179
              packages/render/miniapp/apiForH5/canvas.js on lines 187..191
              packages/render/miniapp/apiForH5/canvas.js on lines 237..241

              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 5 locations. Consider refactoring.
              Open

              CanvasContext.prototype.lineTo = function(x, y) {
                  this.missions.push(() => {
                      this.ctx.lineTo(x, y);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 4 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 132..136
              packages/render/miniapp/apiForH5/canvas.js on lines 175..179
              packages/render/miniapp/apiForH5/canvas.js on lines 187..191
              packages/render/miniapp/apiForH5/canvas.js on lines 237..241

              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 5 locations. Consider refactoring.
              Open

              CanvasContext.prototype.translate = function(x, y) {
                  this.missions.push(() => {
                      this.ctx.translate(x, y);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 4 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 132..136
              packages/render/miniapp/apiForH5/canvas.js on lines 138..142
              packages/render/miniapp/apiForH5/canvas.js on lines 175..179
              packages/render/miniapp/apiForH5/canvas.js on lines 237..241

              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 5 locations. Consider refactoring.
              Open

              CanvasContext.prototype.scale = function(scaleWidth, scaleHeight) {
                  this.missions.push(() => {
                      this.ctx.scale(scaleWidth, scaleHeight);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 4 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 132..136
              packages/render/miniapp/apiForH5/canvas.js on lines 138..142
              packages/render/miniapp/apiForH5/canvas.js on lines 187..191
              packages/render/miniapp/apiForH5/canvas.js on lines 237..241

              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 5 locations. Consider refactoring.
              Open

              CanvasContext.prototype.setLineDash = function(segments, offset) {
                  this.missions.push(() => {
                      this.ctx.setLineDash(segments, offset);
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 4 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 132..136
              packages/render/miniapp/apiForH5/canvas.js on lines 138..142
              packages/render/miniapp/apiForH5/canvas.js on lines 175..179
              packages/render/miniapp/apiForH5/canvas.js on lines 187..191

              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 8 locations. Consider refactoring.
              Open

              CanvasContext.prototype.setTextAlign = function(align) {
                  this.missions.push(() => {
                      this.ctx.textAlign = align;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 20..24
              packages/render/miniapp/apiForH5/canvas.js on lines 60..64
              packages/render/miniapp/apiForH5/canvas.js on lines 66..70
              packages/render/miniapp/apiForH5/canvas.js on lines 72..76
              packages/render/miniapp/apiForH5/canvas.js on lines 78..82
              packages/render/miniapp/apiForH5/canvas.js on lines 193..197
              packages/render/miniapp/apiForH5/canvas.js on lines 231..235

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.setGlobalAlpha = function(alpha) {
                  this.missions.push(() => {
                      this.ctx.globalAlpha = alpha;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 14..18
              packages/render/miniapp/apiForH5/canvas.js on lines 20..24
              packages/render/miniapp/apiForH5/canvas.js on lines 60..64
              packages/render/miniapp/apiForH5/canvas.js on lines 66..70
              packages/render/miniapp/apiForH5/canvas.js on lines 72..76
              packages/render/miniapp/apiForH5/canvas.js on lines 78..82
              packages/render/miniapp/apiForH5/canvas.js on lines 193..197

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.setTextBaseline = function(textBaseline) {
                  this.missions.push(() => {
                      this.ctx.textBaseline = textBaseline;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 14..18
              packages/render/miniapp/apiForH5/canvas.js on lines 60..64
              packages/render/miniapp/apiForH5/canvas.js on lines 66..70
              packages/render/miniapp/apiForH5/canvas.js on lines 72..76
              packages/render/miniapp/apiForH5/canvas.js on lines 78..82
              packages/render/miniapp/apiForH5/canvas.js on lines 193..197
              packages/render/miniapp/apiForH5/canvas.js on lines 231..235

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.setLineCap = function(lineCap) {
                  this.missions.push(() => {
                      this.ctx.lineCap = lineCap;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 14..18
              packages/render/miniapp/apiForH5/canvas.js on lines 20..24
              packages/render/miniapp/apiForH5/canvas.js on lines 60..64
              packages/render/miniapp/apiForH5/canvas.js on lines 72..76
              packages/render/miniapp/apiForH5/canvas.js on lines 78..82
              packages/render/miniapp/apiForH5/canvas.js on lines 193..197
              packages/render/miniapp/apiForH5/canvas.js on lines 231..235

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.setLineWidth = function(lineWidth) {
                  this.missions.push(() => {
                      this.ctx.lineWidth = lineWidth;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 14..18
              packages/render/miniapp/apiForH5/canvas.js on lines 20..24
              packages/render/miniapp/apiForH5/canvas.js on lines 66..70
              packages/render/miniapp/apiForH5/canvas.js on lines 72..76
              packages/render/miniapp/apiForH5/canvas.js on lines 78..82
              packages/render/miniapp/apiForH5/canvas.js on lines 193..197
              packages/render/miniapp/apiForH5/canvas.js on lines 231..235

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.setMiterLimit = function(miterLimit) {
                  this.missions.push(() => {
                      this.ctx.miterLimit = miterLimit;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 14..18
              packages/render/miniapp/apiForH5/canvas.js on lines 20..24
              packages/render/miniapp/apiForH5/canvas.js on lines 60..64
              packages/render/miniapp/apiForH5/canvas.js on lines 66..70
              packages/render/miniapp/apiForH5/canvas.js on lines 72..76
              packages/render/miniapp/apiForH5/canvas.js on lines 193..197
              packages/render/miniapp/apiForH5/canvas.js on lines 231..235

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.setLineJoin = function(lineJoin) {
                  this.missions.push(() => {
                      this.ctx.lineJoin = lineJoin;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 14..18
              packages/render/miniapp/apiForH5/canvas.js on lines 20..24
              packages/render/miniapp/apiForH5/canvas.js on lines 60..64
              packages/render/miniapp/apiForH5/canvas.js on lines 66..70
              packages/render/miniapp/apiForH5/canvas.js on lines 78..82
              packages/render/miniapp/apiForH5/canvas.js on lines 193..197
              packages/render/miniapp/apiForH5/canvas.js on lines 231..235

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.setFontSize = function(fontSize) {
                  this.missions.push(() => {
                      this.ctx.font = fontSize;
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 14..18
              packages/render/miniapp/apiForH5/canvas.js on lines 20..24
              packages/render/miniapp/apiForH5/canvas.js on lines 60..64
              packages/render/miniapp/apiForH5/canvas.js on lines 66..70
              packages/render/miniapp/apiForH5/canvas.js on lines 72..76
              packages/render/miniapp/apiForH5/canvas.js on lines 78..82
              packages/render/miniapp/apiForH5/canvas.js on lines 231..235

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              CanvasContext.prototype.restore = function() {
                  this.missions.push(() => {
                      this.ctx.restore();
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 6 other locations - About 55 mins to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 108..112
              packages/render/miniapp/apiForH5/canvas.js on lines 114..118
              packages/render/miniapp/apiForH5/canvas.js on lines 120..124
              packages/render/miniapp/apiForH5/canvas.js on lines 126..130
              packages/render/miniapp/apiForH5/canvas.js on lines 163..167
              packages/render/miniapp/apiForH5/canvas.js on lines 283..287

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

              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 7 locations. Consider refactoring.
              Open

              CanvasContext.prototype.fill = function() {
                  this.missions.push(() => {
                      this.ctx.fill();
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 6 other locations - About 55 mins to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 114..118
              packages/render/miniapp/apiForH5/canvas.js on lines 120..124
              packages/render/miniapp/apiForH5/canvas.js on lines 126..130
              packages/render/miniapp/apiForH5/canvas.js on lines 163..167
              packages/render/miniapp/apiForH5/canvas.js on lines 283..287
              packages/render/miniapp/apiForH5/canvas.js on lines 289..293

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

              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 7 locations. Consider refactoring.
              Open

              CanvasContext.prototype.save = function() {
                  this.missions.push(() => {
                      this.ctx.save();
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 6 other locations - About 55 mins to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 108..112
              packages/render/miniapp/apiForH5/canvas.js on lines 114..118
              packages/render/miniapp/apiForH5/canvas.js on lines 120..124
              packages/render/miniapp/apiForH5/canvas.js on lines 126..130
              packages/render/miniapp/apiForH5/canvas.js on lines 163..167
              packages/render/miniapp/apiForH5/canvas.js on lines 289..293

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

              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 7 locations. Consider refactoring.
              Open

              CanvasContext.prototype.closePath = function() {
                  this.missions.push(() => {
                      this.ctx.closePath();
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 6 other locations - About 55 mins to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 108..112
              packages/render/miniapp/apiForH5/canvas.js on lines 114..118
              packages/render/miniapp/apiForH5/canvas.js on lines 120..124
              packages/render/miniapp/apiForH5/canvas.js on lines 163..167
              packages/render/miniapp/apiForH5/canvas.js on lines 283..287
              packages/render/miniapp/apiForH5/canvas.js on lines 289..293

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

              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 7 locations. Consider refactoring.
              Open

              CanvasContext.prototype.clip = function() {
                  this.missions.push(() => {
                      this.ctx.clip();
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 6 other locations - About 55 mins to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 108..112
              packages/render/miniapp/apiForH5/canvas.js on lines 114..118
              packages/render/miniapp/apiForH5/canvas.js on lines 120..124
              packages/render/miniapp/apiForH5/canvas.js on lines 126..130
              packages/render/miniapp/apiForH5/canvas.js on lines 283..287
              packages/render/miniapp/apiForH5/canvas.js on lines 289..293

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

              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 7 locations. Consider refactoring.
              Open

              CanvasContext.prototype.stroke = function() {
                  this.missions.push(() => {
                      this.ctx.stroke();
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 6 other locations - About 55 mins to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 108..112
              packages/render/miniapp/apiForH5/canvas.js on lines 120..124
              packages/render/miniapp/apiForH5/canvas.js on lines 126..130
              packages/render/miniapp/apiForH5/canvas.js on lines 163..167
              packages/render/miniapp/apiForH5/canvas.js on lines 283..287
              packages/render/miniapp/apiForH5/canvas.js on lines 289..293

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

              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 7 locations. Consider refactoring.
              Open

              CanvasContext.prototype.beginPath = function() {
                  this.missions.push(() => {
                      this.ctx.beginPath();
                  });
              };
              Severity: Major
              Found in packages/render/miniapp/apiForH5/canvas.js and 6 other locations - About 55 mins to fix
              packages/render/miniapp/apiForH5/canvas.js on lines 108..112
              packages/render/miniapp/apiForH5/canvas.js on lines 114..118
              packages/render/miniapp/apiForH5/canvas.js on lines 126..130
              packages/render/miniapp/apiForH5/canvas.js on lines 163..167
              packages/render/miniapp/apiForH5/canvas.js on lines 283..287
              packages/render/miniapp/apiForH5/canvas.js on lines 289..293

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

              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