ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

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

    if (document.getElementById(jQuery(this).attr('name') + "_bioportal_full_id") == null)
      html += "<input type='hidden' id='" + jQuery(this).attr('name') + "_bioportal_full_id'>";
Severity: Major
Found in public/javascripts/widgets/form_complete.js and 7 other locations - About 1 hr to fix
app/assets/javascripts/bp_form_complete.js on lines 175..176
app/assets/javascripts/bp_form_complete.js on lines 177..178
app/assets/javascripts/bp_form_complete.js on lines 179..180
app/assets/javascripts/bp_form_complete.js on lines 181..182
public/javascripts/widgets/form_complete.js on lines 312..313
public/javascripts/widgets/form_complete.js on lines 314..315
public/javascripts/widgets/form_complete.js on lines 318..319

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

    if (document.getElementById(jQuery(this).attr('name') + "_bioportal_full_id") == null)
      html += "<input type='hidden' id='" + jQuery(this).attr('name') + "_bioportal_full_id'>";
Severity: Major
Found in app/assets/javascripts/bp_form_complete.js and 7 other locations - About 1 hr to fix
app/assets/javascripts/bp_form_complete.js on lines 175..176
app/assets/javascripts/bp_form_complete.js on lines 177..178
app/assets/javascripts/bp_form_complete.js on lines 181..182
public/javascripts/widgets/form_complete.js on lines 312..313
public/javascripts/widgets/form_complete.js on lines 314..315
public/javascripts/widgets/form_complete.js on lines 316..317
public/javascripts/widgets/form_complete.js on lines 318..319

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

    if (document.getElementById(jQuery(this).attr('name') + "_bioportal_preferred_name") == null)
      html += "<input type='hidden' id='" + jQuery(this).attr('name') + "_bioportal_preferred_name'>";
Severity: Major
Found in public/javascripts/widgets/form_complete.js and 7 other locations - About 1 hr to fix
app/assets/javascripts/bp_form_complete.js on lines 175..176
app/assets/javascripts/bp_form_complete.js on lines 177..178
app/assets/javascripts/bp_form_complete.js on lines 179..180
app/assets/javascripts/bp_form_complete.js on lines 181..182
public/javascripts/widgets/form_complete.js on lines 312..313
public/javascripts/widgets/form_complete.js on lines 314..315
public/javascripts/widgets/form_complete.js on lines 316..317

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

    if (document.getElementById(jQuery(this).attr('name') + "_bioportal_preferred_name") == null)
      html += "<input type='hidden' id='" + jQuery(this).attr('name') + "_bioportal_preferred_name'>";
Severity: Major
Found in app/assets/javascripts/bp_form_complete.js and 7 other locations - About 1 hr to fix
app/assets/javascripts/bp_form_complete.js on lines 175..176
app/assets/javascripts/bp_form_complete.js on lines 177..178
app/assets/javascripts/bp_form_complete.js on lines 179..180
public/javascripts/widgets/form_complete.js on lines 312..313
public/javascripts/widgets/form_complete.js on lines 314..315
public/javascripts/widgets/form_complete.js on lines 316..317
public/javascripts/widgets/form_complete.js on lines 318..319

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

    if (document.getElementById(jQuery(this).attr('name') + "_bioportal_ontology_id") == null)
      html += "<input type='hidden' id='" + jQuery(this).attr('name') + "_bioportal_ontology_id'>";
Severity: Major
Found in public/javascripts/widgets/form_complete.js and 7 other locations - About 1 hr to fix
app/assets/javascripts/bp_form_complete.js on lines 175..176
app/assets/javascripts/bp_form_complete.js on lines 177..178
app/assets/javascripts/bp_form_complete.js on lines 179..180
app/assets/javascripts/bp_form_complete.js on lines 181..182
public/javascripts/widgets/form_complete.js on lines 312..313
public/javascripts/widgets/form_complete.js on lines 316..317
public/javascripts/widgets/form_complete.js on lines 318..319

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

    if (document.getElementById(jQuery(this).attr('name') + "_bioportal_ontology_id") == null)
      html += "<input type='hidden' id='" + jQuery(this).attr('name') + "_bioportal_ontology_id'>";
Severity: Major
Found in app/assets/javascripts/bp_form_complete.js and 7 other locations - About 1 hr to fix
app/assets/javascripts/bp_form_complete.js on lines 175..176
app/assets/javascripts/bp_form_complete.js on lines 179..180
app/assets/javascripts/bp_form_complete.js on lines 181..182
public/javascripts/widgets/form_complete.js on lines 312..313
public/javascripts/widgets/form_complete.js on lines 314..315
public/javascripts/widgets/form_complete.js on lines 316..317
public/javascripts/widgets/form_complete.js on lines 318..319

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

  def simplify_annotated_classes(annotations, class_details)
    annotations2delete = []
    annotations.each do |a|
      cls_id = a['annotatedClass']['@id']
      details = class_details[cls_id]
