Showing 1,422 of 1,422 total issues

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

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

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

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

$app->delete('/events/:id/images/:image', function($id, $image) use ($app) {
    header("Content-Type: application/json");
    $res = Images::delete_image($image);
    if ($res["status"] == Images::ERROR) {
        $app->response->status(500);
Severity: Major
Found in features/images/routes.php and 3 other locations - About 1 hr to fix
features/irc/routes.php on lines 45..55
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

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

$app->delete('/events/:id/tickets/:ticket', function($id, $ticket) use ($app) {
    header("Content-Type: application/json");
    $res = Jira::delete_ticket($ticket);
    if ($res["status"] == Jira::ERROR) {
        $app->response->status(500);
Severity: Major
Found in features/jira/routes.php and 3 other locations - About 1 hr to fix
features/images/routes.php on lines 45..54
features/irc/routes.php on lines 45..55
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

Method add_history has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static function add_history($event, $admin, $action, $conn = null) {
        // validate action
        if (!in_array($action, array(self::ACTION_ADD, self::ACTION_EDIT))) {
            return array(
                "status" => self::ERROR,
Severity: Minor
Found in phplib/Postmortem.php - About 1 hr to fix

    Function showFacilitator has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function showFacilitator()
    {
        if(cal.facilitatorFeature) {
            $('#facilitator-link').on('click', function() {
                    $.get('/calendar/facilitators/request/' + get_current_event_id()).fail(
    Severity: Minor
    Found in features/calendar/assets/js/calendar.js - About 1 hr to fix

      Function renderImage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function renderImage() {
          var img = $("#image_url");
          var img_url = img.attr("value");
          if (img_url !== '') {
            store_image_for_event(get_current_event_id(), img_url, function(data) {
      Severity: Minor
      Found in htdocs/assets/js/images.js - About 1 hr to fix

        Method perform has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static function perform($terms){
                
                $terms = Search::split_terms($terms);
                $terms_db = Search::db_escape_terms($terms);
                $terms_rx = Search::rx_escape_terms($terms);
        Severity: Minor
        Found in features/search/lib.php - About 1 hr to fix

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

          function why_surprised_undo_button() {
              $.getJSON("/events/"+get_current_event_id()+"/why_surprised", function(data) {
                      $('#why_surprised').val(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 73..77
          features/tldr/assets/js/tldr.js on lines 68..72

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

          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 summary_undo_button() {
              $.getJSON("/events/"+get_current_event_id()+"/summary", function(data) {
                      $('#summary').val(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 68..72
          features/why_surprised/assets/js/why_surprised.js on lines 68..72

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

          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 tldr_undo_button() {
              $.getJSON("/events/"+get_current_event_id()+"/tldr", function(data) {
                      $('#tldr').val(data.tldr);
                  });
          }
          Severity: Major
          Found in features/tldr/assets/js/tldr.js and 2 other locations - About 1 hr to fix
          features/summary/assets/js/summary.js on lines 73..77
          features/why_surprised/assets/js/why_surprised.js on lines 68..72

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

          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

              static function flag_as_deleted($table_name, $pk_column, $pk, $conn) {
                  try {
                      $sql = "UPDATE $table_name SET deleted=1 WHERE $pk_column = :id";
                      $stmt = $conn->prepare($sql);
                      $stmt->execute(array('id' => $pk));
          Severity: Major
          Found in phplib/Persistence.php and 1 other location - About 1 hr to fix
          phplib/Persistence.php on lines 456..465

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

          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

              static function flag_as_undeleted($table_name, $pk_column, $pk, $conn) {
                  try {
                      $sql = "UPDATE $table_name SET deleted=0 WHERE $pk_column = :id";
                      $stmt = $conn->prepare($sql);
                      $stmt->execute(array('id' => $pk));
          Severity: Major
          Found in phplib/Persistence.php and 1 other location - About 1 hr to fix
          phplib/Persistence.php on lines 435..444

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

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

          function make_summary_editable(text) {
              var $summary = $("#summary");
          
              if (typeof text !== "string") {
                  text = '';
          Severity: Minor
          Found in features/summary/assets/js/summary.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 createEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function createEvent()
              {
                  var event = generateEvent();
              
                  var is_confirmed = confirm("About to create an event and invite all postmortem email subscribers. Proceed?");
              Severity: Minor
              Found in features/calendar/assets/js/calendar.js - About 1 hr to fix

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

                }, function() {
                  if ($(this).attr('id').split('-')[2] != 'selected') {
                    $(this).removeClass('label-info');
                  }
                });
                Severity: Major
                Found in htdocs/assets/js/tags.js and 1 other location - About 1 hr to fix
                htdocs/assets/js/tags.js on lines 36..40

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

                $("#tag_well .tag").hover(function() {
                  if ($(this).attr('id').split('-')[2] != 'selected') {
                    $(this).addClass('label-info');
                  }
                }, function() {
                Severity: Major
                Found in htdocs/assets/js/tags.js and 1 other location - About 1 hr to fix
                htdocs/assets/js/tags.js on lines 40..44

                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

                Severity
                Category
                Status
                Source
                Language