axsh/wakame-vdc

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

Summary

Maintainability
F
6 days
Test Coverage

Function usersPanel has 290 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.usersPanel = function(){
  // Core.jsのクラス利用の初期設定
  var total = 0;
  var maxrow = 10;
  var page = 1;
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js - About 1 day to fix

File users_panel.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.usersPanel = function(){
  // Core.jsのクラス利用の初期設定
  var total = 0;
  var maxrow = 10;
  var page = 1;
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js - About 3 hrs to fix

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

    callback: function(){
        // バリデーション定義
    var f = $('#fm');
    f.validate({
        errorClass : 'valid-error',
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js - About 1 hr to fix

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

    link_group_buttons[update_button_name] = function(event) {
    var self = this;
        var user_uuid = $(self).find('#user_uuid').val();
    var pr_group_uuid = "";
    $(self).find("[type='radio']").each(function() {
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js - About 1 hr to fix

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

  create_user_buttons[create_button_name] = function() { 
    // フォーム全部をバリデーション
    var f = $('#fm');
    var valid = f.validate().form();
    if(valid) { // バリデーション通過時
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js - About 1 hr to fix

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

  bt_refresh.element.bind('dcmgrGUI.refresh', function(){
    //Update list element
    c_list.page = c_pagenate.current_page;
    list_request.url = DcmgrGUI.Util.getPagePath('/users/list/', c_list.page);
    list_request.data = DcmgrGUI.Util.getPagenateData(c_pagenate.start,c_pagenate.row);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 167..183

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

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

  delete_user_buttons[delete_button_name] = function() { 
    var user_id = $(this).find('#user_id').val();
    
    var request = new DcmgrGUI.Request;
    request.post({
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 278..290

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

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

    bt_edit_user.target.bind('click',function(event){
    var uuid = $(this).attr('id').replace(/edit_([a-z0-9]+)/,'$1'); 
    if (uuid) {
        bt_edit_user.open({"ids":[uuid]});
    }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 154..160
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 184..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 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 3 locations. Consider refactoring.
Open

   bt_link_group.target.bind('click',function(event){
    var uuid = $(this).attr('id').replace(/link_([a-z0-9]+)/,'$1'); 
    if (uuid) {
        bt_link_group.open({"ids":[uuid]});
    }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 154..160
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 98..104

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

    $(self).find('#sel_link').each(function(key,value) {
        if ($(this).is(':checked')) {
            data = data + '&sel_group_uuid['+ i  +']=' + $(this).val();
            i += 1;
        }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 122..127

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

            'login_id' : {
            required: $.i18n.prop('validate_errmsg_required',[$.i18n.prop('item_login_id')]),
                        AN: $.i18n.prop('validate_errmsg_AN'),
            maxlength: $.validator.format($.i18n.prop('validate_errmsg_maxlength'))
            },
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 253..257
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 92..96
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 97..101
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 102..106
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 224..228
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 229..233
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 421..425
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 426..430
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 674..678
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 679..683
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 684..688
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 1091..1095
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 1096..1100
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 1276..1280

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

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

    request.post({
      "url": '/users/edit_user/' + uuid + '.json',
          "data": data,
          success: function(json,status) {
       bt_refresh.element.trigger('dcmgrGUI.refresh');
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 131..138

Duplicated Code

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

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

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

Tuning

This issue has a mass of 67.

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

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

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

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

Refactorings

Further Reading

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

  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/groups_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 65.

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

  var bt_delete_user = new DcmgrGUI.Dialog({
    target: '.delete_user',
    width: 600,
    height: 300,
    title: $.i18n.prop('delete_user_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 84..91
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 144..151
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 293..300
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 88..95

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

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

    var bt_edit_user = new DcmgrGUI.Dialog({
    target:'.edit_user',
    width:600,
    height:240,
    title:$.i18n.prop('edit_user_header'),
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 84..91
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 144..151
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 293..300
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 332..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 62.

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

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

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

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

Refactorings

Further Reading

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

            success: function(json,status) {
                // ダイアログを削除
                bt_create_user.content.dialog("destroy");
                bt_create_user.content.remove();
            bt_refresh.element.trigger('dcmgrGUI.refresh');
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 220..225

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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

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

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

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

Refactorings

Further Reading

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

                    sel_links.each(function() {
                        if($(this).val() == radio_val) {
                            $(this).attr('checked',true);
                        }
                    });
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js and 1 other location - About 55 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 173..177

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

                radios.each(function() {
                    if($(this).val() == sel_value) {
                        $(this).attr('checked',false);
                    }
                });
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js and 1 other location - About 55 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 159..163

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

        var data ='login_id=' + login_id 
          +'&password=' + password
                  +'&name='  + name 
                  +'&primary_account_id=' + primary_account_id
                  +'&locale=' + locale
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js and 1 other location - About 50 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/resource_manage_panel.js on lines 606..611

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

  DcmgrGUI.Detail.prototype.getEmptyData = function(){
    return {
      "login_id" : "-",
      "create_at" : "-",
      "last_update_at":''
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js and 1 other location - About 35 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 19..25

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

  var list_request = { 
    "url" : DcmgrGUI.Util.getPagePath('/users/list/',page),
    "data" : DcmgrGUI.Util.getPagenateData(page,maxrow)
  };
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js and 1 other location - About 35 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 6..9

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

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