axsh/wakame-vdc

View on GitHub
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js

Summary

Maintainability
F
1 wk
Test Coverage

Function imagePanel has 433 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.imagePanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 2 days to fix

Function imagePanel has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.imagePanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 7 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 callback has 185 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    callback: function(){
      var self = this;

      var loading_image = DcmgrGUI.Util.getLoadingImage('boxes');
      $(this).find('#select_ssh_key_pair').empty().html(loading_image);
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 7 hrs to fix

File image_panel.js has 435 lines of code (exceeds 250 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.imagePanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 6 hrs to fix

Function launch_button_name has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  launch_instance_buttons[launch_button_name] = function() {
    var self = this;
    var image_id = $(this).find('#image_id').val();
    var display_name = $(this).find('#display_name').val();
    var host_name = $(this).find('#host_name').val();
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 1 hr to fix

Function ready has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      var ready = function(data) {
        if($(self).find('#monitoring_enabled').is(':checked')){
          _.chain(['#mailaddr_0', '#mailaddr_1', '#mailaddr_2']).map(function(id){
            var v = $(self).find(id).val();
            if(v.length > 0){
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 1 hr to fix

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

            success: function(json,status){
              var data = [];
              var results = json.security_group.results;
              var size = results.length;
              for (var i=0; i < size ; i++) {
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        if(data['instance_spec'] == true &&
           data['ssh_keypair'] == true &&
           data['security_groups'] == true &&
           data['networks'] == true &&
           data['display_name'] == true &&
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 40 mins to fix

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

          _.chain(['#mailaddr_0', '#mailaddr_1', '#mailaddr_2']).map(function(id){
            var v = $(self).find(id).val();
            if(v.length > 0){
              return [true, /^[^@]+@[a-z0-9A-Z][a-z0-9A-Z\.\-]+$/.test(v)];
            }else{
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 145..165

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

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

    edit_machine_image_buttons[update_button_name] = function(event) {
      var image_id = $(this).find('#image_id').val();
      var display_name = $(this).find('#machine_image_display_name').val();
      var description = $(this).find('#machine_image_description').val();
      var data = 'display_name=' + encodeURIComponent(display_name)
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/sshkeypair_panel.js on lines 52..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 195.

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

      $(this).find('#monitoring_enabled').bind('click',
                                               {'name': 'monitoring', 'is_ready': is_ready, 'ready': ready},
                                               DcmgrGUI.Util.checkTextField).bind('click', function(e){
                                                 _.each(['#mailaddr_0', '#mailaddr_1', '#mailaddr_2'], function(id){
                                                   if( $(e.target).is(":checked") ){
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 202..211

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

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

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

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

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

Refactorings

Further Reading

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

  delete_backup_image_buttons[delete_button_name] = function() {
      var image_id = $(this).find('#image_id').val();
      var request = new DcmgrGUI.Request;
      request.del({
    "url": '/machine_images/'+ image_id +'.json',
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 293..304
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/security_group_panel.js on lines 210..221
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/sshkeypair_panel.js on lines 189..201

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

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

    _.each(['#mailaddr_0', '#mailaddr_1', '#mailaddr_2'], function(id){
      if( _.isString($(self).find(id).val()) && $(self).find(id).val() != ""){
        data.push("monitoring[mail_address][]="+$(self).find(id).val());
      }
    });
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 94..98

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

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

              for (var i=0; i < size ; i++) {
                var ssh_keypair_id = results[i].result.id;
                var ssh_keypair_name = results[i].result.display_name;
                var html = '<option id="'+ ssh_keypair_id +'" value="'+ ssh_keypair_id +'">'+ssh_keypair_name+' ('+ssh_keypair_id+')</option>'
                select_keypair.append(html);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 379..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 111.

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(data['instance_spec'] == true &&
           data['ssh_keypair'] == true &&
           data['security_groups'] == true &&
           data['networks'] == true &&
           data['display_name'] == true &&
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 61..70

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 103.

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

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

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

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

Refactorings

Further Reading

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

              var create_select_item = function(name) {
                var select_html = '<select id="' + name + '" name="' + name + '"></select>';
                $(self).find('#select_' + name).empty().html(select_html);
                return $(self).find('#' + name);
              }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/network_panel.js on lines 347..351

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

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

              for (var i=0; i < size ; i++) {
                var uuid = results[i].result.uuid;
                var html = '<option value="'+ uuid +'">'+uuid+'</option>';
                select_instance_specs.append(html);
              }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/volume_panel.js on lines 186..190

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

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

  c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){
    c_list.clearCheckedList();
    $('#detail').html('');
    bt_refresh.element.trigger('dcmgrGUI.refresh');
  });
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 217..221
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/host_node_panel.js on lines 74..78
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 745..749
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/security_group_panel.js on lines 165..169
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/sshkeypair_panel.js on lines 111..115
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/storage_node_panel.js on lines 76..80
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/volume_panel.js on lines 375..379

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

  DcmgrGUI.List.prototype.getEmptyData = function(){
    return [{
      "id":'',
      "wmi_id":'',
      "source":'',
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 10..19
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/storage_node_panel.js on lines 11..20

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

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

  var bt_delete_backup_image = new DcmgrGUI.Dialog({
    target:'.delete_backup_image',
    width:400,
    height:250,
    title:$.i18n.prop('delete_backup_image_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 181..188
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 508..515
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 523..530
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 589..596
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 604..611
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 306..313
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 569..576
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 593..600
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/security_group_panel.js on lines 223..230
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/sshkeypair_panel.js on lines 203..210
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/volume_panel.js on lines 223..230
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/volume_panel.js on lines 333..340

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

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

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

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

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

Refactorings

Further Reading

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

      $(this).find('#monitor_item_list input[type=text]').live('keyup paste cut',
                                                               {'name': 'monitoring', 'is_ready': is_ready, 'ready': ready},
                                                               DcmgrGUI.Util.checkTextField);
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js and 1 other location - About 50 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 216..218

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

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

      $(this).find('.mailaddr_form').bind('keyup paste cut',
                                          {'name': 'monitoring', 'is_ready': is_ready, 'ready': ready},
                                          DcmgrGUI.Util.checkTextField);
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js and 1 other location - About 50 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 212..214

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

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

There are no issues that match your filters.

Category
Status