livingsocial/rearview-engine

View on GitHub
public/rearview-src/js/view/base.js

Summary

Maintainability
D
1 day
Test Coverage

File base.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define([
    'jquery',     
    'underscore', 
    'backbone',
    'handlebars',
Severity: Minor
Found in public/rearview-src/js/view/base.js - About 5 hrs to fix

    Function renderGraphData has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            renderGraphData : function(chart, graphData) {
                var self       = this,
                    renderData = graphData,
                    times      = [],
                    colors     = [      // creating an array to a series color scheme to stay consistant between updates from the server
    Severity: Major
    Found in public/rearview-src/js/view/base.js - About 3 hrs to fix

      Function initGraph has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              initGraph : function(el) {
                  var self = this;
      
                  self.chart = new Highcharts.Chart({
                      exporting : {
      Severity: Major
      Found in public/rearview-src/js/view/base.js - About 2 hrs to fix

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

                resizeModal : function($modal, size, ignoreHeight) {
                    var width            = $(window).width(),
                        height           = $(window).height(),
                        widthMultiplier  = 0.6,
                        heightMultiplier = 0.8;
        Severity: Minor
        Found in public/rearview-src/js/view/base.js - About 1 hr to fix

          Function _toggleFullscreen has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _toggleFullscreen : function(selector, mirrorRef, closeButton, backButton) {
                      var self     = this,
                          editorEl = $(selector);
          
                      if (!editorEl.hasClass('fullscreen')) {
          Severity: Minor
          Found in public/rearview-src/js/view/base.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (!_.isNull(timeIndex)) { 
                                            chart.xAxis[0].addPlotLine({
                                                id        : 'plotLine',
                                                value     : timeIndex,
                                                color     : 'green',
            Severity: Major
            Found in public/rearview-src/js/view/base.js - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status