htdocs/assets/js/api.js

Summary

Maintainability
F
5 days
Test Coverage

File api.js has 326 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * simple helper function to add HTTP DELETE ajax calls to the jQuery object
 */
$.ajax_delete = function(url, callback) {
  $.ajax({url: url, type: "DELETE", success: callback});
Severity: Minor
Found in htdocs/assets/js/api.js - About 3 hrs to fix

    Function confirm_delete has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function confirm_delete(message, insert, context, onConfirm, onDisappear) {
    
      var alert = $("<div></div>");
      alert.addClass("alert");
      alert.addClass("alert-warning");
    Severity: Minor
    Found in htdocs/assets/js/api.js - About 1 hr to fix

      Function update_gcal_for_event has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function update_gcal_for_event() {
        var url = "/events/" + get_current_event_id();
        var gcal = $("#gcal").val();
        // some basic client side validation
      
      
      Severity: Minor
      Found in htdocs/assets/js/api.js - About 1 hr to fix

        Function confirm_delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function confirm_delete(message, insert, context, onConfirm, onDisappear) {
        Severity: Minor
        Found in htdocs/assets/js/api.js - About 35 mins to fix

          Function update_gcal_for_event has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function update_gcal_for_event() {
            var url = "/events/" + get_current_event_id();
            var gcal = $("#gcal").val();
            // some basic client side validation
          
          
          Severity: Minor
          Found in htdocs/assets/js/api.js - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

          function update_impact_time() {
            var startdate = new Date($("input#event-start-input-date").val());
            var starttime = timeToDate($("input#event-start-input-time").val());
            var enddate = new Date($("input#event-end-input-date").val());
            var endtime = timeToDate($("input#event-end-input-time").val());
          Severity: Major
          Found in htdocs/assets/js/api.js and 1 other location - About 7 hrs to fix
          htdocs/assets/js/api.js on lines 342..354

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

          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

          function update_undetected_time() {
            var startdate = new Date($("input#event-start-input-date").val());
            var starttime = timeToDate($("input#event-start-input-time").val());
            var enddate = new Date($("input#event-detect-input-date").val());
            var endtime = timeToDate($("input#event-detect-input-time").val());
          Severity: Major
          Found in htdocs/assets/js/api.js and 1 other location - About 7 hrs to fix
          htdocs/assets/js/api.js on lines 329..341

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

          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

          function update_starttime_for_event(e, event, history) {
              event.start_time =  $("input#event-start-input-time").val();
              event.timezone = $('#current_tz').text();
          
              update_impact_time();
          Severity: Major
          Found in htdocs/assets/js/api.js and 2 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 285..291
          htdocs/assets/js/api.js on lines 308..314

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

          function update_detecttime_for_event(e, event, history) {
              event.detect_time = $("input#event-detect-input-time").val();
              event.timezone = $('#current_tz').text();
          
              update_undetected_time();
          Severity: Major
          Found in htdocs/assets/js/api.js and 2 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 308..314
          htdocs/assets/js/api.js on lines 321..327

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

          function update_endtime_for_event(e, event, history) {
              event.end_time = $("input#event-end-input-time").val();
              event.timezone = $('#current_tz').text();
          
              update_impact_time();
          Severity: Major
          Found in htdocs/assets/js/api.js and 2 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 285..291
          htdocs/assets/js/api.js on lines 321..327

          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

              $.ajax({
                      url: url,
                      data: event,
                      type: 'PUT',
                      success: function () { show_save_status("Event", true);},
          Severity: Major
          Found in htdocs/assets/js/api.js and 1 other location - About 1 hr to fix
          htdocs/assets/js/api.js on lines 379..385

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

          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

              $.ajax({
                      url: url,
                      data: history,
                      type: 'POST',
                      success: function () { show_save_status("History", true);},
          Severity: Major
          Found in htdocs/assets/js/api.js and 1 other location - About 1 hr to fix
          htdocs/assets/js/api.js on lines 390..396

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

          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

          function store_forum_url_for_event(id, forum_url, comment, callback) {
            var url = "/events/" + id + "/forum_links";
            var data = {
              "forum_link": forum_url,
              "forum_comment": comment
          Severity: Major
          Found in htdocs/assets/js/api.js and 1 other location - About 1 hr to fix
          features/slack/assets/js/slack.js on lines 103..107

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

          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

          function update_impact_type_for_event(e, event, history) {
              $("select#impact_type option:selected").each(function () {
                  event.impact_type = $.trim($(this).val());
              });
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 248..252
          htdocs/assets/js/api.js on lines 260..264
          htdocs/assets/js/api.js on lines 274..278

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

          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

          function update_problem_type_for_event(e, event, history) {
              $("select#problem_type option:selected").each(function () {
                  event.problem_type = $.trim($(this).val());
              });
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 254..258
          htdocs/assets/js/api.js on lines 260..264
          htdocs/assets/js/api.js on lines 274..278

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

          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

          function update_incident_cause_for_event(e, event, history) {
              $("select#incident_cause option:selected").each(function () {
                  event.incident_cause = $.trim($(this).val());
              });
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 248..252
          htdocs/assets/js/api.js on lines 254..258
          htdocs/assets/js/api.js on lines 274..278

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

          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

          function update_severity_for_event(e, event, history) {
            $("select#severity-select option:selected").each(function () {
                event.severity = $.trim($(this).val());
            });
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 248..252
          htdocs/assets/js/api.js on lines 254..258
          htdocs/assets/js/api.js on lines 260..264

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

          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

          function store_image_for_event(id, image, callback) {
            var url = "/events/" + id + "/images";
            var data = {"images": image};
            $.post(url, data, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 65..69
          htdocs/assets/js/api.js on lines 78..82
          htdocs/assets/js/api.js on lines 109..113

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

          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

          function store_tags_for_event(id, tag, callback) {
            var url = "/events/" + id + "/tags";
            var data = {"tags": tag};
            $.post(url, data, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 52..56
          htdocs/assets/js/api.js on lines 65..69
          htdocs/assets/js/api.js on lines 78..82

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

          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

          function store_ticket_for_event(id, ticket, callback) {
            var url = "/events/" + id + "/tickets";
            var data = {"tickets": ticket};
            $.post(url, data, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 52..56
          htdocs/assets/js/api.js on lines 78..82
          htdocs/assets/js/api.js on lines 109..113

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

          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

          function store_channel_for_event(id, channel, callback) {
            var url = "/events/" + id + "/channels";
            var data = {"channels": channel};
            $.post(url, data, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 52..56
          htdocs/assets/js/api.js on lines 65..69
          htdocs/assets/js/api.js on lines 109..113

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

          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

          function update_startdate_for_event(e, event, history) {
              event.start_date =  $("input#event-start-input-date").val();
              event.timezone =  $('#current_tz').text();
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 2 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 280..283
          htdocs/assets/js/api.js on lines 303..306

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

          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

          function update_detectdate_for_event(e, event, history) {
              event.detect_date = $("input#event-detect-input-date").val();
              event.timezone = $('#current_tz').text();
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 2 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 303..306
          htdocs/assets/js/api.js on lines 316..319

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

          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

          function update_enddate_for_event(e, event, history) {
              event.end_date = $("input#event-end-input-date").val();
              event.timezone = $('#current_tz').text();
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 2 other locations - About 1 hr to fix
          htdocs/assets/js/api.js on lines 280..283
          htdocs/assets/js/api.js on lines 316..319

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

          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

          function delete_tag_for_event(event_id, tag_id, callback) {
            var url = "/events/" + event_id + "/tags/"+tag_id;
            $.ajax_delete(url, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 35 mins to fix
          htdocs/assets/js/api.js on lines 122..125
          htdocs/assets/js/api.js on lines 133..136
          htdocs/assets/js/api.js on lines 144..147

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

          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

          function delete_channel_for_event(event_id, channel_id, callback) {
            var url = "/events/" + event_id + "/channels/"+channel_id;
            $.ajax_delete(url, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 35 mins to fix
          htdocs/assets/js/api.js on lines 133..136
          htdocs/assets/js/api.js on lines 144..147
          htdocs/assets/js/api.js on lines 156..159

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

          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

          function delete_tickets_for_event(event_id, ticket_id, callback) {
            var url = "/events/" + event_id + "/tickets/"+ticket_id;
            $.ajax_delete(url, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 35 mins to fix
          htdocs/assets/js/api.js on lines 122..125
          htdocs/assets/js/api.js on lines 133..136
          htdocs/assets/js/api.js on lines 156..159

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

          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

          function delete_image_for_event(event_id, image_id, callback) {
            var url = "/events/" + event_id + "/images/"+image_id;
            $.ajax_delete(url, callback);
          }
          Severity: Major
          Found in htdocs/assets/js/api.js and 3 other locations - About 35 mins to fix
          htdocs/assets/js/api.js on lines 122..125
          htdocs/assets/js/api.js on lines 144..147
          htdocs/assets/js/api.js on lines 156..159

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

          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