drhenner/ror_ecommerce

View on GitHub

Showing 203 of 346 total issues

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

  cancelInvoice : function(invoiceId) {

    jQuery('#dialog').dialog( 'option',
                              'buttons',
                              [
Severity: Minor
Found in app/assets/javascripts/admin/fulfillment.js - About 1 hr to fix

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

        AbstractChosen.prototype.keyup_checker = function(evt) {
          var stroke, _ref;
          stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
          this.search_field_scale();
          switch (stroke) {
    Severity: Minor
    Found in app/assets/javascripts/chosen/chosen.jquery.js - About 1 hr to fix

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

          hide : function (el, css) {
            // is modal
            if (css) {
              if (/pop/i.test(this.settings.animation)) {
                var end_css = {
      Severity: Minor
      Found in app/assets/javascripts/foundation/foundation.reveal.js - About 1 hr to fix

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

            self.build_markup = function() {
              slides_container.wrap('<div class="'+settings.container_class+'"></div>');
              container = slides_container.parent();
              slides_container.addClass(settings.slides_container_class);
              
        Severity: Minor
        Found in app/assets/javascripts/foundation/foundation.orbit.js - About 1 hr to fix

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

                      setDisplayedMonth : function(m, y, rerender)
                      {
                          if (this.startDate == undefined || this.endDate == undefined) {
                              return;
                          }
          Severity: Minor
          Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 1 hr to fix

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

              captureInvoice : function(invoiceId) {
                jQuery('#dialog').dialog( 'option',
                                          'buttons',
                                          [
                                            {
            Severity: Minor
            Found in app/assets/javascripts/admin/fulfillment.js - About 1 hr to fix

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

                    function build(string) {
                      var openWith      = prepare(clicked.openWith);
                      var placeHolder     = prepare(clicked.placeHolder);
                      var replaceWith     = prepare(clicked.replaceWith);
                      var closeWith       = prepare(clicked.closeWith);
              Severity: Minor
              Found in app/assets/javascripts/markitup/jquery.markitup.js - About 1 hr to fix

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

                    events : function () {
                      var self = this;
                
                      $(this.scope)
                        .on('click.fndtn.clearing', 'ul[data-clearing] li',
                Severity: Minor
                Found in app/assets/javascripts/foundation/foundation.clearing.js - About 1 hr to fix

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

                  $.fn.formToArray = function(semantic) {
                      var a = [];
                      if (this.length == 0) return a;
                  
                      var form = this[0];
                  Severity: Minor
                  Found in app/assets/javascripts/jqwizard/jquery.form.js - About 1 hr to fix

                    Method update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def update
                        @order = session_admin_order
                        @order.ip_address = request.remote_ip
                    
                        @credit_card ||= ActiveMerchant::Billing::CreditCard.new(cc_params)
                    Severity: Minor
                    Found in app/controllers/admin/shopping/checkout/orders_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 events has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        events: function() {
                          var self = this;
                    
                          //combine titles selector from settings for click event binding
                          var click_title_selectors = [],
                    Severity: Minor
                    Found in app/assets/javascripts/foundation/foundation.section.js - About 1 hr to fix

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

                          Chosen.prototype.result_select = function(evt) {
                            var high, high_id, item, position;
                            if (this.result_highlight) {
                              high = this.result_highlight;
                              high_id = high.attr("id");
                      Severity: Minor
                      Found in app/assets/javascripts/chosen/chosen.jquery.js - About 1 hr to fix

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

                            css : function (dropdown, target) {
                              var offset_parent = dropdown.offsetParent();
                              // if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) {
                                var position = target.offset();
                                position.top -= offset_parent.offset().top;
                        Severity: Minor
                        Found in app/assets/javascripts/foundation/foundation.dropdown.js - About 1 hr to fix

                          Function doSubmit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function doSubmit() {
                                      // make sure form attrs are set
                                      var t = $form.attr('target'), a = $form.attr('action');
                          
                                      // update form attrs in IE friendly way
                          Severity: Minor
                          Found in app/assets/javascripts/jqwizard/jquery.form.js - About 1 hr to fix

                            Function ajaxForm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            $.fn.ajaxForm = function(options) {
                                return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
                                    e.preventDefault();
                                    $(this).ajaxSubmit(options);
                                }).bind('click.form-plugin', function(e) {
                            Severity: Minor
                            Found in app/assets/javascripts/jqwizard/jquery.form.js - About 1 hr to fix

                              Function refresh_custom_select has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  refresh_custom_select: function ($select, force_refresh) {
                                    var self = this;
                                    var maxWidth = 0,
                                        $customSelect = $select.next(),
                                        $options = $select.find('option'),
                              Severity: Minor
                              Found in app/assets/javascripts/foundation/foundation.forms.js - About 1 hr to fix

                                Function ajaxJSONP has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  $.ajaxJSONP = function(options){
                                    if (!('type' in options)) return $.ajax(options)
                                
                                    var callbackName = 'jsonp' + (++jsonpID),
                                      script = document.createElement('script'),
                                Severity: Minor
                                Found in app/assets/javascripts/zepto.js - About 1 hr to fix

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

                                          init: function() {
                                              this.labelContainer = $(this.settings.errorLabelContainer);
                                              this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
                                              this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer );
                                              this.submitted = {};
                                  Severity: Minor
                                  Found in app/assets/javascripts/jqwizard/jquery.validate.js - About 1 hr to fix

                                    Function openAnimation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          function openAnimation() {
                                            if (!locked) {
                                              lockModal();
                                              closeOpenModals(modal);
                                              modal.addClass("open");
                                    Severity: Minor
                                    Found in app/assets/javascripts/admin/jquery.reveal.js - About 1 hr to fix

                                      Function pos_phone has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          pos_phone : function (init) {
                                            var tip_height = this.outerHeight(this.settings.$next_tip),
                                                tip_offset = this.settings.$next_tip.offset(),
                                                target_height = this.outerHeight(this.settings.$target),
                                                $nub = $('.joyride-nub', this.settings.$next_tip),
                                      Severity: Minor
                                      Found in app/assets/javascripts/foundation/foundation.joyride.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language