devworkstecnology/webadmin

View on GitHub
vendor/assets/javascripts/ie/excanvas.js

Summary

Maintainability
F
6 days
Test Coverage

File excanvas.js has 655 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2006 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Severity: Major
Found in vendor/assets/javascripts/ie/excanvas.js - About 1 day to fix

    Function stroke has 143 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      contextPrototype.stroke = function(aFill) {
        var lineStr = [];
        var lineOpen = false;
        var a = processStyle(aFill ? this.fillStyle : this.strokeStyle);
        var color = a.color;
    Severity: Major
    Found in vendor/assets/javascripts/ie/excanvas.js - About 5 hrs to fix

      Function drawImage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        contextPrototype.drawImage = function(image, var_args) {
          var dx, dy, dw, dh, sx, sy, sw, sh;
      
          // to find the original width we overide the width and height
          var oldRuntimeWidth = image.runtimeStyle.width;
      Severity: Major
      Found in vendor/assets/javascripts/ie/excanvas.js - About 3 hrs to fix

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

          contextPrototype.arc = function(aX, aY, aRadius,
                                          aStartAngle, aEndAngle, aClockwise) {
        Severity: Minor
        Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                  if (angle < 0) {
                    angle += 360;
                  }
          Severity: Major
          Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                    if (angle < 1e-6) {
                      angle = 0;
                    }
            Severity: Major
            Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
                                                          aCP2x, aCP2y,
                                                          aX, aY) {
              Severity: Minor
              Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
                                                                   aX1, aY1, aR1) {
                Severity: Minor
                Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                    contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
                  Severity: Minor
                  Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                      contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
                    Severity: Minor
                    Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                        contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
                          var oldPath = this.currentPath_;
                          this.beginPath();
                      
                          this.moveTo(aX, aY);
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 5 hrs to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 442..454

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

                      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

                        contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
                          var oldPath = this.currentPath_;
                          this.beginPath();
                      
                          this.moveTo(aX, aY);
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 5 hrs to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 428..440

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

                      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

                        contextPrototype.moveTo = function(aX, aY) {
                          var p = this.getCoords_(aX, aY);
                          this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y});
                          this.currentX_ = p.x;
                          this.currentY_ = p.y;
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 3 hrs to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 337..343

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

                      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

                        contextPrototype.lineTo = function(aX, aY) {
                          var p = this.getCoords_(aX, aY);
                          this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y});
                      
                          this.currentX_ = p.x;
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 3 hrs to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 330..335

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

                      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

                            x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
                      Severity: Minor
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 55 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 783..783

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

                      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

                            case 'height':
                              el.style.height = el.attributes.height.nodeValue + 'px';
                              el.getContext().clearRect();
                              break;
                      Severity: Minor
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 55 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 175..178

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

                      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

                            case 'width':
                              el.style.width = el.attributes.width.nodeValue + 'px';
                              el.getContext().clearRect();
                              break;
                      Severity: Minor
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 55 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 179..182

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

                      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

                            y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
                      Severity: Minor
                      Found in vendor/assets/javascripts/ie/excanvas.js and 1 other location - About 55 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 782..782

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

                      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 (max.y == null || p.y > max.y) {
                                max.y = p.y;
                              }
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 3 other locations - About 35 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 647..649
                      vendor/assets/javascripts/ie/excanvas.js on lines 650..652
                      vendor/assets/javascripts/ie/excanvas.js on lines 653..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 46.

                      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 (min.x == null || p.x < min.x) {
                                min.x = p.x;
                              }
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 3 other locations - About 35 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 650..652
                      vendor/assets/javascripts/ie/excanvas.js on lines 653..655
                      vendor/assets/javascripts/ie/excanvas.js on lines 656..658

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

                      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 (max.x == null || p.x > max.x) {
                                max.x = p.x;
                              }
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 3 other locations - About 35 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 647..649
                      vendor/assets/javascripts/ie/excanvas.js on lines 653..655
                      vendor/assets/javascripts/ie/excanvas.js on lines 656..658

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

                      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 (min.y == null || p.y < min.y) {
                                min.y = p.y;
                              }
                      Severity: Major
                      Found in vendor/assets/javascripts/ie/excanvas.js and 3 other locations - About 35 mins to fix
                      vendor/assets/javascripts/ie/excanvas.js on lines 647..649
                      vendor/assets/javascripts/ie/excanvas.js on lines 650..652
                      vendor/assets/javascripts/ie/excanvas.js on lines 656..658

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

                      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