concord-consortium/rigse

View on GitHub
rails/app/assets/javascripts/pie/PIE_uncompressed.js

Summary

Maintainability
F
1 mo
Test Coverage

File PIE_uncompressed.js has 3169 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
PIE: CSS3 rendering for IE
Version 1.0.0
http://css3pie.com
Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.
Severity: Major
Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 wk to fix

    Consider simplifying this complex logical expression.
    Open

    if( !PIE ) {
        PIE = window.PIE = {
            CSS_PREFIX: '-pie-',
            STYLE_PREFIX: 'Pie',
            CLASS_PREFIX: 'pie_',
    Severity: Critical
    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 days to fix

      Function Element has 355 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      PIE.Element = (function() {
      
          var wrappers = {},
              lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init',
              pollCssProp = PIE.CSS_PREFIX + 'poll',
      Severity: Major
      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 day to fix

        Function Element has 286 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function Element( el ) {
                var renderers,
                    rootRenderer,
                    boundsInfo = new PIE.BoundsInfo( el ),
                    styleInfos,
        Severity: Major
        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 day to fix

          Function parseCss has 204 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              parseCss: function( css ) {
                  var el = this.targetElement,
                      cs = el.currentStyle,
                      tokenizer, token, image,
                      tok_type = PIE.Tokenizer.Type,
          Severity: Major
          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 day to fix

            Function Tokenizer has 182 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            PIE.Tokenizer = (function() {
                function Tokenizer( css ) {
                    this.css = css;
                    this.ch = 0;
                    this.tokens = [];
            Severity: Major
            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 7 hrs to fix

              Function getBorderSegments has 147 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getBorderSegments: function( mult ) {
                      var el = this.targetElement,
                          bounds, elW, elH,
                          borderInfo = this.styleInfos.borderInfo,
                          segments = [],
              Severity: Major
              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 5 hrs to fix

                Function next has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        next: function( forget ) {
                            var css, ch, firstChar, match, val,
                                me = this;
                
                            function newToken( type, value ) {
                Severity: Major
                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 4 hrs to fix

                  Function init has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function init() {
                              if( !initialized ) {
                                  var docEl,
                                      bounds,
                                      ieDocMode = PIE.ieDocMode,
                  Severity: Major
                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 4 hrs to fix

                    Function parseCss has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        parseCss: function( css ) {
                            var p = null, tokenizer, token, type, value,
                                slices, widths, outsets,
                                slashCount = 0,
                                Type = PIE.Tokenizer.Type,
                    Severity: Major
                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 4 hrs to fix

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

                          draw: function() {
                              var me = this,
                                  props = me.styleInfos.borderImageInfo.getProps(),
                                  borderProps = me.styleInfos.borderInfo.getProps(),
                                  bounds = me.boundsInfo.getBounds(),
                      Severity: Major
                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 3 hrs to fix

                        Function Color has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        PIE.Color = (function() {
                            var instances = {};
                        
                            function Color( val ) {
                                this.val = val;
                        Severity: Major
                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 3 hrs to fix

                          Function Length has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          PIE.Length = (function() {
                              var lengthCalcEl = doc.createElement( 'length-calc' ),
                                  parent = doc.body || doc.documentElement,
                                  s = lengthCalcEl.style,
                                  conversions = {},
                          Severity: Major
                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 3 hrs to fix

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

                                draw: function() {
                                    var me = this,
                                        el = this.targetElement,
                                        box = this.getBox(),
                                        styleInfos = this.styleInfos,
                            Severity: Major
                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 3 hrs to fix

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

                                  getGradientMetrics: function( el, width, height, gradientInfo ) {
                                      var angle = gradientInfo.angle,
                                          startPos = gradientInfo.gradientStart,
                                          startX, startY,
                                          endX, endY,
                              Severity: Major
                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if( !p.src || !slices || slices.length < 1 || slices.length > 4 ||
                                                ( widths && widths.length > 4 ) || ( slashCount === 1 && widths.length < 1 ) ||
                                                ( outsets && outsets.length > 4 ) || ( slashCount === 2 && outsets.length < 1 ) ) {
                                                return null;
                                            }
                                Severity: Critical
                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

                                  Function BgPosition has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  PIE.BgPosition = (function() {
                                  
                                      var length_fifty = PIE.getLength( '50%' ),
                                          vert_idents = { 'top': 1, 'center': 1, 'bottom': 1 },
                                          horiz_idents = { 'left': 1, 'center': 1, 'right': 1 };
                                  Severity: Major
                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

                                    Function addLinearGradient has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        addLinearGradient: function( shape, info ) {
                                            var el = this.targetElement,
                                                bounds = this.boundsInfo.getBounds(),
                                                w = bounds.w,
                                                h = bounds.h,
                                    Severity: Major
                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

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

                                          draw: function() {
                                              this.getBox(); //make sure pieces are created
                                      
                                              var props = this.styleInfos.borderImageInfo.getProps(),
                                                  borderProps = this.styleInfos.borderInfo.getProps(),
                                      Severity: Major
                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                                if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) &&
                                                                    isValue( next(), ',' ) &&
                                                                    isNumOrPct( next() ) &&
                                                                    isValue( next(), ',' ) &&
                                                                    isNumOrPct( next() ) &&
                                        Severity: Critical
                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 2 hrs to fix

                                          Function parseCss has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              parseCss: function( css ) {
                                                  var props,
                                                      getLength = PIE.getLength,
                                                      Type = PIE.Tokenizer.Type,
                                                      tokenizer;
                                          Severity: Minor
                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

                                            Function getGradientSvg has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                getGradientSvg: function( info, bgWidth, bgHeight ) {
                                                    var el = this.targetElement,
                                                        stopsInfo = info.stops,
                                                        stopCount = stopsInfo.length,
                                                        metrics = PIE.GradientUtil.getGradientMetrics( el, bgWidth, bgHeight, info ),
                                            Severity: Minor
                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                      getValues: function() {
                                                          if( !this._values ) {
                                                              var tokens = this.tokens,
                                                                  len = tokens.length,
                                                                  Tokenizer = PIE.Tokenizer,
                                              Severity: Minor
                                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

                                                Function getRadiiPixels has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    getRadiiPixels: function( radii ) {
                                                        var el = this.targetElement,
                                                            bounds = this.boundsInfo.getBounds(),
                                                            w = bounds.w,
                                                            h = bounds.h,
                                                Severity: Minor
                                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

                                                  Consider simplifying this complex logical expression.
                                                  Open

                                                          if( css ) {
                                                              tokenizer = new PIE.Tokenizer( css );
                                                              p = {};
                                                  
                                                              isSlash = function ( token ) {
                                                  Severity: Critical
                                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                        parseCss: function( css ) {
                                                            var w = {},
                                                                s = {},
                                                                c = {},
                                                                active = false,
                                                    Severity: Minor
                                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                          positionBgImage: function( shape, index ) {
                                                              var me = this;
                                                              PIE.Util.withImageSize( shape.fill.src, function( size ) {
                                                                  var el = me.targetElement,
                                                                      bounds = me.boundsInfo.getBounds(),
                                                      Severity: Minor
                                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                            parseCss: function( css ) {
                                                                var p = null, x, y,
                                                                    tokenizer, token, length,
                                                                    hasNonZero = false;
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                              updatePos: function() {
                                                                  if( this.isActive() ) {
                                                                      var el = this.getPositioningElement(),
                                                                          par = el,
                                                                          docEl,
                                                          Severity: Minor
                                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                getBoxPath: function( shrink, mult, radii ) {
                                                                    mult = mult || 1;
                                                            
                                                                    var r, str,
                                                                        bounds = this.boundsInfo.getBounds(),
                                                            Severity: Minor
                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                  hideBorder: function() {
                                                                      var el = this.targetElement,
                                                                          cs = el.currentStyle,
                                                                          rs = el.runtimeStyle,
                                                                          tag = el.tagName,
                                                              Severity: Minor
                                                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                PIE.BgSize = (function() {
                                                                
                                                                    var CONTAIN = 'contain',
                                                                        COVER = 'cover',
                                                                        AUTO = 'auto';
                                                                Severity: Minor
                                                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                      draw: function() {
                                                                          this._lastSrc = src;
                                                                          this.hideActualImg();
                                                                  
                                                                          var shape = this.getShape( 'img', 'fill', this.getBox() ),
                                                                  Severity: Minor
                                                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

                                                                    Consider simplifying this complex logical expression.
                                                                    Open

                                                                                    if( lazy && ( bounds = boundsInfo.getBounds() ) && ( docEl = doc.documentElement || doc.body ) &&
                                                                                            ( bounds.y > docEl.clientHeight || bounds.x > docEl.clientWidth || bounds.y + bounds.h < 0 || bounds.x + bounds.w < 0 ) ) {
                                                                                        if( !delayed ) {
                                                                                            delayed = 1;
                                                                                            PIE.OnScroll.observe( init );
                                                                    Severity: Critical
                                                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                          draw: function() {
                                                                              var el = this.targetElement,
                                                                                  props = this.styleInfos.borderInfo.getProps(),
                                                                                  bounds = this.boundsInfo.getBounds(),
                                                                                  w = bounds.w,
                                                                      Severity: Minor
                                                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                            drawBgImages: function() {
                                                                                var props = this.styleInfos.backgroundInfo.getProps(),
                                                                                    bounds = this.boundsInfo.getBounds(),
                                                                                    images = props && props.bgImages,
                                                                                    img, shape, w, h, s, i;
                                                                        Severity: Minor
                                                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                                      function addImage( x, y, w, h, cropX, cropY, cropW, cropH, tileW, tileH ) {
                                                                          Severity: Major
                                                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                                withActualBg: function( fn ) {
                                                                                    var isIE9 = PIE.ieDocMode > 8,
                                                                                        propNames = this.propertyNames,
                                                                                        rs = this.targetElement.runtimeStyle,
                                                                                        rsImage = rs[propNames.IMAGE],
                                                                            Severity: Minor
                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                                  draw: function() {
                                                                                      var me = this,
                                                                                          props = me.styleInfos.backgroundInfo.getProps(),
                                                                                          bg, images, i = 0, img, bgAreaSize, bgSize;
                                                                              
                                                                              
                                                                              Severity: Minor
                                                                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

                                                                                Consider simplifying this complex logical expression.
                                                                                Open

                                                                                        if( css ) {
                                                                                            tokenizer = new PIE.Tokenizer( css );
                                                                                
                                                                                            collectLengths = function () {
                                                                                                var arr = [], num;
                                                                                Severity: Major
                                                                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

                                                                                  Consider simplifying this complex logical expression.
                                                                                  Open

                                                                                          if( ( isIE6 && ( tag in PIE.childlessElements || tag === 'FIELDSET' ) ) ||
                                                                                                  tag === 'BUTTON' || ( tag === 'INPUT' && el.type in PIE.inputButtonTypes ) ) {
                                                                                              rs.borderWidth = '';
                                                                                              sides = this.styleInfos.borderInfo.sides;
                                                                                              for( i = sides.length; i--; ) {
                                                                                  Severity: Major
                                                                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

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

                                                                                            function getShadowShape( index, corner, xOff, yOff, color, blur, path ) {
                                                                                    Severity: Major
                                                                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 50 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                          while( (token = tokenizer.next()) ) {
                                                                                                              tokType = token.tokenType;
                                                                                                              tokVal = token.tokenValue;
                                                                                      
                                                                                                              // If we reached the end of the function and had at least 2 stops, flush the info
                                                                                      Severity: Major
                                                                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                                if( el.tagName === 'IMG' ) {
                                                                                                                    childRenderers.push( new PIE.ImgRenderer( el, boundsInfo, styleInfos, rootRenderer ) );
                                                                                                                }
                                                                                        Severity: Major
                                                                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                          else if( ( type & Type.URL ) && !p.src ) {
                                                                                                              p.src =  value;
                                                                                                          }
                                                                                          
                                                                                                          // Found something unrecognized; exit.
                                                                                          Severity: Major
                                                                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                else if( tokens[1].isLengthOrPercent() ) {
                                                                                                                    vals[3] = PIE.getLength( tokens[1].tokenValue );
                                                                                                                }
                                                                                            Severity: Major
                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                  if( (token = tokenizer.next()) ) {
                                                                                                                      if( ( token.tokenType & IDENT ) && this.repeatIdents[token.tokenValue] ) {
                                                                                                                          p.repeat.v = token.tokenValue;
                                                                                                                      } else {
                                                                                                                          tokenizer.prev();
                                                                                              Severity: Major
                                                                                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                        if( !renderer.isPositioned ) {
                                                                                                                            renderer.updatePos();
                                                                                                                        }
                                                                                                Severity: Major
                                                                                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                      for( j = 4; j--; ) {
                                                                                                                          corner = corners[j];
                                                                                                                          isBottom = corner.charAt( 0 ) === 'b';
                                                                                                                          isRight = corner.charAt( 1 ) === 'r';
                                                                                                                          shape = getShadowShape( i, corner, xOff, yOff, color, blur, path );
                                                                                                  Severity: Major
                                                                                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                            for( i = 0; i < len; i++ ) {
                                                                                                                                renderers[i].updatePos();
                                                                                                                            }
                                                                                                    Severity: Major
                                                                                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                                  if( image && image !== 'none' ) {
                                                                                                                                      sizeParts = sizes[i].split( ' ' );
                                                                                                                                      props.bgImages.push( {
                                                                                                                                          origString: image + ' ' + repeats[ i ] + ' ' + positions[ i ] + ' / ' + sizes[ i ] + ' ' +
                                                                                                                                                      origins[ i ] + ' ' + clips[ i ],
                                                                                                      Severity: Major
                                                                                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                if( tokens[1].tokenValue === 'center' ) {
                                                                                                                                    vals[3] = length_fifty;
                                                                                                                                } else {
                                                                                                                                    vals[2] = tokens[1].tokenValue;
                                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                              if (img.imgType === 'linear-gradient' ) {
                                                                                                                                  bgAreaSize = me.getBgAreaSize( img.bgOrigin );
                                                                                                                                  bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels(
                                                                                                                                      me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h
                                                                                                                                  ),
                                                                                                          Severity: Major
                                                                                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                            Avoid deeply nested control flow statements.
                                                                                                            Open

                                                                                                                                else if( tokens[0].isLengthOrPercent() ) {
                                                                                                                                    vals[1] = PIE.getLength( tokens[0].tokenValue );
                                                                                                                                }
                                                                                                            Severity: Major
                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                              Avoid deeply nested control flow statements.
                                                                                                              Open

                                                                                                                              while( (child = el.firstChild) ) {
                                                                                                                                  cont.appendChild( child );
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                Open

                                                                                                                                        if( renderer.needsUpdate() ) {
                                                                                                                                            renderer.updateProps();
                                                                                                                                        }
                                                                                                                Severity: Major
                                                                                                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                  Open

                                                                                                                                          for( i = 0; i < len; i++ ) {
                                                                                                                                              renderers[i].updateSize();
                                                                                                                                          }
                                                                                                                  Severity: Major
                                                                                                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                    Open

                                                                                                                                            if( tokens[0].tokenValue === 'center' ) {
                                                                                                                                                vals[1] = length_fifty;
                                                                                                                                            } else {
                                                                                                                                                vals[0] = tokens[0].tokenValue;
                                                                                                                                            }
                                                                                                                    Severity: Major
                                                                                                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                      Open

                                                                                                                                      else if( !image.imgType && tokType & tok_type.URL ) {
                                                                                                                                          image.imgUrl = tokVal;
                                                                                                                                          image.imgType = 'image';
                                                                                                                                      }
                                                                                                                                      else if( isBgPosToken( token ) && !image.bgPosition ) {
                                                                                                                      Severity: Major
                                                                                                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                        Open

                                                                                                                                            if( token.tokenType & PIE.Tokenizer.Type.OPERATOR && token.tokenValue === '/' ) {
                                                                                                                                                y = collectLengths();
                                                                                                                                            }
                                                                                                                        Severity: Major
                                                                                                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                                  if( styles[ side ] === 'dashed' || styles[ side ] === 'dotted' ) {
                                                                                                                                                      segments.push( {
                                                                                                                                                          path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) +
                                                                                                                                                                curve( cornerBefore, 0, 0, baseAngle, 1, 0 ),
                                                                                                                                                          fill: colors[ side ]
                                                                                                                          Severity: Major
                                                                                                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                            Open

                                                                                                                                                    if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) &&
                                                                                                                                                        isValue( next(), ',' ) &&
                                                                                                                                                        isNumOrPct( next() ) &&
                                                                                                                                                        isValue( next(), ',' ) &&
                                                                                                                                                        isNumOrPct( next() ) &&
                                                                                                                            Severity: Major
                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 45 mins to fix

                                                                                                                              Consider simplifying this complex logical expression.
                                                                                                                              Open

                                                                                                                                          if( borderProps.widthsSame && borderProps.stylesSame && borderProps.colorsSame ) {
                                                                                                                                              if( colors.t.alpha() > 0 ) {
                                                                                                                                                  // shortcut for identical border on all sides - only need 1 stroked shape
                                                                                                                                                  wT = widths.t.pixels( el ); //thickness
                                                                                                                                                  wR = wT / 2; //shrink
                                                                                                                              Severity: Major
                                                                                                                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 40 mins to fix

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

                                                                                                                                            function setSizeAndPos( piece, w, h, x, y ) {
                                                                                                                                Severity: Minor
                                                                                                                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 35 mins to fix

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

                                                                                                                                      perpendicularIntersect: function( x1, y1, angle, x2, y2 ) {
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 35 mins to fix

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

                                                                                                                                            pixels: function( el, areaW, areaH, imgW, imgH ) {
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 35 mins to fix

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                                  return newToken( Type.CHARACTER, firstChar );
                                                                                                                                      Severity: Major
                                                                                                                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                                                return newToken( Type.URL, match[2] || match[3] || match[4] || '' );
                                                                                                                                        Severity: Major
                                                                                                                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                                                  return failure();
                                                                                                                                          Severity: Major
                                                                                                                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                                return newToken( Type.PERCENT, val + '%' );
                                                                                                                                            Severity: Major
                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                                  return newToken( Type.FUNCTION, val );
                                                                                                                                              Severity: Major
                                                                                                                                              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                                            return newToken( Type.COLOR, this.css.substring( ch, this.ch ) );
                                                                                                                                                Severity: Major
                                                                                                                                                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                                  return newToken( Type.NUMBER, val );
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                                        return newToken( Type.OPERATOR, firstChar );
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                                          return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val );
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                                            return newToken( Type.COLOR, val );
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                          return newToken( Type.IDENT, val );
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

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

                                                                                                                                                                                if( tokens[0].tokenType & type_ident ) {
                                                                                                                                                                                    if( tokens[0].tokenValue === 'center' ) {
                                                                                                                                                                                        vals[1] = length_fifty;
                                                                                                                                                                                    } else {
                                                                                                                                                                                        vals[0] = tokens[0].tokenValue;
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 4 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 695..704

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

                                                                                                                                                            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( tokens[1].tokenType & type_ident ) {
                                                                                                                                                                                    if( tokens[1].tokenValue === 'center' ) {
                                                                                                                                                                                        vals[3] = length_fifty;
                                                                                                                                                                                    } else {
                                                                                                                                                                                        vals[2] = tokens[1].tokenValue;
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 4 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 685..694

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 118.

                                                                                                                                                            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

                                                                                                                                                                    for( i = 0; i < stopCount; i++ ) {
                                                                                                                                                                        stopPx.push( stopsInfo[i].offset ? stopsInfo[i].offset.pixels( el, lineLength ) :
                                                                                                                                                                                     i === 0 ? 0 : i === stopCount - 1 ? lineLength : null );
                                                                                                                                                                    }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2877..2880

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

                                                                                                                                                            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

                                                                                                                                                                    for( i = 0; i < stopCount; i++ ) {
                                                                                                                                                                        stopPx.push( stops[i].offset ? stops[i].offset.pixels( el, lineLength ) :
                                                                                                                                                                                     i === 0 ? 0 : i === stopCount - 1 ? lineLength : null );
                                                                                                                                                                    }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3702..3705

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

                                                                                                                                                            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

                                                                                                                                                                function delayAddClass( el, className /*, className2*/ ) {
                                                                                                                                                                    var classes = dummyArray.slice.call( arguments, 1 ),
                                                                                                                                                                        i = classes.length;
                                                                                                                                                                    setTimeout( function() {
                                                                                                                                                                        if( el ) {
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3965..3975

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

                                                                                                                                                            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

                                                                                                                                                                function delayRemoveClass( el, className /*, className2*/ ) {
                                                                                                                                                                    var classes = dummyArray.slice.call( arguments, 1 ),
                                                                                                                                                                        i = classes.length;
                                                                                                                                                                    setTimeout( function() {
                                                                                                                                                                        if( el ) {
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3953..3963

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

                                                                                                                                                            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( stopPx[ i ] === null ) {
                                                                                                                                                                            before = stopPx[ i - 1 ];
                                                                                                                                                                            j = i;
                                                                                                                                                                            do {
                                                                                                                                                                                after = stopPx[ ++j ];
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2883..2890

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

                                                                                                                                                            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( stopPx[ i ] === null ) {
                                                                                                                                                                            before = stopPx[ i - 1 ];
                                                                                                                                                                            j = i;
                                                                                                                                                                            do {
                                                                                                                                                                                after = stopPx[ ++j ];
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3708..3715

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

                                                                                                                                                            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

                                                                                                                                                                positionChanged: function() {
                                                                                                                                                                    var last = this._lastBounds,
                                                                                                                                                                        bounds;
                                                                                                                                                                    return !last || ( ( bounds = this.getBounds() ) && ( last.x !== bounds.x || last.y !== bounds.y ) );
                                                                                                                                                                },
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 1237..1241

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

                                                                                                                                                            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

                                                                                                                                                                sizeChanged: function() {
                                                                                                                                                                    var last = this._lastBounds,
                                                                                                                                                                        bounds;
                                                                                                                                                                    return !last || ( ( bounds = this.getBounds() ) && ( last.w !== bounds.w || last.h !== bounds.h ) );
                                                                                                                                                                },
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 2 hrs to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 1231..1235

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

                                                                                                                                                            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( widths && widths[0] ) {
                                                                                                                                                                            p.widths = distributeSides( widths, function( tok ) {
                                                                                                                                                                                return tok.isLengthOrPercent() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue;
                                                                                                                                                                            } );
                                                                                                                                                                        }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 1 hr to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2052..2056

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

                                                                                                                                                            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( outsets && outsets[0] ) {
                                                                                                                                                                            p.outset = distributeSides( outsets, function( tok ) {
                                                                                                                                                                                return tok.isLength() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue;
                                                                                                                                                                            } );
                                                                                                                                                                        }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 1 hr to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2046..2050

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

                                                                                                                                                            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 (repeatH === ROUND) {
                                                                                                                                                                            tileSizeT -= (tileSizeT - (centerW % tileSizeT || tileSizeT)) / ceil(centerW / tileSizeT);
                                                                                                                                                                            tileSizeB -= (tileSizeB - (centerW % tileSizeB || tileSizeB)) / ceil(centerW / tileSizeB);
                                                                                                                                                                        }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 1 hr to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3833..3836

                                                                                                                                                            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 (repeatV === ROUND) {
                                                                                                                                                                            tileSizeR -= (tileSizeR - (middleH % tileSizeR || tileSizeR)) / ceil(middleH / tileSizeR);
                                                                                                                                                                            tileSizeL -= (tileSizeL - (middleH % tileSizeL || tileSizeL)) / ceil(middleH / tileSizeL);
                                                                                                                                                                        }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 1 hr to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3829..3832

                                                                                                                                                            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

                                                                                                                                                                var Type = Tokenizer.Type = {
                                                                                                                                                                    ANGLE: 1,
                                                                                                                                                                    CHARACTER: 2,
                                                                                                                                                                    COLOR: 4,
                                                                                                                                                                    DIMEN: 8,
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 1 hr to fix
                                                                                                                                                            rails/app/assets/javascripts/prototype.js on lines 2058..2071

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 62.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

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

                                                                                                                                                                isActive: function() {
                                                                                                                                                                    var si = this.styleInfos;
                                                                                                                                                                    return si.borderRadiusInfo.isActive() || si.backgroundInfo.isPngFix();
                                                                                                                                                                },
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 4 other locations - About 45 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2655..2658
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2945..2948
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3359..3362
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3612..3615

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 50.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

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

                                                                                                                                                                isActive: function() {
                                                                                                                                                                    var si = this.styleInfos;
                                                                                                                                                                    return si.backgroundInfo.isActive() || si.borderImageInfo.isActive();
                                                                                                                                                                },
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 4 other locations - About 45 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2655..2658
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2945..2948
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3359..3362
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3501..3504

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 50.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

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

                                                                                                                                                                needsUpdate: function() {
                                                                                                                                                                    var si = this.styleInfos;
                                                                                                                                                                    return si.backgroundInfo.changed() || si.borderRadiusInfo.changed();
                                                                                                                                                                },
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 4 other locations - About 45 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2945..2948
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3359..3362
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3501..3504
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3612..3615

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 50.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

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

                                                                                                                                                                needsUpdate: function() {
                                                                                                                                                                    var si = this.styleInfos;
                                                                                                                                                                    return si.boxShadowInfo.changed() || si.borderRadiusInfo.changed();
                                                                                                                                                                },
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 4 other locations - About 45 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2655..2658
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2945..2948
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3501..3504
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3612..3615

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 50.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

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

                                                                                                                                                                needsUpdate: function() {
                                                                                                                                                                    var si = this.styleInfos;
                                                                                                                                                                    return si.borderInfo.changed() || si.borderRadiusInfo.changed();
                                                                                                                                                                },
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 4 other locations - About 45 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2655..2658
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3359..3362
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3501..3504
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 3612..3615

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 50.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

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

                                                                                                                                                                                if( repeat === 'repeat-x' || repeat === 'no-repeat' ) {
                                                                                                                                                                                    clipT = pxY + 1;
                                                                                                                                                                                    clipB = pxY + size.h + clipAdjust;
                                                                                                                                                                                }
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 40 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2809..2812

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

                                                                                                                                                            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( repeat === 'repeat-y' || repeat === 'no-repeat' ) {
                                                                                                                                                                                    clipL = pxX + 1;
                                                                                                                                                                                    clipR = pxX + size.w + clipAdjust;
                                                                                                                                                                                }
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 40 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2805..2808

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

                                                                                                                                                            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

                                                                                                                                                                        for( var i = 0, len = elements.length; i < len; i++ ) {
                                                                                                                                                                            PIE.attach( elements[i] );
                                                                                                                                                                        }
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 35 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/prototype.js on lines 4503..4505

                                                                                                                                                            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 ( w === COVER ) {
                                                                                                                                                                            w = imgRatio < areaRatio ? areaW : areaH * imgRatio;
                                                                                                                                                                            h = imgRatio < areaRatio ? areaW / imgRatio : areaH;
                                                                                                                                                                        }
                                                                                                                                                                        else if ( w === AUTO ) {
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 35 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 765..780

                                                                                                                                                            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 ( w === CONTAIN ) {
                                                                                                                                                                            w = imgRatio > areaRatio ? areaW : areaH * imgRatio;
                                                                                                                                                                            h = imgRatio > areaRatio ? areaW / imgRatio : areaH;
                                                                                                                                                                        }
                                                                                                                                                                        else if ( w === COVER ) {
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 35 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 769..780

                                                                                                                                                            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

                                                                                                                                                                updateSize: function() {
                                                                                                                                                                    if( this.isActive() ) {
                                                                                                                                                                        this.draw();
                                                                                                                                                                    } else {
                                                                                                                                                                        this.destroy();
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 30 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2604..2610

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 45.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

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

                                                                                                                                                                updateProps: function() {
                                                                                                                                                                    if( this.isActive() ) {
                                                                                                                                                                        this.updateVisibility();
                                                                                                                                                                    } else {
                                                                                                                                                                        this.destroy();
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js and 1 other location - About 30 mins to fix
                                                                                                                                                            rails/app/assets/javascripts/pie/PIE_uncompressed.js on lines 2226..2232

                                                                                                                                                            Duplicated Code

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

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

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

                                                                                                                                                            Tuning

                                                                                                                                                            This issue has a mass of 45.

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

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

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

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

                                                                                                                                                            Refactorings

                                                                                                                                                            Further Reading

                                                                                                                                                            There are no issues that match your filters.

                                                                                                                                                            Category
                                                                                                                                                            Status