axsh/wakame-vdc

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

Summary

Maintainability
F
5 days
Test Coverage

Function groupsPanel has 252 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

File groups_panel.js has 254 lines of code (exceeds 250 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.groupsPanel = function(){
  // Core.jsのクラス利用の初期設定
  var total = 0;
  var maxrow = 10;
  var page = 1;
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js - About 2 hrs 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('/groups/list/', c_list.page);
    list_request.data = DcmgrGUI.Util.getPagenateData(c_pagenate.start,c_pagenate.row);
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 198..214

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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_group_buttons[delete_button_name] = function() { 
    var group_id = $(this).find('#group_id').val();
    var request = new DcmgrGUI.Request;
    request.post({
      "url": '/groups/'+ group_id +'.json',
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 316..329

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

    $(self).find('#sel_link').each(function(key,value) {
        if ($(this).is(':checked')) {
            data = data + '&sel_user_uuid['+ i  +']=' + $(this).val();
            i += 1;
        }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_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

            'group_name' : {
            required: $.i18n.prop('validate_errmsg_required',[$.i18n.prop('item_group_name')]),
                        AN: $.i18n.prop('validate_errmsg_AN'),
            maxlength: $.validator.format($.i18n.prop('validate_errmsg_maxlength'))
            },
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
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 288..292

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": '/groups/link_group_users/' + group_uuid + '.json',
          "data": data,
          success: function(json,status) {
       bt_refresh.element.trigger('dcmgrGUI.refresh');
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 75..82

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/users_panel.js on lines 217..221

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_group = new DcmgrGUI.Dialog({
    target: '.delete_group',
    width: 600,
    height: 300,
    title: $.i18n.prop('delete_group_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/users_panel.js on lines 88..95
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 5 locations. Consider refactoring.
Open

    var bt_link_user = new DcmgrGUI.Dialog({
    target:'.link_user',
    width:500,
    height:500,
    title:$.i18n.prop('link_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 293..300
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 88..95
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 5 locations. Consider refactoring.
Open

    var bt_edit_group = new DcmgrGUI.Dialog({
    target:'.edit_group',
    width:600,
    height:300,
    title:$.i18n.prop('edit_group_header'),
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
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

    if (uuid) {
        //* データセンタアカウントでなければ、編集ダイアログを起動
        if (uuid != '00000000') {
            bt_edit_group.open({"ids":[uuid]});
        }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 315..324

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

    if( id ){
    // データセンタアカウントでなければ、削除ダイアログを起動
    if (id != '00000000') {
          bt_delete_group.open({"ids":[id]});
    }
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js on lines 96..105

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_group.content.dialog("destroy");
                bt_create_group.content.remove();
            bt_refresh.element.trigger('dcmgrGUI.refresh');
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js on lines 251..256

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

  DcmgrGUI.Detail.prototype.getEmptyData = function(){
    return {
      "name" : "-",
      "created_at" : "-",
      "updated_at":''
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js and 1 other location - About 35 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_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('/groups/list/',page),
    "data" : DcmgrGUI.Util.getPagenateData(page,maxrow)
  };
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js and 1 other location - About 35 mins to fix
frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_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