joegattnet/joegattnet_v3

View on GitHub
public/javascripts/gmaps4rails/gmaps4rails.base.js

Summary

Maintainability
F
6 days
Test Coverage

Function Gmaps4Rails has 400 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.Gmaps4Rails = (function() {

    function Gmaps4Rails() {
      this.map = null;
      this.serviceObject = null;
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 2 days to fix

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

(function() {
  var Gmaps;

  Gmaps = {};

Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 6 hrs to fix

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

    function Gmaps4Rails() {
      this.map = null;
      this.serviceObject = null;
      this.visibleInfoWindow = null;
      this.userLocation = null;
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

      if ((circle.lat != null) && (circle.lng != null)) {
        newCircle = new google.maps.Circle({
          center: this.createLatLng(circle.lat, circle.lng),
          strokeColor: circle.strokeColor || this.circles_conf.strokeColor,
          strokeOpacity: circle.strokeOpacity || this.circles_conf.strokeOpacity,
Severity: Critical
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 1 hr to fix

Function createServiceMarkersFromMarkers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Gmaps4Rails.prototype.createServiceMarkersFromMarkers = function() {
      var Lat, LatLng, Lng, index, marker, _len, _ref;
      _ref = this.markers;
      for (index = 0, _len = _ref.length; index < _len; index++) {
        marker = _ref[index];
Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 1 hr to fix

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

    Gmaps4Rails.prototype.create_circle = function(circle) {
      var newCircle;
      if (circle === this.circles[0]) {
        if (circle.strokeColor != null) {
          this.circles_conf.strokeColor = circle.strokeColor;
Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 1 hr to fix

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

    Gmaps4Rails.prototype.create_direction = function() {
      var directionsDisplay, directionsService, request;
      directionsDisplay = new google.maps.DirectionsRenderer();
      directionsService = new google.maps.DirectionsService();
      directionsDisplay.setMap(this.serviceObject);
Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 1 hr to fix

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

    Gmaps4Rails.prototype.create_polygon = function(polygon) {
      var clickable, fillColor, fillOpacity, latlng, new_poly, point, polygon_coordinates, strokeColor, strokeOpacity, strokeWeight, _i, _len;
      polygon_coordinates = [];
      for (_i = 0, _len = polygon.length; _i < _len; _i++) {
        point = polygon[_i];
Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        if (point === polygon[0]) {
          strokeColor = point.strokeColor || this.polygons_conf.strokeColor;
          strokeOpacity = point.strokeOpacity || this.polygons_conf.strokeOpacity;
          strokeWeight = point.strokeWeight || this.polygons_conf.strokeWeight;
          fillColor = point.fillColor || this.polygons_conf.fillColor;
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 1 hr to fix

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

    Gmaps4Rails.prototype.hide_circles = function() {
      var circle, _i, _len, _ref, _results;
      _ref = this.circles;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js and 10 other locations - About 4 hrs to fix
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 151..160
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 198..207
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 243..252
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 410..419
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 89..98
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 104..113
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 121..130
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 169..178
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 180..189
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 191..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Gmaps4Rails.prototype.create_polylines = function() {
      var polyline, _i, _len, _ref, _results;
      _ref = this.polylines;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js and 10 other locations - About 4 hrs to fix
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 151..160
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 198..207
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 213..222
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 243..252
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 89..98
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 104..113
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 121..130
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 169..178
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 180..189
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 191..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Gmaps4Rails.prototype.create_circles = function() {
      var circle, _i, _len, _ref, _results;
      _ref = this.circles;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js and 10 other locations - About 4 hrs to fix
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 198..207
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 213..222
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 243..252
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 410..419
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 89..98
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 104..113
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 121..130
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 169..178
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 180..189
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 191..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Gmaps4Rails.prototype.create_polygons = function() {
      var polygon, _i, _len, _ref, _results;
      _ref = this.polygons;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js and 10 other locations - About 4 hrs to fix
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 151..160
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 198..207
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 213..222
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 410..419
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 89..98
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 104..113
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 121..130
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 169..178
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 180..189
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 191..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Gmaps4Rails.prototype.clear_circles = function() {
      var circle, _i, _len, _ref, _results;
      _ref = this.circles;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js and 10 other locations - About 4 hrs to fix
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 151..160
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 213..222
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 243..252
public/javascripts/gmaps4rails/gmaps4rails.base.js on lines 410..419
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 89..98
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 104..113
public/javascripts/gmaps4rails/gmaps4rails.bing.js on lines 121..130
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 169..178
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 180..189
public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js on lines 191..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status