devcows/hugo-universal-theme

View on GitHub

Showing 69 of 69 total issues

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

  else {
    for (var i = 0; i < this.layers.length; i++) {
      if (this.layers[i] === layer) {
        this.layers[i].setMap(null);
        this.layers.splice(i, 1);
Severity: Major
Found in static/js/hpneo.gmaps.js and 1 other location - About 2 hrs to fix
static/js/hpneo.gmaps.js on lines 874..883

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 89.

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

Function addLayer has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

GMaps.prototype.addLayer = function(layerName, options) {
  //var default_layers = ['weather', 'clouds', 'traffic', 'transit', 'bicycling', 'panoramio', 'places'];
  options = options || {};
  var layer;

Severity: Major
Found in static/js/hpneo.gmaps.js - About 2 hrs to fix

    Function map has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function map () {
      if ($('#map').length) {
        var lat = $('#gmap-lat').val()
        var lng = $('#gmap-lng').val()
        var direction = $('#gmap-dir').val()
    Severity: Major
    Found in static/js/gmaps.init.js - About 2 hrs to fix

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

      GMaps.prototype.removeOverlays = function() {
        for (var i = 0, item; item = this.overlays[i]; i++) {
          item.setMap(null);
        }
      
      
      Severity: Major
      Found in static/js/hpneo.gmaps.js and 2 other locations - About 2 hrs to fix
      static/js/hpneo.gmaps.js on lines 970..976
      static/js/hpneo.gmaps.js on lines 1091..1097

      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 77.

      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 3 locations. Consider refactoring.
      Open

      GMaps.prototype.removePolylines = function() {
        for (var i = 0, item; item = this.polylines[i]; i++) {
          item.setMap(null);
        }
      
      
      Severity: Major
      Found in static/js/hpneo.gmaps.js and 2 other locations - About 2 hrs to fix
      static/js/hpneo.gmaps.js on lines 885..891
      static/js/hpneo.gmaps.js on lines 1091..1097

      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 77.

      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 3 locations. Consider refactoring.
      Open

      GMaps.prototype.removePolygons = function() {
        for (var i = 0, item; item = this.polygons[i]; i++) {
          item.setMap(null);
        }
      
      
      Severity: Major
      Found in static/js/hpneo.gmaps.js and 2 other locations - About 2 hrs to fix
      static/js/hpneo.gmaps.js on lines 885..891
      static/js/hpneo.gmaps.js on lines 970..976

      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 77.

      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

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

      GMaps.prototype.getRoutes = function(options) {
        switch (options.travelMode) {
          case 'bicycling':
            travelMode = google.maps.TravelMode.BICYCLING;
            break;
      Severity: Major
      Found in static/js/hpneo.gmaps.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

          if ($('.owl-carousel').length) {
            $('.customers').owlCarousel({
              items: ($('.customers').attr('data-items') || 6),
              slideSpeed: ($('.customers').attr('data-slide-speed') || 2000),
              paginationSpeed: ($('.customers').attr('data-pagination-speed') || 1000),
        Severity: Critical
        Found in static/js/front.js - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                  if (options.search || options.nearbySearch || options.radarSearch) {
                    var placeSearchRequest  = {
                      bounds : options.bounds || null,
                      keyword : options.keyword || null,
                      location : options.location || null,
          Severity: Critical
          Found in static/js/hpneo.gmaps.js - About 2 hrs to fix

            Function drawSteppedRoute has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            GMaps.prototype.drawSteppedRoute = function(options) {
              var self = this;
              
              if (options.origin && options.destination) {
                this.getRoutes({
            Severity: Minor
            Found in static/js/hpneo.gmaps.js - About 1 hr to fix

              Function drawPolyline has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              GMaps.prototype.drawPolyline = function(options) {
                var path = [],
                    points = options.path;
              
                if (points.length) {
              Severity: Minor
              Found in static/js/hpneo.gmaps.js - About 1 hr to fix

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

                    this.zoomIn = function(value) {
                      value = value || 1;
                
                      this.zoom = this.map.getZoom() + value;
                      this.map.setZoom(this.zoom);
                Severity: Major
                Found in static/js/hpneo.gmaps.js and 1 other location - About 1 hr to fix
                static/js/hpneo.gmaps.js on lines 456..461

                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 73.

                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 2 locations. Consider refactoring.
                Open

                  for (var ev in events) {
                    (function(object, name) {
                      google.maps.event.addListener(object, name, function(e) {
                        events[name].apply(this, [e]);
                      });
                Severity: Major
                Found in static/js/hpneo.gmaps.js and 1 other location - About 1 hr to fix
                static/js/hpneo.gmaps.js on lines 1137..1143

                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 73.

                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 2 locations. Consider refactoring.
                Open

                    this.zoomOut = function(value) {
                      value = value || 1;
                
                      this.zoom = this.map.getZoom() - value;
                      this.map.setZoom(this.zoom);
                Severity: Major
                Found in static/js/hpneo.gmaps.js and 1 other location - About 1 hr to fix
                static/js/hpneo.gmaps.js on lines 449..454

                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 73.

                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 2 locations. Consider refactoring.
                Open

                  for (var ev in events) {
                    (function(object, name) {
                      google.maps.event.addListener(object, name, function(e) {
                        events[name].apply(this, [e]);
                      });
                Severity: Major
                Found in static/js/hpneo.gmaps.js and 1 other location - About 1 hr to fix
                static/js/hpneo.gmaps.js on lines 1107..1113

                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 73.

                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

                Function travelRoute has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                GMaps.prototype.travelRoute = function(options) {
                  if (options.origin && options.destination) {
                    this.getRoutes({
                      origin: options.origin,
                      destination: options.destination,
                Severity: Minor
                Found in static/js/hpneo.gmaps.js - About 1 hr to fix

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

                    request_options.origin = /string/.test(typeof options.origin) ? options.origin : new google.maps.LatLng(options.origin[0], options.origin[1]);
                  Severity: Major
                  Found in static/js/hpneo.gmaps.js and 1 other location - About 1 hr to fix
                  static/js/hpneo.gmaps.js on lines 1292..1292

                  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 64.

                  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 2 locations. Consider refactoring.
                  Open

                    request_options.destination = /string/.test(typeof options.destination) ? options.destination : new google.maps.LatLng(options.destination[0], options.destination[1]);
                  Severity: Major
                  Found in static/js/hpneo.gmaps.js and 1 other location - About 1 hr to fix
                  static/js/hpneo.gmaps.js on lines 1291..1291

                  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 64.

                  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

                  Function draw has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    overlay.draw = function() {
                      var projection = this.getProjection(),
                          pixel = projection.fromLatLngToDivPixel(new google.maps.LatLng(options.lat, options.lng));
                  
                      options.horizontalOffset = options.horizontalOffset || 0;
                  Severity: Minor
                  Found in static/js/hpneo.gmaps.js - About 1 hr to fix

                    Function createControl has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    GMaps.prototype.createControl = function(options) {
                      var control = document.createElement('div');
                    
                      control.style.cursor = 'pointer';
                      
                    Severity: Minor
                    Found in static/js/hpneo.gmaps.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language