archivesspace/archivesspace

View on GitHub
frontend/app/assets/javascripts/top_containers.bulk.js

Summary

Maintainability
F
2 wks
Test Coverage

File top_containers.bulk.js has 738 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//= require tablesorter/jquery.tablesorter.min

/***************************************************************************
 * BulkContainerSearch - provides all the behaviour to the ajax search
 * and selection of records.
Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 1 day to fix

    Function setup_table_sorter has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    BulkContainerSearch.prototype.setup_table_sorter = function () {
      function padNumber(number) {
        // Get rid of preceding zeros from numbers (so 003 will sort with 3 instead of in the hundreds)
        // Then pad it (so 10 doesn't sort between 1 and 2)
        number = parseInt(number).toString();
    Severity: Minor
    Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function setup_table_sorter has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    BulkContainerSearch.prototype.setup_table_sorter = function () {
      function padNumber(number) {
        // Get rid of preceding zeros from numbers (so 003 will sort with 3 instead of in the hundreds)
        // Then pad it (so 10 doesn't sort between 1 and 2)
        number = parseInt(number).toString();
    Severity: Major
    Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 3 hrs to fix

      Function BulkActionMerge has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function BulkActionMerge(bulkContainerSearch) {
        var self = this;
      
        self.bulkContainerSearch = bulkContainerSearch;
      
      
      Severity: Major
      Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 3 hrs to fix

        Function parseIndicator has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function parseIndicator(value) {
            // Creates a string of alternating number/non-number values separated by commas for indicator sort
            if (!value || value.length === 0) {
              return value;
            }
        Severity: Minor
        Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 1 hr to fix

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

          BulkContainerSearch.prototype.setup_results_list = function (docs) {
            var self = this;
          
            self.$results_container.on('click', '#select_all', function (event) {
              var $checkbox = $(this);
          Severity: Minor
          Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 1 hr to fix

            Function setup_update_form has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            BulkActionMultipleLocationUpdate.prototype.setup_update_form = function (
              $modal
            ) {
              var self = this;
            
            
            Severity: Minor
            Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 1 hr to fix

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

              BulkActionIndicatorRapidEntry.prototype.setup_form_submission = function (
                $modal
              ) {
                var self = this;
                var $form = $modal.find('form');
              Severity: Minor
              Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 1 hr to fix

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

                BulkActionBarcodeRapidEntry.prototype.setup_form_submission = function (
                  $modal
                ) {
                  var self = this;
                  var $form = $modal.find('form');
                Severity: Minor
                Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 1 hr to fix

                  Avoid too many return statements within this function.
                  Open

                        return $node.text().trim();
                  Severity: Major
                  Found in frontend/app/assets/javascripts/top_containers.bulk.js - About 30 mins to fix

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

                    BulkActionBarcodeRapidEntry.prototype.setup_form_submission = function (
                      $modal
                    ) {
                      var self = this;
                      var $form = $modal.find('form');
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 1 day to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 752..782

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

                    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

                    BulkActionIndicatorRapidEntry.prototype.setup_form_submission = function (
                      $modal
                    ) {
                      var self = this;
                      var $form = $modal.find('form');
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 1 day to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 657..687

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

                    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

                    BulkActionBarcodeRapidEntry.prototype.setup_keyboard_handling = function (
                      $modal
                    ) {
                      $modal.find('table :input:visible:first').focus().select();
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 7 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 728..750

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

                    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

                    BulkActionIndicatorRapidEntry.prototype.setup_keyboard_handling = function (
                      $modal
                    ) {
                      $modal.find('table :input:visible:first').focus().select();
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 7 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 633..655

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

                    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

                    BulkActionIlsHoldingUpdate.prototype.perform_update = function ($form, $modal) {
                      var self = this;
                    
                      $.ajax({
                        url: AS.app_prefix('top_containers/bulk_operations/update'),
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 2 other locations - About 6 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 400..421
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 475..493

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

                    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

                    BulkActionContainerProfileUpdate.prototype.perform_update = function (
                      $form,
                      $modal
                    ) {
                      var self = this;
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 2 other locations - About 6 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 329..347
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 475..493

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

                    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

                    BulkActionLocationUpdate.prototype.perform_update = function ($form, $modal) {
                      var self = this;
                    
                      $.ajax({
                        url: AS.app_prefix('top_containers/bulk_operations/update'),
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 2 other locations - About 6 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 329..347
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 400..421

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

                    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

                    BulkActionBarcodeRapidEntry.prototype.show = function () {
                      var dialog_content = AS.renderTemplate(this.TEMPLATE_DIALOG_ID, {
                        selection: this.bulkContainerSearch.get_selection(),
                      });
                      var $modal = AS.openCustomModal(
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 713..726

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

                    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

                    BulkActionIndicatorRapidEntry.prototype.show = function () {
                      var dialog_content = AS.renderTemplate(this.TEMPLATE_DIALOG_ID, {
                        selection: this.bulkContainerSearch.get_selection(),
                      });
                      var $modal = AS.openCustomModal(
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 618..631

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

                    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

                    BulkActionContainerProfileUpdate.prototype.setup_update_form = function (
                      $modal
                    ) {
                      var self = this;
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 462..473

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

                    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

                    BulkActionLocationUpdate.prototype.setup_update_form = function ($modal) {
                      var self = this;
                    
                      var $form = $modal.find('form');
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 385..398

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

                    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

                    BulkActionLocationUpdate.prototype.show = function () {
                      var dialog_content = AS.renderTemplate('bulk_action_update_location', {
                        selection: this.bulkContainerSearch.get_selection(),
                      });
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 359..372
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 433..449
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 576..592

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

                    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

                    BulkActionContainerProfileUpdate.prototype.show = function () {
                      var dialog_content = AS.renderTemplate(
                        'bulk_action_update_container_profile',
                        {
                          selection: this.bulkContainerSearch.get_selection(),
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 359..372
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 505..518
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 576..592

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

                    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

                    BulkActionIlsHoldingUpdate.prototype.show = function () {
                      var dialog_content = AS.renderTemplate('bulk_action_update_ils_holding', {
                        selection: this.bulkContainerSearch.get_selection(),
                      });
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 433..449
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 505..518
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 576..592

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

                    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

                    BulkActionMultipleLocationUpdate.prototype.show = function () {
                      var dialog_content = AS.renderTemplate(
                        'bulk_action_update_location_multiple',
                        {
                          selection: this.bulkContainerSearch.get_selection(),
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 359..372
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 433..449
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 505..518

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

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

                    BulkActionContainerProfileUpdate.prototype.setup_menu_item = function () {
                      var self = this;
                    
                      self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

                    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

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

                    BulkActionLocationUpdate.prototype.setup_menu_item = function () {
                      var self = this;
                    
                      self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

                    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

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

                    BulkActionBarcodeRapidEntry.prototype.setup_menu_item = function () {
                      var self = this;
                    
                      self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

                    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

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

                    BulkActionIndicatorRapidEntry.prototype.setup_menu_item = function () {
                      var self = this;
                    
                      self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616

                    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

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

                    BulkActionIlsHoldingUpdate.prototype.setup_menu_item = function () {
                      var self = this;
                    
                      self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

                    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

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

                    BulkActionMultipleLocationUpdate.prototype.setup_menu_item = function () {
                      var self = this;
                    
                      self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);
                    
                    
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

                    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

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

                      self.$results_container.on('click', '#select_all', function (event) {
                        var $checkbox = $(this);
                        if ($checkbox.is(':checked')) {
                          $('tbody :checkbox:not(:checked)', self.$results_container).trigger(
                            'click'
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 2 hrs to fix
                    frontend/app/assets/javascripts/search.js on lines 33..40

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

                    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

                    function activateBtn(event) {
                      var merge_btn = document.getElementsByClassName('merge-button')[0];
                      if ($('input:checked').length > 0) {
                        merge_btn.removeAttribute('disabled');
                      } else {
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 1 hr to fix
                    frontend/app/assets/javascripts/browse_merge.js on lines 17..24

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

                    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

                          const victimsNoTarget = victims.reduce(function (acc, victim) {
                            if (victim.display_string !== target.display_string) {
                              acc.push(victim.display_string);
                            }
                            return acc;
                    Severity: Major
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 1 hr to fix
                    frontend/app/assets/javascripts/browse_merge.js on lines 56..61

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 60.

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

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

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

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

                    Refactorings

                    Further Reading

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

                    function BulkActionIndicatorRapidEntry(bulkContainerSearch) {
                      this.TEMPLATE_DIALOG_ID = 'template_bulk_indicator_action_dialog';
                      this.MENU_ID = 'showBulkActionRapidIndicatorEntry';
                    
                      this.bulkContainerSearch = bulkContainerSearch;
                    Severity: Minor
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 55 mins to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 599..606

                    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

                    function BulkActionBarcodeRapidEntry(bulkContainerSearch) {
                      this.TEMPLATE_DIALOG_ID = 'template_bulk_barcode_action_dialog';
                      this.MENU_ID = 'showBulkActionRapidBarcodeEntry';
                    
                      this.bulkContainerSearch = bulkContainerSearch;
                    Severity: Minor
                    Found in frontend/app/assets/javascripts/top_containers.bulk.js and 1 other location - About 55 mins to fix
                    frontend/app/assets/javascripts/top_containers.bulk.js on lines 694..701

                    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

                    There are no issues that match your filters.

                    Category
                    Status