CiviWiki/OpenCiviWiki

View on GitHub
project/core/templates/static/js/thread.js

Summary

Maintainability
F
1 mo
Test Coverage

File thread.js has 1688 lines of code (exceeds 250 allowed). Consider refactoring.
Open

cw = cw || {};

cw.DEFAULTS = {
    types: ['problem', 'cause', 'solution'],
    types_plural: ['problems', 'causes', 'solutions'],
Severity: Major
Found in project/core/templates/static/js/thread.js - About 4 days to fix

    Function saveEdit has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
    Open

        saveEdit: function(e) {
            e.stopPropagation();
            var _this = this;
            var c_type = this.model.get('type');
            var new_body = this.$('.edit-civi-body').val().trim();
    Severity: Minor
    Found in project/core/templates/static/js/thread.js - About 1 day 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

    Function saveEdit has 177 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        saveEdit: function(e) {
            e.stopPropagation();
            var _this = this;
            var c_type = this.model.get('type');
            var new_body = this.$('.edit-civi-body').val().trim();
    Severity: Major
    Found in project/core/templates/static/js/thread.js - About 7 hrs to fix

      Function editThread has 125 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          editThread: function (e) {
              var _this = this;
              _this.$(e.currentTarget).addClass('disabled').attr('disabled', true);
      
              var title = this.$el.find('#thread-title').val().trim();
      Severity: Major
      Found in project/core/templates/static/js/thread.js - About 5 hrs to fix

        Function success has 118 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        success: function (response) {
                            _this.closeEdit(e);
                            // var score = $this.find('.rate-value');
                            // var new_vote = parseInt(score.text())+ 1;
                            // score.text(new_vote);
        Severity: Major
        Found in project/core/templates/static/js/thread.js - About 4 hrs to fix

          Function createCivi has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              createCivi: function (e) {
                  var _this = this;
          
                  var title = this.$el.find('#civi-title').val(),
                      body = this.$el.find('#civi-body').val(),
          Severity: Major
          Found in project/core/templates/static/js/thread.js - About 4 hrs to fix

            Function renderOutline has 100 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                renderOutline: function(){
                    var _this = this;
                    if (this.civis.length === 0){
                        // render with mock data to prevent errors
                        var mockData = {
            Severity: Major
            Found in project/core/templates/static/js/thread.js - About 4 hrs to fix

              Function success has 98 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              success: function (response) {
                                  var file = $('#thread_attachment_image').val();
                                  var img_url = _this.$('#link-image-form').val().trim();
                                  if (_this.removeImage) {
                                      // if file
              Severity: Major
              Found in project/core/templates/static/js/thread.js - About 3 hrs to fix

                ThreadView has 31 functions (exceeds 20 allowed). Consider refactoring.
                Open

                cw.ThreadView = BB.View.extend({
                    el: '#thread',
                    template: _.template($('#thread-template').html()),
                    wikiTemplate: _.template($('#thread-wiki-template').html()),
                    bodyTemplate: _.template($('#thread-body-template').html()),
                Severity: Minor
                Found in project/core/templates/static/js/thread.js - About 3 hrs to fix

                  Function createCivi has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      createCivi: function (e) {
                          var _this = this;
                  
                          var title = this.$el.find('#civi-title').val(),
                              body = this.$el.find('#civi-body').val(),
                  Severity: Minor
                  Found in project/core/templates/static/js/thread.js - About 3 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

                  Function createResponse has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      createResponse: function (e) {
                          var _this = this;
                          this.$(e.currentTarget).addClass('disabled').attr('disabled', true);
                          var title = this.$('#response-title').val(),
                              body = this.$('#response-body').val(),
                  Severity: Major
                  Found in project/core/templates/static/js/thread.js - About 3 hrs to fix

                    Function initRecommended has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        initRecommended: function() {
                            var _this = this;
                            this.recommendedCivis = [];
                            this.otherCivis = [];
                            this.civiRecViewTotals = {problem : 0,cause: 0,solution: 0};
                    Severity: Major
                    Found in project/core/templates/static/js/thread.js - About 2 hrs to fix

                      Function editThread has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          editThread: function (e) {
                              var _this = this;
                              _this.$(e.currentTarget).addClass('disabled').attr('disabled', true);
                      
                              var title = this.$el.find('#thread-title').val().trim();
                      Severity: Minor
                      Found in project/core/templates/static/js/thread.js - 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

                      Function success has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                      success: function (response) {
                                          var new_civi_data = response.data;
                                          var new_civi = new cw.CiviModel(new_civi_data);
                                          var can_edit = new_civi.get('author').username == _this.options.parentView.username ? true : false;
                      
                      
                      Severity: Major
                      Found in project/core/templates/static/js/thread.js - About 2 hrs to fix

                        Function createResponse has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            createResponse: function (e) {
                                var _this = this;
                                this.$(e.currentTarget).addClass('disabled').attr('disabled', true);
                                var title = this.$('#response-title').val(),
                                    body = this.$('#response-body').val(),
                        Severity: Minor
                        Found in project/core/templates/static/js/thread.js - 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

                        Function success has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                        success: function (response) {
                                            var attachment_input = _this.$('#response_attachment_image');
                                            var uploaded_images = attachment_input[0].files;
                                            if (_this.attachmentCount > 0) {
                                                var formData = new FormData(_this.$('#response_attachment_image_form')[0]);
                        Severity: Minor
                        Found in project/core/templates/static/js/thread.js - About 1 hr to fix

                          Function renderCivis has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              renderCivis: function () {
                                  this.$('#thread-problems').empty();
                                  this.$('#thread-causes').empty();
                                  this.$('#thread-solutions').empty();
                          
                          
                          Severity: Minor
                          Found in project/core/templates/static/js/thread.js - About 1 hr to fix

                            Function clickRating has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                clickRating: function (e) {
                                    e.stopPropagation();
                                    var _this = this;
                                    var $this = $(e.currentTarget);
                            
                            
                            Severity: Minor
                            Found in project/core/templates/static/js/thread.js - About 1 hr to fix

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

                                  renderResponses: function () {
                                      this.$('.responses-box').empty().append(this.responseWrapper());
                                      this.newResponseView = new cw.NewResponseView({
                                          model: this.model,
                                          parentView: this
                              Severity: Minor
                              Found in project/core/templates/static/js/thread.js - About 1 hr to fix

                                Function clickFavorite has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    clickFavorite: function (e) {
                                        var _this = this;
                                
                                        if ($this.text() === 'star_border') {
                                            $.ajax({
                                Severity: Minor
                                Found in project/core/templates/static/js/thread.js - About 1 hr to fix

                                  Function deleteEdit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      deleteEdit: function(e) {
                                          var _this = this;
                                          e.stopPropagation();
                                  
                                          $.ajax({
                                  Severity: Minor
                                  Found in project/core/templates/static/js/thread.js - About 1 hr to fix

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

                                        publishThread: function(e){
                                            var _this = this;
                                            _this.$(e.currentTarget).addClass('disabled').attr('disabled', true);
                                    
                                            $.ajax({
                                    Severity: Minor
                                    Found in project/core/templates/static/js/thread.js - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                              if (target.hasClass('btn') || target.hasClass('rating-button') || target.is('input') || target.is('textarea') || target.is('label') || target.hasClass('input') || ms_check) {
                                                  return;
                                              }
                                      Severity: Major
                                      Found in project/core/templates/static/js/thread.js - About 1 hr to fix

                                        Function clickRating has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            clickRating: function (e) {
                                                e.stopPropagation();
                                                var _this = this;
                                                var $this = $(e.currentTarget);
                                        
                                        
                                        Severity: Minor
                                        Found in project/core/templates/static/js/thread.js - About 55 mins to fix

                                        Cognitive Complexity

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

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

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

                                        Further reading

                                        Function renderOutline has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            renderOutline: function(){
                                                var _this = this;
                                                if (this.civis.length === 0){
                                                    // render with mock data to prevent errors
                                                    var mockData = {
                                        Severity: Minor
                                        Found in project/core/templates/static/js/thread.js - About 45 mins to fix

                                        Cognitive Complexity

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

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

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

                                        Further reading

                                        Consider simplifying this complex logical expression.
                                        Open

                                                } else if (this.imageRemoveList.length===0 && this.attachmentCount===0 && (new_body == this.model.get('body') && new_title == this.model.get('title') && _.isEqual(links, this.model.get('links')) && new_type == this.model.get('type') )){
                                                    this.closeEdit(e);
                                                    return;
                                                } else {
                                                    var data;
                                        Severity: Major
                                        Found in project/core/templates/static/js/thread.js - About 40 mins to fix

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

                                              loadMoreCivis: function(e) {
                                                  var $target = $(e.currentTarget);
                                                  var type = $target.data('civi-type');
                                                  var limit, remaining;
                                                  if (this.viewRecommended) {
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js - About 25 mins to fix

                                          Cognitive Complexity

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

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

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

                                          Further reading

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

                                              drilldownCivi: function (e) {
                                                  var target = $(e.target);
                                                  var ms_check = target.hasClass('ms-ctn') || target.hasClass('ms-sel-ctn') || target.hasClass('ms-close-btn') || target.hasClass('ms-trigger') || target.hasClass('ms-trigger-ico') || target.hasClass('ms-res-ctn') || target.hasClass('ms-sel-item') || target.hasClass('ms-res-group');
                                          
                                                  if (target.hasClass('btn') || target.hasClass('rating-button') || target.is('input') || target.is('textarea') || target.is('label') || target.hasClass('input') || ms_check) {
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js - About 25 mins to fix

                                          Cognitive Complexity

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

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

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

                                          Further reading

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

                                                                      error: function(e){
                                                                          Materialize.toast('Civi was edited but one or more images could not be uploaded', 5000);
                                          
                                                                          // Set the models with new data and rerender
                                                                          _this.model.set('title', new_title);
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 2 days to fix
                                          project/core/templates/static/js/thread.js on lines 499..532

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

                                          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

                                                                      success: function (response2) {
                                          
                                                                          Materialize.toast('Saved.', 5000);
                                          
                                                                          // Set the models with new data and rerender
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 2 days to fix
                                          project/core/templates/static/js/thread.js on lines 533..565

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

                                          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

                                              previewImageNames: function(e) {
                                                  var attachment_input = this.$('#id_attachment_image');
                                                  var uploaded_images = attachment_input[0].files;
                                                  var $previewlist = this.$('.file-preview');
                                                  $previewlist.empty();
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 1 day to fix
                                          project/core/templates/static/js/thread.js on lines 207..240
                                          project/core/templates/static/js/thread.js on lines 946..979

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

                                          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

                                              previewImageNames: function(e) {
                                                  var attachment_input = this.$('#id_attachment_image');
                                                  var uploaded_images = attachment_input[0].files;
                                                  var $previewlist = this.$('.file-preview');
                                                  $previewlist.empty();
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 1 day to fix
                                          project/core/templates/static/js/thread.js on lines 715..748
                                          project/core/templates/static/js/thread.js on lines 946..979

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

                                          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

                                              previewImageNames: function(e) {
                                                  var attachment_input = this.$('#response_attachment_image');
                                                  var uploaded_images = attachment_input[0].files;
                                                  var $previewlist = this.$('.file-preview');
                                                  $previewlist.empty();
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 1 day to fix
                                          project/core/templates/static/js/thread.js on lines 207..240
                                          project/core/templates/static/js/thread.js on lines 715..748

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

                                          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

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

                                                                          success: function (response2) {
                                                                              Materialize.toast('Saved changes', 5000);
                                                                              // _this.hide();
                                          
                                          
                                          
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 6 hrs to fix
                                          project/core/templates/static/js/thread.js on lines 1231..1242

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

                                          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

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

                                                                          success: function (response2) {
                                                                              Materialize.toast('Saved changes', 5000);
                                                                              // _this.hide();
                                          
                                                                              new_data = response.data;
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 6 hrs to fix
                                          project/core/templates/static/js/thread.js on lines 1168..1181

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

                                          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

                                                  } else {
                                                      this.$(".label-recommended").removeClass('current');
                                                      this.$(".label-other").addClass('current');
                                                      this.$(".badge-recommended").removeClass('current');
                                                      this.$(".badge-other").addClass('current');
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 3 hrs to fix
                                          project/core/templates/static/js/thread.js on lines 1613..1619

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

                                          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 (this.viewRecommended){
                                                      this.$(".label-recommended").addClass('current');
                                                      this.$(".label-other").removeClass('current');
                                                      this.$(".badge-recommended").addClass('current');
                                                      this.$(".badge-other").removeClass('current');
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 3 hrs to fix
                                          project/core/templates/static/js/thread.js on lines 1619..1625

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

                                          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

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

                                              addImageLinkInput: function(){
                                                  var link_images = this.$('.civi-link-images').length;
                                                  if (link_images > 20 ) {
                                                      Materialize.toast("Don't think you need any more...", 5000);
                                                  } else {
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 2 hrs to fix
                                          project/core/templates/static/js/thread.js on lines 197..205
                                          project/core/templates/static/js/thread.js on lines 705..713

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

                                          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

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

                                              addImageLinkInput: function(){
                                                  var link_images = this.$('.civi-link-images').length;
                                                  if (link_images > 20 ) {
                                                      Materialize.toast("Don't think you need any more...", 5000);
                                                  } else {
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 2 hrs to fix
                                          project/core/templates/static/js/thread.js on lines 197..205
                                          project/core/templates/static/js/thread.js on lines 936..944

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

                                          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

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

                                              addImageLinkInput: function(){
                                                  var link_images = this.$('.civi-link-images').length;
                                                  if (link_images > 20 ) {
                                                      Materialize.toast("Don't think you need any more...", 5000);
                                                  } else {
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 2 hrs to fix
                                          project/core/templates/static/js/thread.js on lines 705..713
                                          project/core/templates/static/js/thread.js on lines 936..944

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

                                          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

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

                                                                          error: function(e){
                                                                              Materialize.toast('ERROR: Image could not be uploaded', 5000);
                                                                              Materialize.toast(e.statusText, 5000);
                                                                              _this.$(e.currentTarget).removeClass('disabled').attr('disabled', false);
                                                                          }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1182..1186
                                          project/core/templates/static/js/thread.js on lines 1243..1247

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

                                          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

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

                                                                          error: function(e){
                                                                              Materialize.toast('ERROR: Image could not be uploaded', 5000);
                                                                              Materialize.toast(e.statusText, 5000);
                                                                              _this.$(e.currentTarget).removeClass('disabled').attr('disabled', false);
                                                                          },
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1215..1219
                                          project/core/templates/static/js/thread.js on lines 1243..1247

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

                                          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

                                                              } else {
                                                                  _.each(civi.get('links'), function(link){
                                                                      var linked_civi = this.civis.get(link);
                                                                      if (linked_civi) {
                                                                          this.otherCivis.push(link);
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1406..1413

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

                                          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 ((voteData.activity_type == 'vote_pos' || voteData.activity_type == 'vote_vpos')){
                                                                  _.each(civi.get('links'), function(link){
                                                                      var linked_civi = this.civis.get(link);
                                                                      if (linked_civi) {
                                                                          this.recommendedCivis.push(link);
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1413..1420

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

                                          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

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

                                                                          error: function(e){
                                                                              Materialize.toast('ERROR: Image could not be uploaded', 5000);
                                                                              Materialize.toast(e.statusText, 5000);
                                                                              _this.$(e.currentTarget).removeClass('disabled').attr('disabled', false);
                                                                          }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1182..1186
                                          project/core/templates/static/js/thread.js on lines 1215..1219

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

                                          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

                                                  var ms_check = target.hasClass('ms-ctn') || target.hasClass('ms-sel-ctn') || target.hasClass('ms-close-btn') || target.hasClass('ms-trigger') || target.hasClass('ms-trigger-ico') || target.hasClass('ms-res-ctn') || target.hasClass('ms-sel-item') || target.hasClass('ms-res-group');
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1935..1935

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

                                          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 (target.hasClass('btn') || target.hasClass('rating-button') || target.is('input') || target.is('textarea') || target.is('label') || target.hasClass('input') || ms_check) {
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1933..1933

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

                                          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

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

                                                              } else {
                                                                  Materialize.toast('New response created.', 5000);
                                                                  _this.options.parentView.responseCollection.fetch();
                                                                  _this.options.parentView.renderResponses();
                                                                  _this.$el.empty();
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1028..1033

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

                                          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

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

                                                                      success: function (response2) {
                                                                          Materialize.toast('New response created.', 5000);
                                                                          _this.options.parentView.responseCollection.fetch();
                                                                          _this.options.parentView.renderResponses();
                                                                          _this.$el.empty();
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1046..1051

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

                                          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

                                                  count.totalRec = this.civiRecViewTotals.problem + this.civiRecViewTotals.cause + this.civiRecViewTotals.solution - recCount.problem - recCount.cause - recCount.solution;
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1604..1604

                                          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

                                                  count.totalOther = this.civiOtherViewTotals.problem + this.civiOtherViewTotals.cause + this.civiOtherViewTotals.solution - recCount.problem - otherCount.cause - otherCount.solution;
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1603..1603

                                          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

                                                      if (this.civiOtherViewLimits[type] === 0) {
                                                          if (civiOtherViewLimits[type] < 5) {
                                                              civiOtherViewLimits[type] = 5;
                                                          }
                                                          this.civiOtherViewLimits[type] = civiOtherViewLimits[type];
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1437..1442

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

                                          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 (this.civiRecViewLimits[type] === 0) {
                                                          if (civiRecViewLimits[type] < 5) {
                                                              civiRecViewLimits[type] = 5;
                                                          }
                                                          this.civiRecViewLimits[type] = civiRecViewLimits[type];
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1443..1448

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

                                          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

                                          Identical blocks of code found in 5 locations. Consider refactoring.
                                          Open

                                                                      $.ajaxSetup({
                                                                          beforeSend: function(xhr, settings) {
                                                                              if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
                                                                                  xhr.setRequestHeader("X-CSRFToken", csrftoken);
                                                                              }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 4 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 459..465
                                          project/core/templates/static/js/thread.js on lines 488..494
                                          project/core/templates/static/js/thread.js on lines 803..809
                                          project/core/templates/static/js/thread.js on lines 1017..1023

                                          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

                                          Identical blocks of code found in 5 locations. Consider refactoring.
                                          Open

                                                                  $.ajaxSetup({
                                                                      beforeSend: function(xhr, settings) {
                                                                          if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
                                                                              xhr.setRequestHeader("X-CSRFToken", csrftoken);
                                                                          }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 4 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 459..465
                                          project/core/templates/static/js/thread.js on lines 488..494
                                          project/core/templates/static/js/thread.js on lines 1017..1023
                                          project/core/templates/static/js/thread.js on lines 1157..1163

                                          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

                                          Identical blocks of code found in 5 locations. Consider refactoring.
                                          Open

                                                                  $.ajaxSetup({
                                                                      beforeSend: function(xhr, settings) {
                                                                          if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
                                                                              xhr.setRequestHeader("X-CSRFToken", csrftoken);
                                                                          }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 4 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 459..465
                                          project/core/templates/static/js/thread.js on lines 488..494
                                          project/core/templates/static/js/thread.js on lines 803..809
                                          project/core/templates/static/js/thread.js on lines 1157..1163

                                          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

                                          Identical blocks of code found in 5 locations. Consider refactoring.
                                          Open

                                                      $.ajaxSetup({
                                                          beforeSend: function(xhr, settings) {
                                                              if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
                                                                  xhr.setRequestHeader("X-CSRFToken", csrftoken);
                                                              }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 4 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 488..494
                                          project/core/templates/static/js/thread.js on lines 803..809
                                          project/core/templates/static/js/thread.js on lines 1017..1023
                                          project/core/templates/static/js/thread.js on lines 1157..1163

                                          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

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

                                                  if (this.currentCivi !== $newCivi.attr('data-civi-id')) {
                                                      // $currentCivi.removeClass('current');
                                                      this.$('.civi-card').removeClass('current');
                                                      $newCivi.addClass('current');
                                                      var civi_id = $newCivi.data('civi-id');
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1943..1960

                                          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

                                          Identical blocks of code found in 5 locations. Consider refactoring.
                                          Open

                                                                  $.ajaxSetup({
                                                                      beforeSend: function(xhr, settings) {
                                                                          if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
                                                                              xhr.setRequestHeader("X-CSRFToken", csrftoken);
                                                                          }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 4 other locations - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 459..465
                                          project/core/templates/static/js/thread.js on lines 803..809
                                          project/core/templates/static/js/thread.js on lines 1017..1023
                                          project/core/templates/static/js/thread.js on lines 1157..1163

                                          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

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

                                                      if (this.currentCivi !== $newCivi.attr('data-civi-id')) {
                                                          // $currentCivi.removeClass('current');
                                                          this.$('.civi-card').removeClass('current');
                                                          $newCivi.addClass('current');
                                                          var civi_id = $newCivi.data('civi-id');
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1909..1927

                                          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

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

                                                                          $('#thread-' + c_type + 's').append(new cw.CiviView({model: new_civi, can_edit: can_edit, parentView: _this.options.parentView}).el);
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 820..820

                                          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

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

                                                                          $('#thread-' + c_type + 's').append(new cw.CiviView({model: new_civi, can_edit: can_edit, parentView: _this.options.parentView}).el);
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 834..834

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

                                              hideImageForm: function () {
                                                  this.$('#thread-image-forms').addClass('hide');
                                                  this.$('.previous-image').removeClass('hide');
                                                  this.removeImage = false;
                                              },
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1106..1110

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

                                          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

                                              showImageForm: function () {
                                                  this.$('#thread-image-forms').removeClass('hide');
                                                  this.$('.previous-image').addClass('hide');
                                                  this.removeImage = true;
                                              },
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1112..1116

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

                                          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

                                              showImageLinkForm: function () {
                                                  this.imageMode="link";
                                                  this.$('#attachment_image_form').addClass('hide');
                                                  this.$('#link-image-form').removeClass('hide');
                                              },
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1117..1121

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

                                          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

                                              showImageUploadForm: function () {
                                                  this.imageMode="upload";
                                                  this.$('#attachment_image_form').removeClass('hide');
                                                  this.$('#link-image-form').addClass('hide');
                                              },
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 1 hr to fix
                                          project/core/templates/static/js/thread.js on lines 1122..1126

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

                                          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

                                                          error: function(){
                                                              Materialize.toast('Could not create response', 5000);
                                                              _this.$(e.currentTarget).removeClass('disabled').attr('disabled', false);
                                                          }
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 55 mins to fix
                                          project/core/templates/static/js/thread.js on lines 1265..1268

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

                                          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

                                                          error: function() {
                                                              Materialize.toast('Servor Error: Thread could not be edited', 5000);
                                                              _this.$(e.currentTarget).removeClass('disabled').attr('disabled', false);
                                                          }
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 55 mins to fix
                                          project/core/templates/static/js/thread.js on lines 1053..1056

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

                                          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

                                                  } else {
                                                      this.$('.edit-links').removeClass('hide');
                                                      this.$('#magicsuggest-'+this.model.id).removeClass('hide');
                                                  }
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 55 mins to fix
                                          project/core/templates/static/js/thread.js on lines 378..381

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

                                          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 (new_type === "problem") {
                                                      this.$('.edit-links').addClass('hide');
                                                      this.$('#magicsuggest-'+this.model.id).addClass('hide');
                                                  } else {
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 55 mins to fix
                                          project/core/templates/static/js/thread.js on lines 381..384

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

                                          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

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

                                                          if (vote) {
                                                              this.$('#civi-'+ vote.civi_id).find("." +vote.activity_type).addClass('current');
                                                          }
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 45 mins to fix
                                          project/core/templates/static/js/thread.js on lines 1750..1752

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

                                          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

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

                                                      if (vote) {
                                                          this.$('#civi-'+ vote.civi_id).find("." +vote.activity_type).addClass('current');
                                                      }
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 45 mins to fix
                                          project/core/templates/static/js/thread.js on lines 1763..1765

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

                                          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

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

                                                                  if (_this.attachment_links.length){
                                                                      _.each(_this.attachment_links, function(img_link){
                                                                          formData.append('attachment_links[]', img_link);
                                                                      });
                                                                  }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 482..486
                                          project/core/templates/static/js/thread.js on lines 797..801

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

                                          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

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

                                                                  if (_this.attachment_links.length){
                                                                      _.each(_this.attachment_links, function(img_link){
                                                                          formData.append('attachment_links[]', img_link);
                                                                      });
                                                                  }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 482..486
                                          project/core/templates/static/js/thread.js on lines 1011..1015

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

                                          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

                                                          } else if (c_type === 'solution') {
                                                              Materialize.toast('A SOLUTION Civi must be linked to a CAUSE Civi', 5000);
                                                              this.$(e.currentTarget).removeClass('disabled').attr('disabled', false);
                                                              return;
                                                          }
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 766..774

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

                                          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 (c_type === 'cause') {
                                                              Materialize.toast('A CAUSE Civi must be linked to a PROBLEM Civi. If it is only linked to a solution it will not appear', 5000);
                                                              this.$(e.currentTarget).removeClass('disabled').attr('disabled', false);
                                                              return;
                                                          } else if (c_type === 'solution') {
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 770..774

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

                                          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

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

                                                                  if (_this.attachment_links.length){
                                                                      _.each(_this.attachment_links, function(img_link){
                                                                          formData.append('attachment_links[]', img_link);
                                                                      });
                                                                  }
                                          Severity: Major
                                          Found in project/core/templates/static/js/thread.js and 2 other locations - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 797..801
                                          project/core/templates/static/js/thread.js on lines 1011..1015

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

                                          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

                                                      var otherCivis = _.filter(civis, function(c) {
                                                          return (_.indexOf(this.otherCivis, c.id) != -1);
                                                      }, this);
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 1671..1673

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

                                          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

                                                      var recCivis = _.filter(civis, function(c) {
                                                          return (_.indexOf(this.recommendedCivis, c.id) != -1);
                                                      }, this);
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 1675..1677

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

                                          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

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

                                                  if (title && summary && category_id) {
                                                      $.ajax({
                                                          url: '/api/edit_thread/',
                                                          type: 'POST',
                                                          data: {
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 994..1061

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

                                          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

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

                                                  if (title && body) {
                                                      $.ajax({
                                                          url: '/api/new_civi/',
                                                          type: 'POST',
                                                          data: {
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 40 mins to fix
                                          project/core/templates/static/js/thread.js on lines 1138..1273

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

                                          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

                                              url: function () {
                                                  if (! this.threadId ) {
                                                      throw new Error("This is a race condition! and why we can't have nice things :(");
                                                  }
                                                  return '/api/thread_data/' + this.threadId + '/';
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 30 mins to fix
                                          project/core/templates/static/js/thread.js on lines 68..73

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

                                          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

                                              url: function () {
                                                  if (! this.threadId ) {
                                                      throw new Error("This is a race condition! and why we can't have nice things :(");
                                                  }
                                                  return '/api/threads/' + this.threadId + '/civis';
                                          Severity: Minor
                                          Found in project/core/templates/static/js/thread.js and 1 other location - About 30 mins to fix
                                          project/core/templates/static/js/thread.js on lines 147..152

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

                                          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

                                          Unexpected trailing spaces found.
                                          Open

                                            

                                          Unexpected trailing spaces found.
                                          Open

                                                  

                                          Unexpected trailing spaces found.
                                          Open

                                                          

                                          Unexpected trailing spaces found.
                                          Open

                                                      

                                          Unexpected trailing spaces found.
                                          Open

                                                  

                                          Unexpected trailing spaces found.
                                          Open

                                                  

                                          There are no issues that match your filters.

                                          Category
                                          Status