ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

Function $httpBackend has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {
Severity: Major
Found in public/browse/lib/angular-mocks/angular-mocks.js - About 50 mins to fix

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

    lunr.TokenStore.prototype.count = function (token, root) {
      return Object.keys(this.get(token, root)).length
    }
    Severity: Minor
    Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 50 mins to fix
    public/browse/lib/lunr.js/lib/token_store.js on lines 128..130

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

    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

      if (jQuery("#annotation_text").val().split(' ').length > 500) {
        jQuery("#annotator_error").html("Please use less than 500 words. If you need to annotate larger pieces of text you can use the <a href='http://www.bioontology.org/wiki/index.php/Annotator_User_Guide' target='_blank'>Annotator Web Service</a>");
        return;
      }
    Severity: Minor
    Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 50 mins to fix
    app/assets/javascripts/bp_annotatorplus.js on lines 53..56

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

    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

      if (jQuery("#annotation_text").val().split(' ').length > 500) {
        jQuery("#annotator_error").html("Please use less than 500 words. If you need to annotate larger pieces of text you can use the <a href='http://www.bioontology.org/wiki/index.php/Annotator_User_Guide' target='_blank'>Annotator Web Service</a>");
        return;
      }
    Severity: Minor
    Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 50 mins to fix
    app/assets/javascripts/bp_annotator.js on lines 49..52

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

    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

    lunr.TokenStore.prototype.count = function (token, root) {
      return Object.keys(this.get(token, root)).length
    }
    Severity: Minor
    Found in public/browse/lib/lunr.js/lib/token_store.js and 1 other location - About 50 mins to fix
    public/browse/lib/lunr.js/lunr.js on lines 1788..1790

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

    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

      jQuery("[name='mappings']:checked").each(function() {
        mappings.push(jQuery(this).val());
      });
    Severity: Minor
    Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 50 mins to fix
    app/assets/javascripts/bp_annotator.js on lines 87..89

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 51.

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

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

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

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

    Refactorings

    Further Reading

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

      jQuery("[name='mappings']:checked").each(function() {
        mappings.push(jQuery(this).val());
      });
    Severity: Minor
    Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 50 mins to fix
    app/assets/javascripts/bp_annotatorplus.js on lines 120..122

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 51.

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

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

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

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

    Refactorings

    Further Reading

    Avoid deeply nested control flow statements.
    Open

                    if (matchSubset(x0, q)) {
                      csub[csub.length] = x;
                    }

      Avoid deeply nested control flow statements.
      Open

                if (value != null) buffer += value;
      Severity: Major
      Found in public/browse/lib/lunr.js/example/mustache.js - About 45 mins to fix

        Function display_annotations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function display_annotations(data, params) {
          "use strict";
          var annotations = data.annotations;
          var all_rows = [];
          if (params.raw !== undefined && params.raw === true) {
        Severity: Minor
        Found in app/assets/javascripts/bp_annotator.js - About 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                        if (angular.isDefined(templateUrl)) {
                          nextRoute.loadedTemplateUrl = templateUrl;
                          template = $templateRequest(templateUrl);
                        }
        Severity: Major
        Found in public/browse/lib/angular-route/angular-route.js - About 45 mins to fix

          Function update_annotations_table has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function update_annotations_table(rowsArray) {
            "use strict";
            var ontologies = {},
              classes = {},
              match_types = {},
          Severity: Minor
          Found in app/assets/javascripts/bp_annotator.js - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                    if (typeof originalTemplate !== 'string') {
                      throw new Error('Cannot use higher-order sections without the original template');
                    }
          Severity: Major
          Found in public/browse/lib/lunr.js/example/mustache.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (xpcIsWindows) {
                            url = url.replace(/\//g, '\\');
                        }
            Severity: Major
            Found in public/browse/lib/lunr.js/example/text.js - About 45 mins to fix

              Function animate has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      animate: function(element, className, from, to, animationCompleted, options) {
              Severity: Minor
              Found in public/browse/lib/angular-animate/angular-animate.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                if (matchSubset(x0, q)) {
                                  csub[csub.length] = x;
                                }
                Severity: Major
                Found in public/javascripts/bp_crossdomain_autocomplete.js - About 45 mins to fix

                  Function bpMinVersion has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function bpMinVersion(min, actual) {
                    function parseVersionString (str) {
                      if (typeof(str) != 'string') { return false; }
                      var x = str.split('.');
                      var maj = parseInt(x[0]) || 0;
                  Severity: Minor
                  Found in public/javascripts/widgets/quick_jump.js - About 45 mins 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

                  Avoid deeply nested control flow statements.
                  Open

                                      if (headers.hasOwnProperty(header)) {
                                          xhr.setRequestHeader(header.toLowerCase(), headers[header]);
                                      }
                  Severity: Major
                  Found in public/browse/lib/lunr.js/example/text.js - About 45 mins to fix

                    Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    lunr.Pipeline.prototype.run = function (tokens) {
                      var out = [],
                          tokenLength = tokens.length,
                          stackLength = this._stack.length
                    
                    
                    Severity: Minor
                    Found in public/browse/lib/lunr.js/lib/pipeline.js - About 45 mins 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

                    Avoid deeply nested control flow statements.
                    Open

                                    if (angular.isFunction(templateUrl)) {
                                      templateUrl = templateUrl(nextRoute.params);
                                    }
                    Severity: Major
                    Found in public/browse/lib/angular-route/angular-route.js - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language