Severity: Major
Found in app/controllers/annotatorplus_controller.rb and 1 other location - About 1 hr to fix
app/controllers/annotator_controller.rb on lines 115..129

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

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

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

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

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

Refactorings

Further Reading

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

  def simplify_annotated_classes(annotations, class_details)
    annotations2delete = []
    annotations.each do |a|
      cls_id = a['annotatedClass']['@id']
      details = class_details[cls_id]
Severity: Major
Found in app/controllers/annotator_controller.rb and 1 other location - About 1 hr to fix
app/controllers/annotatorplus_controller.rb on lines 140..154

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

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

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

        load: function (name, req, onLoad, config) {
            //Name has format: some.module.filext!strip
            //The strip part is optional.
            //if strip is present, then that means only get the string contents
            //inside a body tag in an HTML string. For XML/SVG content it means
Severity: Minor
Found in public/browse/lib/lunr.js/example/text.js - About 1 hr to fix

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

            text.get = function (url, callback, errback, headers) {
                var xhr = text.createXhr(), header;
                xhr.open('GET', url, true);
    
                //Allow plugins direct access to xhr headers
    Severity: Minor
    Found in public/browse/lib/lunr.js/example/text.js - About 1 hr to fix

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

            function dataToDom(data) {
              var ul = document.createElement("ul");
              var num = data.length;
      
              // limited results to a max number
      Severity: Minor
      Found in public/javascripts/bp_crossdomain_autocomplete.js - About 1 hr to fix

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

              function dataToDom(data) {
                var ul = document.createElement("ul");
                var num = data.length;
        
                // limited results to a max number

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

                function animationsDisabled(element, parentElement) {
                  if (rootAnimateState.disabled) {
                    return true;
                  }
          
          
          Severity: Minor
          Found in public/browse/lib/angular-animate/angular-animate.js - About 1 hr to fix

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

            function saveNewTermInstructions() {
              var params = jQuery('#new_term_instructions_form').serialize();
              var newInstructions = jQuery('#new_term_instructions').html().trim();
              params += '&new_term_instructions=' + newInstructions;
              var parentContainerID = 'new_term_instructions_container';
            Severity: Minor
            Found in app/assets/javascripts/bp_ontolobridge.js - About 1 hr to fix

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

              function bindReplySaveClick() {
                jQuery(".reply .save, .create_note_form .save").live('click', function(){
                  var user = getUser();
                  var id = jQuery(this).data("parent_id");
                  var type = jQuery(this).data("parent_type");
              Severity: Minor
              Found in app/assets/javascripts/bp_notes.js - About 1 hr to fix

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

                    this.formatNodes = function(nodes) {
                      var holder = $("<span>");
                      var ul = $("<ul>");
                
                      // Sort by prefLabel
                Severity: Minor
                Found in app/assets/javascripts/bp_property_tree.js - About 1 hr to fix

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

                        function dataToDom(data) {
                          var ul = document.createElement("ul");
                          var num = data.length;
                  
                          // limited results to a max number
                  Severity: Minor
                  Found in app/assets/javascripts/bp_crossdomain_autocomplete.js - About 1 hr to fix

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

                    function toggle_advanced_options() {
                      $("#advanced-options-container").toggle();
                      var text = $("#advanced-options-container").is(':visible') ? "Hide advanced options <<" : "Show advanced options >>";
                      $("#advancedOptionsLink").text(text);
                    }
                    Severity: Major
                    Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/bp_recommender.js on lines 5..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 58.

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

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

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

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

                    Refactorings

                    Further Reading

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

                    rec.showOrHideAdvancedOptions = function() {
                      $("#advancedOptions").toggle();
                      var text = $("#advancedOptions").is(':visible') ? "Hide advanced options <<" : "Show advanced options >>";
                      $("#advancedOptionsLink").text(text);
                    }
                    Severity: Major
                    Found in app/assets/javascripts/bp_recommender.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/bp_annotatorplus.js on lines 881..885

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 58.

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

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

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

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

                    Refactorings

                    Further Reading

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

                    function populateOntologyRows(data) {
                      var ontologies = data.ontologies;
                      var allRows = [];
                      var hideFields = ["format", "administeredBy", "date_created", "report_date_updated", "errErrorStatus", "errMissingStatus", "problem", "logFilePath"];
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/bp_admin.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language