flower-pot/veterator

View on GitHub
app/assets/javascripts/chart.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function initializeChartWithData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Chart.prototype.initializeChartWithData = function() {
    var self = this;
    d3.json("/sensors/" + this.sensor_id + "/records.json" + location.search, function(error, json) {
        self.data = json.records;
        self.data.forEach(function(d) {
Severity: Major
Found in app/assets/javascripts/chart.js - About 2 hrs to fix

    Function resize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Chart.prototype.resize = function() {
        this.width = parseInt(d3.select(this.selector).style("width")) - this.margin*2;
        this.height = ((parseInt(d3.select(this.selector).style("width"))/16)*9) - this.margin*2;
    
        if (this.interactive) { this.hoverLine.attr('y2', this.height); }
    Severity: Minor
    Found in app/assets/javascripts/chart.js - About 1 hr to fix

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

      Chart.prototype.initializeChart = function() {
          var self = this;
      
          this.xScale = d3.time.scale()
              .range([0, this.width])
      Severity: Minor
      Found in app/assets/javascripts/chart.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status