bborn/communityengine

View on GitHub
app/assets/javascripts/jcrop/jquery.Jcrop.js

Summary

Maintainability
F
2 wks
Test Coverage

Function Jcrop has 1311 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.Jcrop = function (obj, opt) {
    var options = $.extend({}, $.Jcrop.defaults),
        docOffset, lastcurs, ie6mode = false;

    // Internal Methods {{{
Severity: Major
Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 6 days to fix

    File jquery.Jcrop.js has 1396 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * jquery.Jcrop.js v0.9.10
     * jQuery Image Cropping Plugin - released under MIT License 
     * Author: Kelly Hallman <khallman@gmail.com>
     * http://github.com/tapmodo/Jcrop
    Severity: Major
    Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 3 days to fix

      Function Coords has 252 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Coords = (function () {
            var x1 = 0,
                y1 = 0,
                x2 = 0,
                y2 = 0,
      Severity: Major
      Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 1 day to fix

        Function Selection has 213 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var Selection = (function () {
              var awake,
                  hdep = 370,
                  borders = {},
                  handle = {},
        Severity: Major
        Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 1 day to fix

          Function Shade has 110 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var Shade = (function() {
                var enabled = false,
                    holder = $('<div />').css({
                      position: 'absolute',
                      zIndex: 240,
          Severity: Major
          Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 4 hrs to fix

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

                  function getFixed() //{{{
                  {
                    if (!options.aspectRatio) {
                      return getRect();
                    }
            Severity: Major
            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 3 hrs to fix

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

                  var Tracker = (function () {
                    var onMove = function () {},
                        onDone = function () {},
                        trackDoc = options.trackDocument;
              
              
              Severity: Major
              Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 3 hrs to fix

                Function KeyManager has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var KeyManager = (function () {
                      var $keymgr = $('<input type="radio" />').css({
                        position: 'fixed',
                        left: '-120px',
                        width: '12px'
                Severity: Major
                Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 2 hrs to fix

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

                        function getRect() //{{{
                        {
                          var xsize = x2 - x1,
                              ysize = y2 - y1,
                              delta;
                  Severity: Major
                  Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 2 hrs to fix

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

                        var Touch = (function () {
                          // Touch support detection function adapted (under MIT License)
                          // from code by Jeffrey Sambells - http://github.com/iamamused/
                          function hasTouchSupport() {
                            var support = {},
                    Severity: Major
                    Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 2 hrs to fix

                      Function animateTo has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function animateTo(a, callback) //{{{
                          {
                            var x1 = a[0] / xscale,
                                y1 = a[1] / yscale,
                                x2 = a[2] / xscale,
                      Severity: Minor
                      Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 2 hrs to fix

                        Function interfaceUpdate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function interfaceUpdate(alt) //{{{
                            // This method tweaks the interface based on options object.
                            // Called when options are changed and at end of initialization.
                            {
                              if (options.allowResize) {
                        Severity: Minor
                        Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 1 hr to fix

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

                              function dragmodeHandler(mode, f) //{{{
                              {
                                return function (pos) {
                                  if (!options.aspectRatio) {
                                    switch (mode) {
                          Severity: Minor
                          Found in app/assets/javascripts/jcrop/jquery.Jcrop.js - About 1 hr to fix

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

                                    } else if (xx < x1) { // left side
                                      if (x1 - xx < min_x) {
                                        xx = x1 - min_x;
                                      } else if (x1 - xx > max_x) {
                                        xx = x1 - max_x;
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 3 hrs to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 580..602

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if (xx > x1) { // right side
                                      if (xx - x1 < min_x) {
                                        xx = x1 + min_x;
                                      } else if (xx - x1 > max_x) {
                                        xx = x1 + max_x;
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 3 hrs to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 591..602

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

                            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 trackTouchMove(e) //{{{
                                  {
                                    e.pageX = e.originalEvent.changedTouches[0].pageX;
                                    e.pageY = e.originalEvent.changedTouches[0].pageY;
                                    return trackMove(e);
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 2 hrs to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 1202..1207

                            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

                                  function trackTouchEnd(e) //{{{
                                  {
                                    e.pageX = e.originalEvent.changedTouches[0].pageX;
                                    e.pageY = e.originalEvent.changedTouches[0].pageY;
                                    return trackUp(e);
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 2 hrs to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 1195..1200

                            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

                                  function createHandles(li) //{{{
                                  {
                                    var i;
                                    for (i = 0; i < li.length; i++) {
                                      handle[li[i]] = insertHandle(li[i]);
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 910..916

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                      $.Jcrop.Loader(this,function(){
                                        $(this).css({display:'block',visibility:'hidden'});
                                        api = $.Jcrop(this, options);
                                        if ($.isFunction(callback)) callback.call(api);
                                      });
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 1609..1613

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    else {
                                      $(this).css({display:'block',visibility:'hidden'});
                                      api = $.Jcrop(this, options);
                                      if ($.isFunction(callback)) callback.call(api);
                                    }
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 1604..1608

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

                            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 createDragbars(li) //{{{
                                  {
                                    var i;
                                    for (i = 0; i < li.length; i++) {
                                      dragbar[li[i]] = insertDragbar(li[i]);
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 932..938

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

                            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 (ymin / yscale && (Math.abs(ysize) < ymin / yscale)) {
                                      y2 = (ysize > 0) ? (y1 + ymin / yscale) : (y1 - ymin / yscale);
                                    }
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 675..677

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

                            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 (xmin / xscale && (Math.abs(xsize) < xmin / xscale)) {
                                      x2 = (xsize > 0) ? (x1 + xmin / xscale) : (x1 - xmin / xscale);
                                    }
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 672..674

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 64.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                      if (xx < 0) {
                                        xx = 0;
                                        h = Math.abs((xx - x1) / aspect);
                                        yy = rh < 0 ? y1 - h : h + y1;
                                      } else if (xx > boundx) {
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 568..576

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                      if (yy < 0) {
                                        yy = 0;
                                        w = Math.abs((yy - y1) * aspect);
                                        xx = rw < 0 ? x1 - w : w + x1;
                                      } else if (yy > boundy) {
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 555..563

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if (xx < 0) {
                                      x1 -= xx;
                                      xx = 0;
                                    } else if (xx > boundx) {
                                      x1 -= xx - boundx;
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 612..618

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

                            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 ((nh > h) && h > 0) {
                                    nh = h;
                                    nw = (h / $obj.height()) * $obj.width();
                                  }
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 188..191

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 55.

                            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 ((nw > w) && w > 0) {
                                    nw = w;
                                    nh = (w / $obj.width()) * $obj.height();
                                  }
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 192..195

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if (yy < 0) {
                                      y1 -= yy;
                                      yy = 0;
                                    } else if (yy > boundy) {
                                      y1 -= yy - boundy;
                            Severity: Major
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 604..610

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

                            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 (xlimit && (Math.abs(xsize) > xlimit)) {
                                      x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit);
                                    }
                            Severity: Minor
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 40 mins to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 668..670

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if (ylimit && (Math.abs(ysize) > ylimit)) {
                                      y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit);
                                    }
                            Severity: Minor
                            Found in app/assets/javascripts/jcrop/jquery.Jcrop.js and 1 other location - About 40 mins to fix
                            app/assets/javascripts/jcrop/jquery.Jcrop.js on lines 665..667

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

                            There are no issues that match your filters.

                            Category
                            Status