gilest/briefly

View on GitHub

Showing 30 of 30 total issues

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

  $.Jcrop = function (obj, opt) {
    var options = $.extend({}, $.Jcrop.defaults),
        docOffset,
        _ua = navigator.userAgent.toLowerCase(),
        is_msie = /msie/.test(_ua),
Severity: Major
Found in app/assets/javascripts/jquery.Jcrop.min.js - About 6 days to fix

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

    /**
     * jquery.Jcrop.js v0.9.12
     * 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/jquery.Jcrop.min.js - About 3 days to fix

      Function Coords has 244 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/jquery.Jcrop.min.js - About 1 day to fix

        Function Selection has 215 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/jquery.Jcrop.min.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/jquery.Jcrop.min.js - About 4 hrs 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/jquery.Jcrop.min.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/jquery.Jcrop.min.js on lines 581..603

            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/jquery.Jcrop.min.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/jquery.Jcrop.min.js on lines 592..603

            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

            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/jquery.Jcrop.min.js - About 3 hrs to fix

              Function Tracker has 74 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/jquery.Jcrop.min.js - About 2 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/jquery.Jcrop.min.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/jquery.Jcrop.min.js - About 2 hrs to fix

                    Function Touch has 52 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 = {}, events = ['touchstart', 'touchmove', 'touchend'],
                    Severity: Major
                    Found in app/assets/javascripts/jquery.Jcrop.min.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/jquery.Jcrop.min.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/jquery.Jcrop.min.js - About 1 hr to fix

                          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/jquery.Jcrop.min.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/jquery.Jcrop.min.js on lines 908..914

                          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/jquery.Jcrop.min.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/jquery.Jcrop.min.js on lines 1599..1603

                          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/jquery.Jcrop.min.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/jquery.Jcrop.min.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/jquery.Jcrop.min.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/jquery.Jcrop.min.js on lines 930..936

                          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/jquery.Jcrop.min.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/jquery.Jcrop.min.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 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/jquery.Jcrop.min.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/jquery.Jcrop.min.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 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

                          Severity
                          Category
                          Status
                          Source
                          Language