AyuntamientoMadrid/participacion

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

Summary

Maintainability
B
5 hrs
Test Coverage

Function initialize has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    initialize: function() {
      var current_user_id;
      $("body").on("renderLegislationAnnotation", App.LegislationAnnotatable.renderAnnotationComments);
      $("body").on("click", "[data-annotation-id]", App.LegislationAnnotatable.onClick);
      $("body").on("click", "[data-cancel-annotation]", function(e) {
Severity: Minor
Found in app/assets/javascripts/legislation_annotatable.js - About 1 hr to fix

    Function customShow has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        customShow: function(position) {
          var annotation_url;
          $(this.element).html("");
          // Clean comments section and open it
          $("#comments-box").html("");
    Severity: Minor
    Found in app/assets/javascripts/legislation_annotatable.js - About 1 hr to fix

      Function onClick has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          onClick: function(event) {
            var annotation_id, annotation_url, parents, parents_ids, target;
            event.preventDefault();
            event.stopPropagation();
            if (App.LegislationAnnotatable.isMobile()) {
      Severity: Minor
      Found in app/assets/javascripts/legislation_annotatable.js - About 1 hr to fix

        Function scrollToAnchor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            scrollToAnchor: function() {
              return {
                annotationsLoaded: function() {
                  var anchor, ann_id, checkExist;
                  anchor = $(location).attr("hash");
        Severity: Minor
        Found in app/assets/javascripts/legislation_annotatable.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status