axsh/wakame-vdc

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

Summary

Maintainability
F
2 wks
Test Coverage

Function loadBalancerPanel has 722 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

File load_balancer_panel.js has 724 lines of code (exceeds 250 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.loadBalancerPanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {

Function loadBalancerPanel has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.loadBalancerPanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {

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

  var change_button_behavior = function(e, button) {
      var self = e;
      var is_ready = {
      'display_name':false,
      'load_balancer_port':false,

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

    callback: function(e) {
      var load_balancer_id = c_list.currentChecked();
      var self = this;

      function radioFormatter(cellvalue, options, rowObject) {

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

    callback: function(){

      var self = this;
      var load_balancer_id = c_list.currentChecked();

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

    callback: function(){

      var self = this;
      var load_balancer_id = c_list.currentChecked();

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

    select: function(event){
      var select_action = $(this).val()
      var selected_id = c_list.currentChecked();
      var row_id = '#row-'+selected_id;
      var state = $(row_id).find('.state').text();

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

    edit_load_balancer_buttons[update_button_name] = function(event) {
      var load_balancer_id = c_list.currentChecked();
      var display_name = $(this).find('#display_name').val();
      var description = $(this).find('#description').val();
      var load_balancer_protocol = $(this).find('#load_balancer_protocol').val();

Function create_button_name has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  create_load_balancer_buttons[create_button_name] = function() {
    var display_name = $(this).find('#display_name').val();
    var description = $(this).find('#description').val();
    var load_balancer_protocol = $(this).find('#load_balancer_protocol').val();
    var load_balancer_port = $(this).find('#load_balancer_port').val();

Function datatype has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        datatype: function(postdata) {
          var request = new DcmgrGUI.Request;
          request.get({
            "url": '/load_balancers/show/' + load_balancer_id + '.json',
            success: function(json,status) {

Consider simplifying this complex logical expression.
Open

      if(data['display_name'] == true &&
         data['load_balancer_port'] == true &&
         data['instance_port'] == true &&
         data['cookie_name'] == true &&
         data['private_key'] == true &&
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js - About 40 mins to fix

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

      parallel({
        load_balancer: request.get({
          "url": '/load_balancers/show/' + load_balancer_id + '.json',
          success: function(json, status) {
          }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 367..430

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

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

      parallel({
        load_balancer: request.get({
          "url": '/load_balancers/show/' + load_balancer_id + '.json',
           success: function(json, status) {
           }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 487..549

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

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

  register_load_balancer_buttons[register_button_name] = function() {
    var load_balancer_id = c_list.currentChecked();
    var register_instances  = $(this).find('#right_select_list').find('option');
    var vifs = [];

frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 437..459

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

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

  unregister_load_balancer_buttons[unregister_button_name] = function() {
    var load_balancer_id = c_list.currentChecked();
    var unregister_instances  = $(this).find('#right_select_list').find('option');
    var vifs = [];

frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 317..339

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

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_load_balancer_buttons[delete_button_name] = function() {
    var load_balancer_id = $(this).find('#load_balancer_id').val();
    var request = new DcmgrGUI.Request;
    request.del({
      "url": '/load_balancers/' + load_balancer_id + '.json',
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 424..434
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

  load_balancers_poweron_buttons[poweron_button_name] = function() {
    var load_balancer_id = c_list.currentChecked();
    var request = new DcmgrGUI.Request;
    request.put({
      "url": "/load_balancers/poweron/" + load_balancer_id,
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 580..591

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

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

  load_balancers_poweroff_buttons[poweroff_button_name] = function() {
    var load_balancer_id = c_list.currentChecked();
    var request = new DcmgrGUI.Request;
    request.put({
      "url": "/load_balancers/poweroff/" + load_balancer_id,
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 556..567

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

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['display_name'] == true &&
         data['load_balancer_port'] == true &&
         data['instance_port'] == true &&
         data['cookie_name'] == true &&
         data['private_key'] == true &&
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js on lines 248..257

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 data = "display_name="+encodeURIComponent(display_name)
               +"&description="+encodeURIComponent(description)
               +"&load_balancer_protocol="+load_balancer_protocol
               +"&load_balancer_port="+load_balancer_port
               +"&instance_protocol="+instance_protocol
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 183..192

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

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 data = "display_name="+encodeURIComponent(display_name)
                 +"&description="+encodeURIComponent(description)
                 +"&load_balancer_protocol="+load_balancer_protocol
                 +"&load_balancer_port="+load_balancer_port
                 +"&instance_protocol="+instance_protocol
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 256..265

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

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/image_panel.js on lines 135..139
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 13 locations. Consider refactoring.
Open

  var bt_delete_load_balancer = new DcmgrGUI.Dialog({
    target:'.delete_load_balancer',
    width:400,
    height:210,
    title:$.i18n.prop('delete_load_balancer_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/instance_panel.js on lines 604..611
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_poweron_instance = new DcmgrGUI.Dialog({
    target:'.poweron_load_balancer',
    width:400,
    height:200,
    title:$.i18n.prop('poweron_load_balancer_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/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 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_poweroff_load_balancer = new DcmgrGUI.Dialog({
    target:'.poweroff_load_balancer',
    width:400,
    height:200,
    title:$.i18n.prop('poweroff_load_balancer_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/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/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['vifs'] == true) {
          bt_unregister_load_balancer.disabledButton(1, false);
        } else {
          bt_unregister_load_balancer.disabledButton(1, true);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 566..572
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 352..358

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

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

      var ready = function(data) {
        if(data['vifs'] == true) {
          bt_register_load_balancer.disabledButton(1, false);
        } else {
          bt_register_load_balancer.disabledButton(1, true);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js on lines 566..572
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

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

          {name:'standby',align:'center',editable:true, editrules: {required:true}, edittype:'custom', formatter:radioFormatter, sortable:false,width:100},
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 714..714

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

          {name:'active',align:'center',editable:true, editrules: {required:true}, edittype:'custom', formatter:radioFormatter, sortable:false,width:100},
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/load_balancer_panel.js on lines 715..715

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

There are no issues that match your filters.

Category
Status