wahyd4/ocelots

View on GitHub

Showing 52 of 98 total issues

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

    function fileUploadXhr(a) {
        var formdata = new FormData();

        for (var i=0; i < a.length; i++) {
            formdata.append(a[i].name, a[i].value);
Severity: Minor
Found in public/jquery.form.js - About 1 hr to fix

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

        var b = function () {
            function l() {
                return c
            }
    
    
    Severity: Minor
    Found in include.js - About 1 hr to fix

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

              return g() ? {open:function (e, g) {
                  function q(a) {
                      try {
                          var b = JSON.parse(a.data);
                          b.a === "ready" ? m.postMessage(o, l) : b.a === "error" ? g && (g(b.d), g = null) : b.a === "response" && (d(window, "message", q), d(window, "unload", p), p(), g && (g(null, b.d), g = null))
      Severity: Minor
      Found in include.js - About 1 hr to fix

        Function r has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    }, r = function (a, c, d) {
                        if (typeof b.gotMessageObserver == "function")try {
                            b.gotMessageObserver(a, d)
                        } catch (h) {
                            g("gotMessageObserver() raised an exception: " + h.toString())
        Severity: Minor
        Found in include.js - About 1 hr to fix

          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

                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 _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 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

                          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

                            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 (!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

                                Consider simplifying this complex logical expression.
                                Open

                                                if (d.id && c) {
                                                    if (k[c]) {
                                                        var i = p(d.id, a, d.callbacks ? d.callbacks : []);
                                                        m[d.id] = {};
                                                        try {
                                Severity: Major
                                Found in include.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

                                    Avoid deeply nested control flow statements.
                                    Open

                                                    for (j=0; j < files.length; j++) {
                                                        a.push({name: n, value: files[j], type: el.type});
                                                    }
                                    Severity: Major
                                    Found in public/jquery.form.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  if (elements) 
                                                      elements.push(el);
                                      Severity: Major
                                      Found in public/jquery.form.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language