axsh/wakame-vdc

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

Summary

Maintainability
F
1 wk
Test Coverage

Function instancePanel has 649 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

File instance_panel.js has 651 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

Function callback has 251 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      callback: function(){
        var self = this;

        $(this).find('#left_select_list').mask($.i18n.prop('loading_parts'));
        $(this).find('#right_select_list').mask($.i18n.prop('loading_parts'));
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 day to fix

Function instancePanel has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

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

    edit_instance_buttons[update_button_name] = function(event) {
      var self = this;
      var instance_id = $(this).find('#instance_id').val();
      var display_name = $(this).find('#instance_display_name').val();

Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 hr to fix

Function select has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    select: function(event){
      var select_action = $(this).val();
      var selected_ids = c_list.currentMultiChecked();
      var ids = selected_ids['ids'];
      var is_open_poweroff = true;
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 hr to fix

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

          security_groups:function(){
            var selected_groups = []
            if (instance.vif.length > 0) {
              selected_groups = instance.vif[0]['security_groups'];
            }
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 hr to fix

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

  actions.changeButtonState = function() {
    var ids = c_list.currentMultiChecked()['ids'];
    var is_select_menus = [];
    var is_instance_backups = [];

Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 hr to fix

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

        var ready = function(data) {
          _.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)];
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 hr to fix

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

        ssh_keypairs: function(){

          request.get({
            "url": '/keypairs/all.json',
            "data": "",
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 hr 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/image_panel.js on lines 219..239

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

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") ){
                                                       $(self).find(id).removeAttr("disabled");
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 262..272

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

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

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/image_panel.js on lines 322..327

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

  DcmgrGUI.Detail.prototype.getEmptyData = function(){
    return {
      "instance_id":'-',
      "wmi_id":'-',
      "zone":'-',
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 21..31
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/host_node_panel.js on lines 21..31

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

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

  var bt_instance_stop = new DcmgrGUI.Dialog({
     target:'.stop_instances',
     width:400,
     height:200,
     title: $.i18n.prop('stop_instances_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 476..483

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

  var bt_instance_start = new DcmgrGUI.Dialog({
    target:'.start_instances',
    width:400,
    height:200,
    title:$.i18n.prop('start_instances_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 489..496

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

  var bt_instance_poweroff = new DcmgrGUI.Dialog({
    target:'.poweroff_instances',
    width:400,
    height:200,
    title:$.i18n.prop('poweroff_instances_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 181..188
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 436..443
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 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

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

  var bt_instance_poweron = new DcmgrGUI.Dialog({
    target:'.poweron_instances',
    width:400,
    height:200,
    title:$.i18n.prop('poweron_instances_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 181..188
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 436..443
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/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

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

  var bt_instance_reboot = new DcmgrGUI.Dialog({
     target:'.reboot_instances',
     width:400,
     height:200,
     title:$.i18n.prop('reboot_instances_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 181..188
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 436..443
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

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

  var bt_instance_terminate = new DcmgrGUI.Dialog({
    target:'.terminate_instances',
    width:400,
    height:200,
    title:$.i18n.prop('terminate_instances_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js on lines 181..188
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 436..443
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 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

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

      var ready = function(data) {
        if(data['backup_display_name'] == true) {
          bt_instance_backup.disabledButton(1, false);
        } else {
          bt_instance_backup.disabledButton(1, true);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 352..358
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 472..478

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

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);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 273..275

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('#monitor_item_list input[type=text]').live('keyup paste cut',
                                                                 {'name': 'monitoring', 'is_ready': is_ready, 'ready': ready},
                                                                 DcmgrGUI.Util.checkTextField);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 277..279

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

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

  bt_instance_start.button[$.i18n.prop('close_button')]=function() { $(this).dialog("close"); };
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 497..497

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

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

  bt_instance_stop.button[$.i18n.prop('close_button')]=function() { $(this).dialog("close"); };
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 484..484

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

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