Showing 1,422 of 1,422 total issues

Method save_tags_for_event has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static function save_tags_for_event($event_id, $tags, $conn = null) {
        $conn = $conn ?: Persistence::get_database_object();
        if (is_null($conn)) {
            return array("status" => self::ERROR,
                "error" => "Couldn't get connection object.");
Severity: Minor
Found in phplib/Postmortem.php - About 1 hr to fix

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

    $.getJSON("/events/"+get_current_event_id()+"/why_surprised", function(data) {
            old_surprised = data.why_surprised;
        $("#why_surprised").html(markdown.toHTML(data.why_surprised));
    });
    Severity: Major
    Found in features/why_surprised/assets/js/why_surprised.js and 2 other locations - About 1 hr to fix
    features/summary/assets/js/summary.js on lines 81..84
    features/tldr/assets/js/tldr.js on lines 76..79

    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

    $.getJSON("/events/"+get_current_event_id()+"/summary", function(data) {
        old_summary = data.summary;
        $("#summary").html(markdown.toHTML(data.summary));
    });
    Severity: Major
    Found in features/summary/assets/js/summary.js and 2 other locations - About 1 hr to fix
    features/tldr/assets/js/tldr.js on lines 76..79
    features/why_surprised/assets/js/why_surprised.js on lines 76..79

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

    $app->get('/events/:id/forum_links', function($id) use ($app) {
        header("Content-Type: application/json");
        $forum_links = Links::get_forum_links_for_event($id);
        if ($forum_links["status"] == Links::ERROR) {
            $app->response->status(404);
    Severity: Major
    Found in features/links/routes.php and 1 other location - About 1 hr to fix
    features/images/routes.php on lines 3..13

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

    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

    $app->get('/events/:id/images', function($id) use ($app) {
        header("Content-Type: application/json");
        $images = Images::get_images_for_event($id);
        if ($images["status"] == Images::ERROR) {
            $app->response->status(404);
    Severity: Major
    Found in features/images/routes.php and 1 other location - About 1 hr to fix
    features/links/routes.php on lines 3..13

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

    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

    Method delete_tag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static function delete_tag($tag_id, $event_id = null, $conn = null) {
            $conn = $conn ?: Persistence::get_database_object();
            if (is_null($conn)) {
                return array("status" => self::ERROR,
                    "error" => "Couldn't get connection object.");
    Severity: Minor
    Found in phplib/Postmortem.php - About 1 hr to fix

      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

      Method undelete_tag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          static function undelete_tag($tag_id, $event_id = null, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              if (is_null($conn)) {
                  return array("status" => self::ERROR,
                      "error" => "Couldn't get connection object.");
      Severity: Minor
      Found in phplib/Postmortem.php - About 1 hr 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

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

          function store_slack_channel_info_for_event(id, channel_id, channel_name, callback) {
              var url = "/events/" + id + "/slack-channels";
              var data = {"channel_id": channel_id, "channel_name": channel_name};
              $.post(url, data, callback);
          }
          Severity: Major
          Found in features/slack/assets/js/slack.js and 1 other location - About 1 hr to fix
          htdocs/assets/js/api.js on lines 92..99

          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

          Function make_editable has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function make_editable() {
              $.getJSON("/events/"+ get_current_event_id() +"/lock", function(data) {
                      var edit_div = $("<div></div>");
          
                      if(data.status === EDIT_UNLOCKED) {
          Severity: Minor
          Found in htdocs/assets/js/edit.js - About 1 hr to fix

            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 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_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

            $app->delete('/events/:id/channels/:channel', function($id, $channel) use ($app) {
                header("Content-Type: application/json");
                $res = Irc::delete_channel($channel);
                if ($res["status"] == Irc::ERROR) {
                    $app->response->status(500);
            Severity: Major
            Found in features/irc/routes.php and 3 other locations - About 1 hr to fix
            features/images/routes.php on lines 45..54
            features/jira/routes.php on lines 49..59
            features/links/routes.php on lines 46..55

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

            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