Nevillealee/cs_prepaid_app

View on GitHub

Showing 17 of 21 total issues

File app.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
 
var localStorage = {}, sessionStorage = {};
try { localStorage = window.localStorage; } catch (e) { }
try { sessionStorage = window.sessionStorage; } catch (e) { }
Severity: Minor
Found in doc/js/app.js - About 2 hrs to fix

    Method fetch has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def fetch(params)
    Resque.logger.info "Requestable.fetch received #{params.inspect}"
    past = Time.now
    total = api_count(params)
    remain_requests = (total/250.to_f).ceil
    Severity: Major
    Found in app/helpers/requestable.rb - About 2 hrs to fix

      Method run has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def run
      stream_pre_update
      Resque.logger = Logger.new("#{Rails.root}/log/order_size_update.log", 5, 10024000)
      Resque.logger.level = Logger::INFO
      Resque.logger.info "PARAMS IN ORDERSIZEUPDATE #{@form_data.inspect}"
      Severity: Major
      Found in app/services/size_update.rb - About 2 hrs to fix

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

        function generateTOC() {
        if ($('#filecontents').length === 0) return;
        var _toc = $('<ol class="top"></ol>');
        var show = false;
        var toc = _toc;
        Severity: Minor
        Found in doc/js/app.js - About 2 hrs to fix

          Method run has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def run
          stream_pre_update
          Resque.logger = Logger.new("#{Rails.root}/log/order_updates.log", 5, 10024000)
          Resque.logger.level = Logger::INFO
          Resque.logger.info "received params: #{@form_data}"
          Severity: Minor
          Found in app/services/line_item_update.rb - About 2 hrs to fix

            Function constantSummaryToggle has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function constantSummaryToggle() {
            $('.constants_summary_toggle').click(function(e) {
            e.preventDefault();
            localStorage.summaryCollapsed = $(this).text();
            $('.constants_summary_toggle').each(function() {
            Severity: Minor
            Found in doc/js/app.js - About 1 hr to fix

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

              def self.search(query)
              if query.present?
              my_query = query.strip
              puts "made it inside condition"
              puts my_query
              Severity: Minor
              Found in app/models/customer.rb - About 1 hr to fix

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

              formatted_line_item = {
              "properties" => new_line_items['properties'].reduce({}, :update).map{|k, v| {'name' => k, 'value' => v}},
              "quantity" => new_line_items['quantity'].to_i,
              "sku" => new_line_items['sku'],
              "product_title" => new_line_items['product_title'],
              Severity: Major
              Found in app/services/line_item_update.rb and 1 other location - About 1 hr to fix
              app/services/line_item_update.rb on lines 42..51

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

              new_local_line_item = {
              "properties" => new_line_items['properties'].reduce({}, :update).map{|k, v| {'name' => k, 'value' => v}},
              "quantity" => new_line_items['quantity'].to_i,
              "sku" => new_line_items['sku'],
              "product_title" => new_line_items['product_title'],
              Severity: Major
              Found in app/services/line_item_update.rb and 1 other location - About 1 hr to fix
              app/services/line_item_update.rb on lines 30..39

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

              def fetch(params)
              Resque.logger.info "Requestable.fetch received #{params.inspect}"
              past = Time.now
              total = api_count(params)
              remain_requests = (total/250.to_f).ceil
              Severity: Minor
              Found in app/helpers/requestable.rb - About 1 hr to fix

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

              function summaryToggle() {
              $('.summary_toggle').click(function(e) {
              e.preventDefault();
              localStorage.summaryCollapsed = $(this).text();
              $('.summary_toggle').each(function() {
              Severity: Minor
              Found in doc/js/app.js - About 1 hr to fix

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

                }, function() {
                $('#toc .top').slideDown('fast');
                $('#toc').toggleClass('hidden');
                $('#toc .title small').toggle();
                });
                Severity: Minor
                Found in doc/js/app.js and 1 other location - About 45 mins to fix
                doc/js/app.js on lines 208..212

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

                $('#toc .hide_toc').toggle(function() {
                $('#toc .top').slideUp('fast');
                $('#toc').toggleClass('hidden');
                $('#toc .title small').toggle();
                }, function() {
                Severity: Minor
                Found in doc/js/app.js and 1 other location - About 45 mins to fix
                doc/js/app.js on lines 212..216

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

                $(this).parent().prev().height($(this).parent().height());
                Severity: Minor
                Found in doc/js/app.js and 1 other location - About 35 mins to fix
                doc/js/app.js on lines 26..26

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

                $(this).parent().prev().height($(this).parent().height());
                Severity: Minor
                Found in doc/js/app.js and 1 other location - About 35 mins to fix
                doc/js/app.js on lines 42..42

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

                def size_update
                @order = Order.find(params[:id])
                all_params = {line_items: line_item_params,
                prop_params: properties_params,
                order_id: params[:id],
                Severity: Minor
                Found in app/controllers/customer/orders_controller.rb and 1 other location - About 35 mins to fix
                app/controllers/customer/orders_controller.rb on lines 24..34

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

                def update
                @order = Order.find(params[:id])
                all_params = {line_items: line_item_params,
                prop_params: properties_params,
                order_id: params[:id],
                Severity: Minor
                Found in app/controllers/customer/orders_controller.rb and 1 other location - About 35 mins to fix
                app/controllers/customer/orders_controller.rb on lines 42..52
                Severity
                Category
                Status
                Source
                Language