Showing 1,422 of 1,422 total issues

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

        case "detect_time":
            if (! isset($params["timezone"])) {
                $app->response->status(400);
                return;
            }
Severity: Major
Found in htdocs/index.php and 2 other locations - About 5 hrs to fix
htdocs/index.php on lines 361..377
htdocs/index.php on lines 379..395

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

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

File Postmortem.php has 394 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

require_once('Persistence.php');

/**
Severity: Minor
Found in phplib/Postmortem.php - About 5 hrs to fix

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

    $('#event-end-input-time').focusout(function () {
      if (compareTimeRange('#event-start-input-time','#event-end-input-time',
                           '#event-start-input-date','#event-end-input-date') < 0) {
        $('#event-start-input-time').val($('#event-end-input-time').val());
        $('#event-detect-input-time').val($('#event-end-input-time').val());
    Severity: Major
    Found in htdocs/assets/js/timehelpers.js and 1 other location - About 4 hrs to fix
    htdocs/assets/js/timehelpers.js on lines 122..130

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

    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

    $('#event-start-input-time').focusout(function () {
      if (compareTimeRange('#event-start-input-time','#event-end-input-time',
                           '#event-start-input-date','#event-end-input-date') < 0) {
        $('#event-end-input-time').val($('#event-start-input-time').val());
        $('#event-detect-input-time').val($('#event-start-input-time').val());
    Severity: Major
    Found in htdocs/assets/js/timehelpers.js and 1 other location - About 4 hrs to fix
    htdocs/assets/js/timehelpers.js on lines 141..149

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

    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

    $('#event-start-input-date').focusout(function () {
      if (compareDateRange('#event-start-input-date','#event-end-input-date') < 0) {
        $('#event-end-input-date').val($('#event-start-input-date').val());
        $('#event-detect-input-date').val($('#event-start-input-date').val());
        $('#event-status-input-date').val($('#event-start-input-date').val());
    Severity: Major
    Found in htdocs/assets/js/timehelpers.js and 1 other location - About 4 hrs to fix
    htdocs/assets/js/timehelpers.js on lines 132..139

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

    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

    $('#event-end-input-date').focusout(function () {
      if (compareDateRange('#event-start-input-date','#event-end-input-date') < 0) {
        $('#event-start-input-date').val($('#event-end-input-date').val());
        $('#event-detect-input-date').val($('#event-end-input-date').val());
        $('#event-status-input-date').val($('#event-end-input-date').val());
    Severity: Major
    Found in htdocs/assets/js/timehelpers.js and 1 other location - About 4 hrs to fix
    htdocs/assets/js/timehelpers.js on lines 113..120

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

    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 display_irc_channels_data(channels) {
      var html="";
      for (var i in channels) {
        var el = channels[i];
        html += "<p>[" +el.time +"] &lt " +el.nick+"&gt: " +el.message+"</p>";
    Severity: Major
    Found in htdocs/assets/js/irc.js and 1 other location - About 3 hrs to fix
    features/slack/assets/js/slack.js on lines 48..56

    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

    function display_slack_channels_data(channels) {
        var html="";
        for (var i in channels) {
            var el = channels[i];
            html += "<p>[" +el.time +"] &lt " +el.nick+"&gt: " +el.message+"</p>";
    Severity: Major
    Found in features/slack/assets/js/slack.js and 1 other location - About 3 hrs to fix
    htdocs/assets/js/irc.js on lines 85..93

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

    $('#start_date').focusout(function () {
      if (compareDateRange() < 0) {
        $('#end_date').val($('#start_date').val());
        $('#detect_date').val($('#start_date').val());
        $('#status_date').val($('#start_date').val());
    Severity: Major
    Found in htdocs/assets/js/timehelpers.js and 2 other locations - About 3 hrs to fix
    htdocs/assets/js/timehelpers.js on lines 78..84
    htdocs/assets/js/timehelpers.js on lines 85..91

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

    $('#start_time').focusout(function () {
      if (compareTimeRange() < 0) {
        $('#end_time').val($('#start_time').val());
        $('#detect_time').val($('#start_time').val());
        $('#status_time').val($('#start_time').val());
    Severity: Major
    Found in htdocs/assets/js/timehelpers.js and 2 other locations - About 3 hrs to fix
    htdocs/assets/js/timehelpers.js on lines 70..76
    htdocs/assets/js/timehelpers.js on lines 85..91

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

    $('#end_date').focusout(function () {
      if (compareDateRange() < 0) {
        $('#start_date').val($('#end_date').val());
        $('#detect_date').val($('#end_date').val());
        $('#status_date').val($('#end_date').val());
    Severity: Major
    Found in htdocs/assets/js/timehelpers.js and 2 other locations - About 3 hrs to fix
    htdocs/assets/js/timehelpers.js on lines 70..76
    htdocs/assets/js/timehelpers.js on lines 78..84

    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

    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

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

              if (isset($feature['custom_css_assets'])) {
                  // If we are just configured "on" then default to
                  // include a css file named after the feature
                  if ($feature['custom_css_assets'] === "on") {
                      $feature['custom_css_assets'] = array("{$feature_name}.css");
      Severity: Major
      Found in views/content/edit.php and 1 other location - About 3 hrs to fix
      views/content/edit.php on lines 338..359

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

              if (isset($feature['custom_js_assets'])) {
                  // If we are just configured "on" then default to
                  // include a js file named after the feature
                  if ($feature['custom_js_assets'] === "on") {
                      $feature['custom_js_assets'] = array("{$feature_name}.js");
      Severity: Major
      Found in views/content/edit.php and 1 other location - About 3 hrs to fix
      views/content/edit.php on lines 315..336

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

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

          static function save_event($postmortem, $conn = null) {
              $values = array("title");
      
              try {
                  if (isset($postmortem["id"])) {
      Severity: Major
      Found in phplib/Persistence.php - About 3 hrs to fix

        File edit.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        <?php if ($event['deleted']): ?>
            <div class="row-fluid">
                <div class="alert">
                    <strong>Heads up!</strong> This postmortem was deleted.
        Severity: Minor
        Found in views/content/edit.php - About 3 hrs to fix

          File Persistence.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          require_once "Configuration.php";
          
          /**
          Severity: Minor
          Found in phplib/Persistence.php - About 3 hrs to fix

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

            function display_irc_not_implemented(jqXHR, textStatus, errorThrown) {
              var html='<div class="alert alert-danger">';
              if (jqXHR.status == "404") {
                  html += 'IRC history feature not implemented';
              } else {
            Severity: Major
            Found in htdocs/assets/js/irc.js and 1 other location - About 2 hrs to fix
            features/slack/assets/js/slack.js on lines 58..68

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

            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 display_slack_not_implemented(jqXHR, textStatus, errorThrown) {
                var html='<div class="alert alert-danger">';
                if (jqXHR.status == "404") {
                    html += 'Slack history feature not implemented';
                } else {
            Severity: Major
            Found in features/slack/assets/js/slack.js and 1 other location - About 2 hrs to fix
            htdocs/assets/js/irc.js on lines 95..105

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

            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 get_array has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                static function get_array($columns, $where = array(), $table_name, $conn = null) {
                    if (!$where) {
                        $where = array();
                    }
            
            
            Severity: Minor
            Found in phplib/Persistence.php - About 2 hrs 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

            Severity
            Category
            Status
            Source
            Language