wahyd4/ocelots

View on GitHub

Showing 98 of 98 total issues

Function getOrigPosition has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getOrigPosition: function () {
            var current  = F.current,
                element  = current.element,
                orig     = current.orig,
                pos      = {},
Severity: Minor
Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

    Function slide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      , slide: function (type, next) {
          var $active = this.$element.find('.item.active')
            , $next = next || $active[type]()
            , isCycling = this.interval
            , direction = type == 'next' ? 'left' : 'right'
    Severity: Minor
    Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

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

      $.fieldValue = function(el, successful) {
          var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
          if (successful === undefined) {
              successful = true;
          }
      Severity: Minor
      Found in public/jquery.form.js - About 1 hr to fix

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

                    youtube : {
                        matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed)?([\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
                        params  : {
                            autoplay    : 1,
                            autohide    : 1,
        public/fancyapps-fancyBox-2bb0da9/source/helpers/jquery.fancybox-media.js on lines 103..116

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

                    vimeo : {
                        matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
                        params  : {
                            autoplay      : 1,
                            hd            : 1,
        public/fancyapps-fancyBox-2bb0da9/source/helpers/jquery.fancybox-media.js on lines 89..102

        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

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

                _afterZoomIn: function () {
                    var current = F.current;
        
                    if (!current) {
                        return;
        Severity: Minor
        Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                  play: function ( action ) {
                      var clear = function () {
                              clearTimeout(F.player.timer);
                          },
                          set = function () {
          Severity: Minor
          Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                    beforeShow: function (opts) {
                        var text = F.current.title,
                            type = opts.type,
                            title,
                            target;
            Severity: Minor
            Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                  $.fn.fancybox = function (options) {
                      var index,
                          that     = $(this),
                          selector = this.selector || '',
                          run      = function(e) {
              Severity: Minor
              Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                        update: function (e) {
                            var type = (e && e.type),
                                anyway = !type || type === 'orientationchange';
                
                            if (anyway) {
                Severity: Minor
                Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                          function d(a, b, c) {
                              a.detachEvent ? a.detachEvent("on" + b, c) : a.removeEventListener && a.removeEventListener(b, c, !1)
                          }
                  Severity: Major
                  Found in include.js and 1 other location - About 1 hr to fix
                  include.js on lines 268..270

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 57.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          function c(a, b, c) {
                              a.attachEvent ? a.attachEvent("on" + b, c) : a.addEventListener && a.addEventListener(b, c, !1)
                          }
                  Severity: Major
                  Found in include.js and 1 other location - About 1 hr to fix
                  include.js on lines 264..266

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 57.

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

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

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

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

                  Refactorings

                  Further Reading

                  Method current_person has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def current_person
                      return @current_person if @current_person
                  
                      if params[:auth_token]
                        @current_person = Person.find_by_auth_token params[:auth_token]
                  Severity: Minor
                  Found in app/controllers/application_controller.rb - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                          changeIn: function () {
                              var current   = F.current,
                                  effect    = current.nextEffect,
                                  startPos  = current.pos,
                                  endPos    = { opacity : 1 },
                  Severity: Minor
                  Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                                F.wrap.css(startPos).animate(endPos, {
                                    duration : effect === 'none' ? 0 : current.openSpeed,
                                    easing   : current.openEasing,
                                    step     : elastic ? this.step : null,
                                    complete : F._afterZoomIn
                    Severity: Major
                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 1 hr to fix
                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1609..1614

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

                    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

                                F.wrap.animate(endPos, {
                                    duration : effect === 'none' ? 0 : current.closeSpeed,
                                    easing   : current.closeEasing,
                                    step     : elastic ? this.step : null,
                                    complete : F._afterZoomOut
                    Severity: Major
                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 1 hr to fix
                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1587..1592

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

                    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 show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        , show: function () {
                            var that = this
                              , e = $.Event('show')
                    
                            this.$element.trigger(e)
                    Severity: Minor
                    Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                          if (k[c]) {
                                              var i = p(d.id, a, d.callbacks ? d.callbacks : []);
                                              m[d.id] = {};
                                              try {
                                                  if (d.callbacks && e(d.callbacks) && d.callbacks.length > 0)for (var j = 0; j < d.callbacks.length; j++) {
                      Severity: Major
                      Found in include.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                            if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
                                                $.each(keys, function(i, val) {
                                                    if (current.group.length > 1 && val[ code ] !== undefined) {
                                                        F[ i ]( val[ code ] );
                        
                        
                        Severity: Major
                        Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                                this.timeout = setTimeout(function() {
                                  if (self.hoverState == 'out') self.hide()
                                }, self.options.delay.hide)
                          Severity: Major
                          Found in public/bootstrap/js/bootstrap.js and 1 other location - About 1 hr to fix
                          public/bootstrap/js/bootstrap.js on lines 1043..1045

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language