matthucke/graveyards4

View on GitHub
app/assets/javascripts/maps/markerwithlabel.js

Summary

Maintainability
D
2 days
Test Coverage

Function onAdd has 183 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    MarkerLabel_.prototype.onAdd = function () {
      var me = this;
      var cMouseIsDown = false;
      var cDraggingLabel = false;
      var cSavedZIndex;
Severity: Major
Found in app/assets/javascripts/maps/markerwithlabel.js - About 7 hrs to fix

    File markerwithlabel.js has 349 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @name MarkerWithLabel for V3
     * @version 1.1.9 [June 30, 2013]
     * @author Gary Little (inspired by code from Marc Ridey of Google).
     * @copyright Copyright 2012 Gary Little [gary at luxcentral.com]
    Severity: Minor
    Found in app/assets/javascripts/maps/markerwithlabel.js - About 4 hrs to fix

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

          function MarkerWithLabel(opt_options) {
            opt_options = opt_options || {};
            opt_options.labelContent = opt_options.labelContent || "";
            opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0);
            opt_options.labelClass = opt_options.labelClass || "markerLabels";
      Severity: Minor
      Found in app/assets/javascripts/maps/markerwithlabel.js - About 1 hr to fix

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

                  if (me.marker_.getDraggable() || me.marker_.getClickable()) {
                    google.maps.event.trigger(me.marker_, "mousedown", e);
                    cAbortEvent(e); // Prevent map pan when starting a drag on a label
                  }
        Severity: Major
        Found in app/assets/javascripts/maps/markerwithlabel.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/maps/markerwithlabel.js on lines 254..257

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

        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

                  if (me.marker_.getDraggable() || me.marker_.getClickable()) {
                    google.maps.event.trigger(me.marker_, "dblclick", e);
                    cAbortEvent(e); // Prevent map zoom when double-clicking on a label
                  }
        Severity: Major
        Found in app/assets/javascripts/maps/markerwithlabel.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/maps/markerwithlabel.js on lines 168..171

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

        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

              opt_options.crossImage = opt_options.crossImage || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png";
        Severity: Minor
        Found in app/assets/javascripts/maps/markerwithlabel.js and 1 other location - About 30 mins to fix
        app/assets/javascripts/maps/markerwithlabel.js on lines 555..555

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

        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

              opt_options.handCursor = opt_options.handCursor || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur";
        Severity: Minor
        Found in app/assets/javascripts/maps/markerwithlabel.js and 1 other location - About 30 mins to fix
        app/assets/javascripts/maps/markerwithlabel.js on lines 554..554

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

        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