Showing 1,422 of 1,422 total issues

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

Function addTicket has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addTicket() {
    var jira_input = $("#jira_key_input");
    var jira_keys = (jira_input.attr("value"));
    if (jira_keys !== "") {
        store_ticket_for_event(get_current_event_id(), jira_keys, function(data) {
Severity: Minor
Found in htdocs/assets/js/jira.js - About 1 hr to fix

    Method get has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function get($url, array $params = null, $user_pass = null, $proxy = null,
                     $timeout = 10) {
            $query_string = empty($params)
                ? ''
                : '?' . http_build_query($params);
    Severity: Minor
    Found in phplib/CurlClient.php - About 1 hr to fix

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

          static function get_image($theid, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              $columns = array('id', 'image_link');
              $table_name = 'images';
              if (is_null($conn)) {
      Severity: Major
      Found in features/images/lib.php and 3 other locations - About 1 hr to fix
      features/irc/lib.php on lines 101..110
      features/jira/lib.php on lines 84..93
      features/slack/lib.php on lines 284..293

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

      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

          static function save_jira_tickets_for_event($event_id, $tickets, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              $table_name = 'jira';
              $assoc_column = 'ticket';
              if (is_null($conn)) {
      Severity: Major
      Found in features/jira/lib.php and 2 other locations - About 1 hr to fix
      features/images/lib.php on lines 45..55
      features/irc/lib.php on lines 62..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 101.

      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

          static function get_channel($theid, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              $columns = array('id', 'channel');
              $table_name = 'irc';
              if (is_null($conn)) {
      Severity: Major
      Found in features/irc/lib.php and 3 other locations - About 1 hr to fix
      features/images/lib.php on lines 84..93
      features/jira/lib.php on lines 84..93
      features/slack/lib.php on lines 284..293

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

      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

          static function get_channel($theid, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              $columns = array('id', 'channel');
              $table_name = 'slack';
              if (is_null($conn)) {
      Severity: Major
      Found in features/slack/lib.php and 3 other locations - About 1 hr to fix
      features/images/lib.php on lines 84..93
      features/irc/lib.php on lines 101..110
      features/jira/lib.php on lines 84..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 101.

      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

          static function save_images_for_event($event_id, $images, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              $table_name = 'images';
              $assoc_column = 'image_link';
              if (is_null($conn)) {
      Severity: Major
      Found in features/images/lib.php and 2 other locations - About 1 hr to fix
      features/irc/lib.php on lines 62..72
      features/jira/lib.php on lines 45..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 101.

      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

          static function save_irc_channels_for_event($event_id, $channels, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              $table_name = 'irc';
              $assoc_column = 'channel';
              if (is_null($conn)) {
      Severity: Major
      Found in features/irc/lib.php and 2 other locations - About 1 hr to fix
      features/images/lib.php on lines 45..55
      features/jira/lib.php on lines 45..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 101.

      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

          static function get_ticket($theid, $conn = null) {
              $conn = $conn ?: Persistence::get_database_object();
              $columns = array('id', 'ticket');
              $table_name = 'jira';
              if (is_null($conn)) {
      Severity: Major
      Found in features/jira/lib.php and 3 other locations - About 1 hr to fix
      features/images/lib.php on lines 84..93
      features/irc/lib.php on lines 101..110
      features/slack/lib.php on lines 284..293

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

      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

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class CurlClientTest extends \PHPUnit\Framework\TestCase {

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class ContactTest extends \PHPUnit\Framework\TestCase {
      Severity: Minor
      Found in tests/unit/Contact_Test.php by phpcodesniffer

      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

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class JiraClientTest extends \PHPUnit\Framework\TestCase {

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class Jira {
      Severity: Minor
      Found in features/jira/lib.php by phpcodesniffer

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class Images {
      Severity: Minor
      Found in features/images/lib.php by phpcodesniffer

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class Anniversary extends Persistence {
      Severity: Minor
      Found in features/anniversary/lib.php by phpcodesniffer

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class Links {
      Severity: Minor
      Found in features/links/lib.php by phpcodesniffer
      Severity
      Category
      Status
      Source
      Language