devcows/hugo-universal-theme

View on GitHub

Showing 69 of 69 total issues

File hpneo.gmaps.js has 1686 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function(root, factory) {
  if(typeof exports === 'object') {
    module.exports = factory();
  }
  else if(typeof define === 'function' && define.amd) {
Severity: Major
Found in static/js/hpneo.gmaps.js - About 4 days to fix

    Function GMaps has 258 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var GMaps = (function(global) {
      "use strict";
    
      var doc = document;
    
    
    Severity: Major
    Found in static/js/hpneo.gmaps.js - About 1 day to fix

      Function GMaps has 254 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var GMaps = function(options) {
          if (!this) return new GMaps(options);
      
          options.zoom = options.zoom || 15;
          options.mapType = options.mapType || 'roadmap';
      Severity: Major
      Found in static/js/hpneo.gmaps.js - About 1 day to fix

        Function staticMapURL has 169 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        GMaps.staticMapURL = function(options){
          var parameters = [],
              data,
              static_root = 'https://maps.googleapis.com/maps/api/staticmap';
        
        
        Severity: Major
        Found in static/js/hpneo.gmaps.js - About 6 hrs to fix

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

              switch (options.horizontalAlign) {
                case 'left':
                  el.style.left = (pixel.x - content_width + options.horizontalOffset) + 'px';
                  break;
                default:
          Severity: Major
          Found in static/js/hpneo.gmaps.js and 1 other location - About 4 hrs to fix
          static/js/hpneo.gmaps.js on lines 825..836

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

          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

              switch (options.verticalAlign) {
                case 'top':
                  el.style.top = (pixel.y - content_height + options.verticalOffset) + 'px';
                  break;
                default:
          Severity: Major
          Found in static/js/hpneo.gmaps.js and 1 other location - About 4 hrs to fix
          static/js/hpneo.gmaps.js on lines 838..849

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

          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

              $('.testimonials').owlCarousel({
                items: ($('.testimonials').attr('data-items') || 4),
                slideSpeed: ($('.testimonials').attr('data-slide-speed') || 2000),
                paginationSpeed: ($('.testimonials').attr('data-pagination-speed') || 1000),
                autoPlay: $('.testimonials').attr('data-autoplay') === 'true',
          Severity: Major
          Found in static/js/front.js and 1 other location - About 4 hrs to fix
          static/js/front.js on lines 98..106

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

          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

              $('.customers').owlCarousel({
                items: ($('.customers').attr('data-items') || 6),
                slideSpeed: ($('.customers').attr('data-slide-speed') || 2000),
                paginationSpeed: ($('.customers').attr('data-pagination-speed') || 1000),
                autoPlay: $('.customers').attr('data-autoplay') === 'true',
          Severity: Major
          Found in static/js/front.js and 1 other location - About 4 hrs to fix
          static/js/front.js on lines 108..116

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

          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

            $('.dropdown').on('show.bs.dropdown', function () {
              if ($(window).width() > 750) {
                $(this).find('.dropdown-menu').first().stop(true, true).slideDown()
              } else {
                $(this).find('.dropdown-menu').first().stop(true, true).show()
          Severity: Major
          Found in static/js/front.js and 1 other location - About 4 hrs to fix
          static/js/front.js on lines 148..154

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

          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

            $('.dropdown').on('hide.bs.dropdown', function () {
              if ($(window).width() > 750) {
                $(this).find('.dropdown-menu').first().stop(true, true).slideUp()
              } else {
                $(this).find('.dropdown-menu').first().stop(true, true).hide()
          Severity: Major
          Found in static/js/front.js and 1 other location - About 4 hrs to fix
          static/js/front.js on lines 140..146

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

          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

          GMaps.prototype.removePolyline = function(polyline) {
            for (var i = 0; i < this.polylines.length; i++) {
              if (this.polylines[i] === polyline) {
                this.polylines[i].setMap(null);
                this.polylines.splice(i, 1);
          Severity: Major
          Found in static/js/hpneo.gmaps.js and 1 other location - About 4 hrs to fix
          static/js/hpneo.gmaps.js on lines 1078..1089

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

          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

          GMaps.prototype.removePolygon = function(polygon) {
            for (var i = 0; i < this.polygons.length; i++) {
              if (this.polygons[i] === polygon) {
                this.polygons[i].setMap(null);
                this.polygons.splice(i, 1);
          Severity: Major
          Found in static/js/hpneo.gmaps.js and 1 other location - About 4 hrs to fix
          static/js/hpneo.gmaps.js on lines 957..968

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

          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 drawOverlay has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          GMaps.prototype.drawOverlay = function(options) {
            var overlay = new google.maps.OverlayView(),
                auto_show = true;
          
            overlay.setMap(this.map);
          Severity: Major
          Found in static/js/hpneo.gmaps.js - About 3 hrs to fix

            File front.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* global $this: true */
            /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "animationsSlider" }] */
            
            if ($.cookie('themeCSSpath')) {
              $('link#theme-stylesheet').attr('href', $.cookie('themeCSSpath'))
            Severity: Minor
            Found in static/js/front.js - About 3 hrs to fix

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

                for (var ev = 0; ev < polygon_events.length; ev++) {
                  (function(object, name) {
                    if (options[name]) {
                      google.maps.event.addListener(object, name, function(e){
                        options[name].apply(this, [e]);
              Severity: Major
              Found in static/js/hpneo.gmaps.js and 3 other locations - About 3 hrs to fix
              static/js/hpneo.gmaps.js on lines 940..948
              static/js/hpneo.gmaps.js on lines 1020..1028
              static/js/hpneo.gmaps.js on lines 1061..1069

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

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

                for (var ev = 0; ev < polygon_events.length; ev++) {
                  (function(object, name) {
                    if (options[name]) {
                      google.maps.event.addListener(object, name, function(e){
                        options[name].apply(this, [e]);
              Severity: Major
              Found in static/js/hpneo.gmaps.js and 3 other locations - About 3 hrs to fix
              static/js/hpneo.gmaps.js on lines 940..948
              static/js/hpneo.gmaps.js on lines 990..998
              static/js/hpneo.gmaps.js on lines 1061..1069

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

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

                for (var ev = 0; ev < polyline_events.length; ev++) {
                  (function(object, name) {
                    if (options[name]) {
                      google.maps.event.addListener(object, name, function(e){
                        options[name].apply(this, [e]);
              Severity: Major
              Found in static/js/hpneo.gmaps.js and 3 other locations - About 3 hrs to fix
              static/js/hpneo.gmaps.js on lines 990..998
              static/js/hpneo.gmaps.js on lines 1020..1028
              static/js/hpneo.gmaps.js on lines 1061..1069

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

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

                for (var ev = 0; ev < polygon_events.length; ev++) {
                  (function(object, name) {
                    if (options[name]) {
                      google.maps.event.addListener(object, name, function(e){
                        options[name].apply(this, [e]);
              Severity: Major
              Found in static/js/hpneo.gmaps.js and 3 other locations - About 3 hrs to fix
              static/js/hpneo.gmaps.js on lines 940..948
              static/js/hpneo.gmaps.js on lines 990..998
              static/js/hpneo.gmaps.js on lines 1020..1028

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

              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 createMarker has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              GMaps.prototype.createMarker = function(options) {
                if (options.lat == undefined && options.lng == undefined && options.position == undefined) {
                  throw 'No latitude or longitude defined.';
                }
              
              
              Severity: Major
              Found in static/js/hpneo.gmaps.js - About 3 hrs to fix

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

                GMaps.prototype.removeOverlay = function(overlay) {
                  for (var i = 0; i < this.overlays.length; i++) {
                    if (this.overlays[i] === overlay) {
                      this.overlays[i].setMap(null);
                      this.overlays.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 1246..1255

                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

                Severity
                Category
                Status
                Source
                Language