linguisticexplorer/Linguistic-Explorer

View on GitHub
public/javascripts/canvg.js

Summary

Maintainability
F
1 mo
Test Coverage

Function build has 2112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function build() {
        var svg = { };
        
        svg.FRAMERATE = 30;
        svg.MAX_VIRTUAL_PIXELS = 30000;
Severity: Major
Found in public/javascripts/canvg.js - About 1 wk to fix

    File canvg.js has 2164 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * canvg.js - Javascript SVG parser and renderer on Canvas
     * MIT Licensed 
     * Gabe Lerner (gabelerner@gmail.com)
     * http://code.google.com/p/canvg/
    Severity: Major
    Found in public/javascripts/canvg.js - About 5 days to fix

      Function path has 291 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              svg.Element.path = function(node) {
                  this.base = svg.Element.PathElementBase;
                  this.base(node);
                          
                  var d = this.attribute('d').value;
      Severity: Major
      Found in public/javascripts/canvg.js - About 1 day to fix

        Function path has 166 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    this.path = function(ctx) {
                        var pp = this.PathParser;
                        pp.reset();
        
                        var bb = new svg.BoundingBox();
        Severity: Major
        Found in public/javascripts/canvg.js - About 6 hrs to fix

          Function ElementBase has 116 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  svg.Element.ElementBase = function(node) {    
                      this.attributes = {};
                      this.styles = {};
                      this.children = [];
                      
          Severity: Major
          Found in public/javascripts/canvg.js - About 4 hrs to fix

            Function PathParser has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        this.PathParser = new (function(d) {
                            this.tokens = d.split(' ');
                            
                            this.reset = function() {
                                this.i = -1;
            Severity: Major
            Found in public/javascripts/canvg.js - About 3 hrs to fix

              Function loadXmlDoc has 94 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      svg.loadXmlDoc = function(ctx, dom) {
                          svg.init(ctx);
                          
                          var mapXY = function(p) {
                              var e = ctx.canvas;
              Severity: Major
              Found in public/javascripts/canvg.js - About 3 hrs to fix

                Function Transform has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        svg.Transform = function(v) {    
                            var that = this;
                            this.Type = {}
                        
                            // translate
                Severity: Major
                Found in public/javascripts/canvg.js - About 3 hrs to fix

                  Function BoundingBox has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          svg.BoundingBox = function(x1, y1, x2, y2) { // pass in initial points if you want
                              this.x1 = Number.NaN;
                              this.y1 = Number.NaN;
                              this.x2 = Number.NaN;
                              this.y2 = Number.NaN;
                  Severity: Major
                  Found in public/javascripts/canvg.js - About 3 hrs to fix

                    Function TextElementBase has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            svg.Element.TextElementBase = function(node) {
                                this.base = svg.Element.RenderedElementBase;
                                this.base(node);
                                
                                this.getGlyph = function(font, text, i) {
                    Severity: Major
                    Found in public/javascripts/canvg.js - About 3 hrs to fix

                      Function AnimateBase has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              svg.Element.AnimateBase = function(node) {
                                  this.base = svg.Element.ElementBase;
                                  this.base(node);
                                  
                                  svg.Animations.push(this);
                      Severity: Major
                      Found in public/javascripts/canvg.js - About 2 hrs to fix

                        Function feGaussianBlur has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                svg.Element.feGaussianBlur = function(node) {
                                    this.base = svg.Element.ElementBase;
                                    this.base(node);    
                                    
                                    function make_fgauss(sigma) {
                        Severity: Major
                        Found in public/javascripts/canvg.js - About 2 hrs to fix

                          Function svg has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  svg.Element.svg = function(node) {
                                      this.base = svg.Element.RenderedElementBase;
                                      this.base(node);
                                      
                                      this.baseClearContext = this.clearContext;
                          Severity: Major
                          Found in public/javascripts/canvg.js - About 2 hrs to fix

                            Function text has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    svg.Element.text = function(node) {
                                        this.base = svg.Element.RenderedElementBase;
                                        this.base(node);
                                        
                                        if (node != null) {
                            Severity: Major
                            Found in public/javascripts/canvg.js - About 2 hrs to fix

                              Function RenderedElementBase has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      svg.Element.RenderedElementBase = function(node) {
                                          this.base = svg.Element.ElementBase;
                                          this.base(node);
                                          
                                          this.setContext = function(ctx) {
                              Severity: Major
                              Found in public/javascripts/canvg.js - About 2 hrs to fix

                                Function setContext has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            this.setContext = function(ctx) {
                                                // fill
                                                if (this.style('fill').isUrlDefinition()) {
                                                    var fs = this.style('fill').getFillStyleDefinition(this);
                                                    if (fs != null) ctx.fillStyle = fs;
                                Severity: Major
                                Found in public/javascripts/canvg.js - About 2 hrs to fix

                                  Function setContext has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              this.setContext = function(ctx) {
                                                  // initial values
                                                  ctx.strokeStyle = 'rgba(0,0,0,0)';
                                                  ctx.lineCap = 'butt';
                                                  ctx.lineJoin = 'miter';
                                  Severity: Minor
                                  Found in public/javascripts/canvg.js - About 1 hr to fix

                                    Function GradientBase has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            svg.Element.GradientBase = function(node) {
                                                this.base = svg.Element.ElementBase;
                                                this.base(node);
                                                
                                                this.gradientUnits = this.attribute('gradientUnits').valueOrDefault('objectBoundingBox');
                                    Severity: Minor
                                    Found in public/javascripts/canvg.js - About 1 hr to fix

                                      Function style has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              svg.Element.style = function(node) { 
                                                  this.base = svg.Element.ElementBase;
                                                  this.base(node);
                                                  
                                                  // text, or spaces then CDATA
                                      Severity: Minor
                                      Found in public/javascripts/canvg.js - About 1 hr to fix

                                        Function image has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                svg.Element.image = function(node) {
                                                    this.base = svg.Element.RenderedElementBase;
                                                    this.base(node);
                                                    
                                                    var href = this.attribute('xlink:href').value;
                                        Severity: Minor
                                        Found in public/javascripts/canvg.js - About 1 hr to fix

                                          Function draw has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                      var draw = function() {
                                                          svg.ViewPort.Clear();
                                                          if (ctx.canvas.parentNode) svg.ViewPort.SetCurrent(ctx.canvas.parentNode.clientWidth, ctx.canvas.parentNode.clientHeight);
                                                      
                                                          if (svg.opts['ignoreDimensions'] != true) {
                                          Severity: Minor
                                          Found in public/javascripts/canvg.js - About 1 hr to fix

                                            Function Mouse has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                    svg.Mouse = new (function() {
                                                        this.events = [];
                                                        this.hasEvents = function() { return this.events.length != 0; }
                                                    
                                                        this.onclick = function(x, y) {
                                            Severity: Minor
                                            Found in public/javascripts/canvg.js - About 1 hr to fix

                                              Function renderChildren has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                          this.renderChildren = function(ctx) {
                                                              var textAnchor = this.style('text-anchor').valueOrDefault('start');
                                                              var x = this.attribute('x').toPixels('x');
                                                              var y = this.attribute('y').toPixels('y');
                                                              for (var i=0; i<this.children.length; i++) {
                                              Severity: Minor
                                              Found in public/javascripts/canvg.js - About 1 hr to fix

                                                Function PathElementBase has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        svg.Element.PathElementBase = function(node) {
                                                            this.base = svg.Element.RenderedElementBase;
                                                            this.base(node);
                                                            
                                                            this.path = function(ctx) {
                                                Severity: Minor
                                                Found in public/javascripts/canvg.js - About 1 hr to fix

                                                  Function filter has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                          svg.Element.filter = function(node) {
                                                              this.base = svg.Element.ElementBase;
                                                              this.base(node);
                                                                          
                                                              this.apply = function(ctx, element) {
                                                  Severity: Minor
                                                  Found in public/javascripts/canvg.js - About 1 hr to fix

                                                    Function addBezierCurve has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                                this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
                                                                    // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
                                                                    var p0 = [p0x, p0y], p1 = [p1x, p1y], p2 = [p2x, p2y], p3 = [p3x, p3y];
                                                                    this.addPoint(p0[0], p0[1]);
                                                                    this.addPoint(p3[0], p3[1]);
                                                    Severity: Minor
                                                    Found in public/javascripts/canvg.js - About 1 hr to fix

                                                      Function createGradient has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                                  this.createGradient = function(ctx, element) {
                                                                      var stopsContainer = this;
                                                                      if (this.attribute('xlink:href').hasValue()) {
                                                                          stopsContainer = this.attribute('xlink:href').getDefinition();
                                                                      }
                                                      Severity: Minor
                                                      Found in public/javascripts/canvg.js - About 1 hr to fix

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

                                                            this.canvg = function (target, s, opts) {
                                                                // no parameters
                                                                if (target == null && s == null && opts == null) {
                                                                    var svgTags = document.getElementsByTagName('svg');
                                                                    for (var i=0; i<svgTags.length; i++) {
                                                        Severity: Minor
                                                        Found in public/javascripts/canvg.js - About 1 hr to fix

                                                          Function AspectRatio has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                                  svg.AspectRatio = function(ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) {
                                                          Severity: Major
                                                          Found in public/javascripts/canvg.js - About 1 hr to fix

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

                                                                    svg.Element.a = function(node) {
                                                                        this.base = svg.Element.TextElementBase;
                                                                        this.base(node);
                                                                        
                                                                        this.hasText = true;
                                                            Severity: Minor
                                                            Found in public/javascripts/canvg.js - About 1 hr to fix

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

                                                                      svg.Element.radialGradient = function(node) {
                                                                          this.base = svg.Element.GradientBase;
                                                                          this.base(node);
                                                                          
                                                                          this.getGradient = function(ctx, element) {
                                                              Severity: Minor
                                                              Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                Function Font has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        svg.Font = new (function() {
                                                                            this.Styles = 'normal|italic|oblique|inherit';
                                                                            this.Variants = 'normal|small-caps|inherit';
                                                                            this.Weights = 'normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit';
                                                                            
                                                                Severity: Minor
                                                                Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                  Function update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                              this.update = function(delta) {    
                                                                                  // set initial value
                                                                                  if (this.initialValue == null) {
                                                                                      this.initialValue = this.getProperty().value;
                                                                                      this.initialUnits = this.getProperty().getUnits();
                                                                  Severity: Minor
                                                                  Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                    Function renderChildren has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                                this.renderChildren = function(ctx) {
                                                                                    var customFont = this.parent.style('font-family').getDefinition();
                                                                                    if (customFont != null) {
                                                                                        var fontSize = this.parent.style('font-size').numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize);
                                                                                        var fontStyle = this.parent.style('font-style').valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle);
                                                                    Severity: Minor
                                                                    Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                      Function apply has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                                  this.apply = function(ctx, element) {
                                                                                      // render as temp svg    
                                                                                      var bb = element.getBoundingBox();
                                                                                      var x = this.attribute('x').toPixels('x');
                                                                                      var y = this.attribute('y').toPixels('y');
                                                                      Severity: Minor
                                                                      Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                        Function font has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                                svg.Element.font = function(node) {
                                                                                    this.base = svg.Element.ElementBase;
                                                                                    this.base(node);
                                                                        
                                                                                    this.horizAdvX = this.attribute('horiz-adv-x').numValue();            
                                                                        Severity: Minor
                                                                        Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                          Function mask has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                                  svg.Element.mask = function(node) {
                                                                                      this.base = svg.Element.ElementBase;
                                                                                      this.base(node);
                                                                                                  
                                                                                      this.apply = function(ctx, element) {
                                                                          Severity: Minor
                                                                          Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                            Function use has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                                    svg.Element.use = function(node) {
                                                                                        this.base = svg.Element.RenderedElementBase;
                                                                                        this.base(node);
                                                                                        
                                                                                        this.baseSetContext = this.setContext;
                                                                            Severity: Minor
                                                                            Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                              Function rect has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                      svg.Element.rect = function(node) {
                                                                                          this.base = svg.Element.PathElementBase;
                                                                                          this.base(node);
                                                                                          
                                                                                          this.path = function(ctx) {
                                                                              Severity: Minor
                                                                              Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                                Function getGradient has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                            this.getGradient = function(ctx, element) {
                                                                                                var bb = element.getBoundingBox();
                                                                                                
                                                                                                if (!this.attribute('cx').hasValue()) this.attribute('cx', true).value = '50%';
                                                                                                if (!this.attribute('cy').hasValue()) this.attribute('cy', true).value = '50%';
                                                                                Severity: Minor
                                                                                Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                                  Function addBezierCurve has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                  Open

                                                                                              this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
                                                                                  Severity: Major
                                                                                  Found in public/javascripts/canvg.js - About 1 hr to fix

                                                                                    Function imSet has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                    Open

                                                                                                function imSet(img, x, y, width, height, rgba, val) {
                                                                                    Severity: Major
                                                                                    Found in public/javascripts/canvg.js - About 50 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                                  for (var name in styles) {
                                                                                                                      this.styles[name] = styles[name];
                                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in public/javascripts/canvg.js - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                                if (typeof(this.glyphs[child.unicode]) == 'undefined') this.glyphs[child.unicode] = [];
                                                                                        Severity: Major
                                                                                        Found in public/javascripts/canvg.js - About 45 mins to fix

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

                                                                                                      this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { 
                                                                                          Severity: Minor
                                                                                          Found in public/javascripts/canvg.js - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                else if (!set.fontSize) { if (d[i] != 'inherit') f.fontSize = d[i].split('/')[0]; set.fontStyle = set.fontVariant = set.fontWeight = set.fontSize = true; }
                                                                                                                else { if (d[i] != 'inherit') ff += d[i]; }
                                                                                            Severity: Major
                                                                                            Found in public/javascripts/canvg.js - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                          if (cssClass == '@font-face') {
                                                                                                                              var fontFamily = props['font-family'].value.replace(/"/g,'');
                                                                                                                              var srcs = props['src'].value.split(',');
                                                                                                                              for (var s=0; s<srcs.length; s++) {
                                                                                                                                  if (srcs[s].indexOf('format("svg")') > 0) {
                                                                                              Severity: Major
                                                                                              Found in public/javascripts/canvg.js - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                            for (var name in styles) {
                                                                                                                                this.styles[name] = styles[name];
                                                                                                                            }
                                                                                                Severity: Major
                                                                                                Found in public/javascripts/canvg.js - About 45 mins to fix

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

                                                                                                              this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) {
                                                                                                  Severity: Minor
                                                                                                  Found in public/javascripts/canvg.js - About 45 mins to fix

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

                                                                                                                function imGet(img, x, y, width, height, rgba) {
                                                                                                    Severity: Minor
                                                                                                    Found in public/javascripts/canvg.js - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                          else if (!set.fontWeight && that.Weights.indexOf(d[i]) != -1) {    if (d[i] != 'inherit') f.fontWeight = d[i]; set.fontStyle = set.fontVariant = set.fontWeight = true; }
                                                                                                      Severity: Major
                                                                                                      Found in public/javascripts/canvg.js - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                    for (var k=0; k<cssProps.length; k++) {
                                                                                                                                        var prop = cssProps[k].indexOf(':');
                                                                                                                                        var name = cssProps[k].substr(0, prop);
                                                                                                                                        var value = cssProps[k].substr(prop + 1, cssProps[k].length - prop);
                                                                                                                                        if (name != null && value != null) {
                                                                                                        Severity: Major
                                                                                                        Found in public/javascripts/canvg.js - About 45 mins to fix

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

                                                                                                                      function convolve_even(src, dst, mask, width, height) {
                                                                                                          Severity: Minor
                                                                                                          Found in public/javascripts/canvg.js - About 35 mins to fix

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

                                                                                                                        this.apply = function(ctx, x, y, width, height) {
                                                                                                            Severity: Minor
                                                                                                            Found in public/javascripts/canvg.js - About 35 mins to fix

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

                                                                                                                  CanvasRenderingContext2D.prototype.drawSvg = function(s, dx, dy, dw, dh) {
                                                                                                              Severity: Minor
                                                                                                              Found in public/javascripts/canvg.js - About 35 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                                    if (s.match(/pc$/)) return this.numValue() * 15;
                                                                                                                Severity: Major
                                                                                                                Found in public/javascripts/canvg.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                                      if (s.match(/in$/)) return this.numValue() * this.getDPI(viewPort);
                                                                                                                  Severity: Major
                                                                                                                  Found in public/javascripts/canvg.js - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                                        if (s.match(/pt$/)) return this.numValue() * this.getDPI(viewPort) * (1.0 / 72.0);
                                                                                                                    Severity: Major
                                                                                                                    Found in public/javascripts/canvg.js - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                                          return this.numValue();
                                                                                                                      Severity: Major
                                                                                                                      Found in public/javascripts/canvg.js - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                            if (s.match(/%$/)) return this.numValue() * svg.ViewPort.ComputeSize(viewPort);
                                                                                                                        Severity: Major
                                                                                                                        Found in public/javascripts/canvg.js - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                              if (s.match(/cm$/)) return this.numValue() * this.getDPI(viewPort) / 2.54;
                                                                                                                          Severity: Major
                                                                                                                          Found in public/javascripts/canvg.js - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                                if (s.match(/mm$/)) return this.numValue() * this.getDPI(viewPort) / 25.4;
                                                                                                                            Severity: Major
                                                                                                                            Found in public/javascripts/canvg.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                                  return this.numValue() * (Math.PI / 180.0);
                                                                                                                              Severity: Major
                                                                                                                              Found in public/javascripts/canvg.js - About 30 mins to fix

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

                                                                                                                                                    case 's':
                                                                                                                                                        while (!pp.isCommandOrEnd()) {
                                                                                                                                                            var curr = pp.current;
                                                                                                                                                            var p1 = pp.getReflectedControlPoint();
                                                                                                                                                            var cntrl = pp.getAsControlPoint();
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 7 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 1284..1294

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

                                                                                                                                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 'c':
                                                                                                                                                        while (!pp.isCommandOrEnd()) {
                                                                                                                                                            var curr = pp.current;
                                                                                                                                                            var p1 = pp.getPoint();
                                                                                                                                                            var cntrl = pp.getAsControlPoint();
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 7 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 1296..1306

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.style('stroke').isUrlDefinition()) {
                                                                                                                                                    var fs = this.style('stroke').getFillStyleDefinition(this);
                                                                                                                                                    if (fs != null) ctx.strokeStyle = fs;
                                                                                                                                                }
                                                                                                                                                else if (this.style('stroke').hasValue()) {
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 6 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 746..754

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.style('fill').isUrlDefinition()) {
                                                                                                                                                    var fs = this.style('fill').getFillStyleDefinition(this);
                                                                                                                                                    if (fs != null) ctx.fillStyle = fs;
                                                                                                                                                }
                                                                                                                                                else if (this.style('fill').hasValue()) {
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 6 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 762..770

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if (child.attribute('y').hasValue()) {
                                                                                                                                                        child.y = child.attribute('y').toPixels('y');
                                                                                                                                                    }
                                                                                                                                                    else {
                                                                                                                                                        if (this.attribute('dy').hasValue()) y += this.attribute('dy').toPixels('y');
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 5 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 1884..1891

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if (child.attribute('x').hasValue()) {
                                                                                                                                                        child.x = child.attribute('x').toPixels('x');
                                                                                                                                                    }
                                                                                                                                                    else {
                                                                                                                                                        if (this.attribute('dx').hasValue()) y += this.attribute('dx').toPixels('x');
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 5 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 1906..1913

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (x != null) {
                                                                                                                                                    if (isNaN(this.x1) || isNaN(this.x2)) {
                                                                                                                                                        this.x1 = x;
                                                                                                                                                        this.x2 = x;
                                                                                                                                                    }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 3 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 365..372

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (y != null) {
                                                                                                                                                    if (isNaN(this.y1) || isNaN(this.y2)) {
                                                                                                                                                        this.y1 = y;
                                                                                                                                                        this.y2 = y;
                                                                                                                                                    }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 3 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 356..363

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

                                                                                                                                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

                                                                                                                                                ctx.canvas.onmousemove = function(e) {
                                                                                                                                                    var p = mapXY(new svg.Point(e != null ? e.clientX : event.clientX, e != null ? e.clientY : event.clientY));
                                                                                                                                                    svg.Mouse.onmousemove(p.x, p.y);
                                                                                                                                                };
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 3 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 2521..2524

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

                                                                                                                                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

                                                                                                                                                ctx.canvas.onclick = function(e) {
                                                                                                                                                    var p = mapXY(new svg.Point(e != null ? e.clientX : event.clientX, e != null ? e.clientY : event.clientY));
                                                                                                                                                    svg.Mouse.onclick(p.x, p.y);
                                                                                                                                                };
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 3 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 2525..2528

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.attribute('fx').hasValue()) {
                                                                                                                                                    fx = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.x() + bb.width() * this.attribute('fx').numValue() 
                                                                                                                                                    : this.attribute('fx').toPixels('x'));
                                                                                                                                                }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 3 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 1616..1620

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.attribute('fy').hasValue()) {
                                                                                                                                                    fy = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.y() + bb.height() * this.attribute('fy').numValue() 
                                                                                                                                                    : this.attribute('fy').toPixels('y'));
                                                                                                                                                }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 3 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 1611..1615

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if (e.attribute('width').hasValue()) xRatio = e.attribute('width').toPixels('x') / svg.opts['scaleWidth'];
                                                                                                                                                    else if (!isNaN(viewBox[2])) xRatio = viewBox[2] / svg.opts['scaleWidth'];
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 2 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 2565..2566

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if (e.attribute('height').hasValue()) yRatio = e.attribute('height').toPixels('y') / svg.opts['scaleHeight'];
                                                                                                                                                    else if (!isNaN(viewBox[3])) yRatio = viewBox[3] / svg.opts['scaleHeight'];
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 2 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 2563..2564

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

                                                                                                                                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

                                                                                                                                            this.onclick = function(x, y) {
                                                                                                                                                this.events.push({ type: 'onclick', x: x, y: y, 
                                                                                                                                                    run: function(e) { if (e.onclick) e.onclick(); }
                                                                                                                                                });
                                                                                                                                            }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 2 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 2639..2643

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

                                                                                                                                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

                                                                                                                                            this.onmousemove = function(x, y) {
                                                                                                                                                this.events.push({ type: 'onmousemove', x: x, y: y,
                                                                                                                                                    run: function(e) { if (e.onmousemove) e.onmousemove(); }
                                                                                                                                                });
                                                                                                                                            }            
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 2 hrs to fix
                                                                                                                                public/javascripts/canvg.js on lines 2633..2637

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

                                                                                                                                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

                                                                                                                                                var x1 = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.x() + bb.width() * this.attribute('x1').numValue() 
                                                                                                                                                    : this.attribute('x1').toPixels('x'));
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 5 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1574..1576
                                                                                                                                public/javascripts/canvg.js on lines 1577..1579
                                                                                                                                public/javascripts/canvg.js on lines 1580..1582
                                                                                                                                public/javascripts/canvg.js on lines 1602..1604
                                                                                                                                public/javascripts/canvg.js on lines 1605..1607

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

                                                                                                                                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

                                                                                                                                                var cx = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.x() + bb.width() * this.attribute('cx').numValue() 
                                                                                                                                                    : this.attribute('cx').toPixels('x'));
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 5 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1571..1573
                                                                                                                                public/javascripts/canvg.js on lines 1574..1576
                                                                                                                                public/javascripts/canvg.js on lines 1577..1579
                                                                                                                                public/javascripts/canvg.js on lines 1580..1582
                                                                                                                                public/javascripts/canvg.js on lines 1605..1607

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

                                                                                                                                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

                                                                                                                                                var y2 = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.y() + bb.height() * this.attribute('y2').numValue()
                                                                                                                                                    : this.attribute('y2').toPixels('y'));
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 5 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1571..1573
                                                                                                                                public/javascripts/canvg.js on lines 1574..1576
                                                                                                                                public/javascripts/canvg.js on lines 1577..1579
                                                                                                                                public/javascripts/canvg.js on lines 1602..1604
                                                                                                                                public/javascripts/canvg.js on lines 1605..1607

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

                                                                                                                                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

                                                                                                                                                var cy = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.y() + bb.height() * this.attribute('cy').numValue() 
                                                                                                                                                    : this.attribute('cy').toPixels('y'));
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 5 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1571..1573
                                                                                                                                public/javascripts/canvg.js on lines 1574..1576
                                                                                                                                public/javascripts/canvg.js on lines 1577..1579
                                                                                                                                public/javascripts/canvg.js on lines 1580..1582
                                                                                                                                public/javascripts/canvg.js on lines 1602..1604

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

                                                                                                                                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

                                                                                                                                                var y1 = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.y() + bb.height() * this.attribute('y1').numValue()
                                                                                                                                                    : this.attribute('y1').toPixels('y'));
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 5 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1571..1573
                                                                                                                                public/javascripts/canvg.js on lines 1577..1579
                                                                                                                                public/javascripts/canvg.js on lines 1580..1582
                                                                                                                                public/javascripts/canvg.js on lines 1602..1604
                                                                                                                                public/javascripts/canvg.js on lines 1605..1607

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

                                                                                                                                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

                                                                                                                                                var x2 = (this.gradientUnits == 'objectBoundingBox' 
                                                                                                                                                    ? bb.x() + bb.width() * this.attribute('x2').numValue()
                                                                                                                                                    : this.attribute('x2').toPixels('x'));
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 5 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1571..1573
                                                                                                                                public/javascripts/canvg.js on lines 1574..1576
                                                                                                                                public/javascripts/canvg.js on lines 1580..1582
                                                                                                                                public/javascripts/canvg.js on lines 1602..1604
                                                                                                                                public/javascripts/canvg.js on lines 1605..1607

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

                                                                                                                                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

                                                                                                                                            this.applyToPoint = function(p) {
                                                                                                                                                for (var i=0; i<this.transforms.length; i++) {
                                                                                                                                                    this.transforms[i].applyToPoint(p);
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 519..523

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

                                                                                                                                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

                                                                                                                                            this.apply = function(ctx) {
                                                                                                                                                for (var i=0; i<this.transforms.length; i++) {
                                                                                                                                                    this.transforms[i].apply(ctx);
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 525..529

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if (e.style('height').hasValue()) {
                                                                                                                                                        ctx.canvas.height = e.style('height').toPixels('y');
                                                                                                                                                        ctx.canvas.style.height = ctx.canvas.height + 'px';
                                                                                                                                                    }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 2542..2545

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

                                                                                                                                                if (this.style('stroke-opacity').hasValue()) {
                                                                                                                                                    var strokeStyle = new svg.Property('stroke', ctx.strokeStyle);
                                                                                                                                                    strokeStyle = strokeStyle.addOpacity(this.style('stroke-opacity').value);
                                                                                                                                                    ctx.strokeStyle = strokeStyle.value;
                                                                                                                                                }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 755..759

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

                                                                                                                                                    if (e.style('width').hasValue()) {
                                                                                                                                                        ctx.canvas.width = e.style('width').toPixels('x');
                                                                                                                                                        ctx.canvas.style.width = ctx.canvas.width + 'px';
                                                                                                                                                    }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 2546..2549

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

                                                                                                                                                if (this.style('fill-opacity').hasValue()) {
                                                                                                                                                    var fillStyle = new svg.Property('fill', ctx.fillStyle);
                                                                                                                                                    fillStyle = fillStyle.addOpacity(this.style('fill-opacity').value);
                                                                                                                                                    ctx.fillStyle = fillStyle.value;
                                                                                                                                                }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 771..775

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

                                                                                                                                                    if (0 < t1 && t1 < 1) {
                                                                                                                                                        if (i == 0) this.addX(f(t1));
                                                                                                                                                        if (i == 1) this.addY(f(t1));
                                                                                                                                                    }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 2 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 411..414
                                                                                                                                public/javascripts/canvg.js on lines 426..429

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                        if (0 < t && t < 1) {
                                                                                                                                                            if (i == 0) this.addX(f(t));
                                                                                                                                                            if (i == 1) this.addY(f(t));
                                                                                                                                                        }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 2 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 421..424
                                                                                                                                public/javascripts/canvg.js on lines 426..429

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if (0 < t2 && t2 < 1) {
                                                                                                                                                        if (i == 0) this.addX(f(t2));
                                                                                                                                                        if (i == 1) this.addY(f(t2));
                                                                                                                                                    }
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 2 other locations - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 411..414
                                                                                                                                public/javascripts/canvg.js on lines 421..424

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if ((i==0 || text[i-1]==' ') && i<text.length-2 && text[i+1]!=' ') arabicForm = 'terminal'; 
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1933..1933

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    if (i>0 && text[i-1]!=' ' && i<text.length-2 && text[i+1]!=' ') arabicForm = 'medial';
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1932..1932

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

                                                                                                                                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

                                                                                                                                                                (curr.x + cp.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y,
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1364..1364

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

                                                                                                                                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

                                                                                                                                                                (curr.y + cp.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 1 hr to fix
                                                                                                                                public/javascripts/canvg.js on lines 1363..1363

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    var fontSize = this.parent.style('font-size').numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize);
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 2 other locations - About 50 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 1951..1951
                                                                                                                                public/javascripts/canvg.js on lines 1989..1989

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 51.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    var fontStyle = this.parent.style('font-style').valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle);
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 2 other locations - About 50 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 1950..1950
                                                                                                                                public/javascripts/canvg.js on lines 1989..1989

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 51.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                    var fontSize = this.parent.style('font-size').numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize);
                                                                                                                                Severity: Major
                                                                                                                                Found in public/javascripts/canvg.js and 2 other locations - About 50 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 1950..1950
                                                                                                                                public/javascripts/canvg.js on lines 1951..1951

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 51.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.attribute('width').hasValue()) element.attribute('width', true).value = this.attribute('width').value;
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 50 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 2250..2250

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 51.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.attribute('height').hasValue()) element.attribute('height', true).value = this.attribute('height').value;
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 50 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 2249..2249

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 51.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (ctx.strokeStyle != '') ctx.strokeText(svg.compressSpaces(this.getText()), this.x, this.y);
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 40 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 1979..1979

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

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (ctx.fillStyle != '') ctx.fillText(svg.compressSpaces(this.getText()), this.x, this.y);
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 40 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 1978..1978

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

                                                                                                                                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

                                                                                                                                                c.width = this.attribute('width').toPixels('x') + this.attribute('x').toPixels('x');
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 35 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 1449..1449

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 47.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.attribute('rx').hasValue() && !this.attribute('ry').hasValue()) ry = rx;
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 35 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 946..946

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 47.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                if (this.attribute('ry').hasValue() && !this.attribute('rx').hasValue()) rx = ry;
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 35 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 945..945

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 47.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                c.height = this.attribute('height').toPixels('y')  + this.attribute('y').toPixels('y');
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 35 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 1448..1448

                                                                                                                                Duplicated Code

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

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

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

                                                                                                                                Tuning

                                                                                                                                This issue has a mass of 47.

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

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

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

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

                                                                                                                                Refactorings

                                                                                                                                Further Reading

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

                                                                                                                                                        else if (this.style('filter').hasValue()) {
                                                                                                                                                            var filter = this.style('filter').getDefinition();
                                                                                                                                                            if (filter != null) filter.apply(ctx, this);
                                                                                                                                                        }
                                                                                                                                                        else this.renderChildren(ctx);                
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 35 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 631..639

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

                                                                                                                                                        if (this.attribute('mask').hasValue()) {
                                                                                                                                                            var mask = this.attribute('mask').getDefinition();
                                                                                                                                                            if (mask != null) mask.apply(ctx, this);
                                                                                                                                                        }
                                                                                                                                                        else if (this.style('filter').hasValue()) {
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/javascripts/canvg.js and 1 other location - About 35 mins to fix
                                                                                                                                public/javascripts/canvg.js on lines 635..639

                                                                                                                                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