ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

File bp_annotator.js has 633 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var
  bp_last_params = null,
  annotationsTable = null,
  annotator_ontologies = null;

Severity: Major
Found in app/assets/javascripts/bp_annotator.js - About 1 day to fix

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

        this.jumpToClass = function(cls, callback) {
          ROOT.html($("<span>").html("Loading...").css("font-size", "smaller"));
          $.ajax({
            url: determineHTTPS(OPTIONS.ncboAPIURL) + "/ontologies/" + OPTIONS.ontology + "/classes/" + encodeURIComponent(cls) + "/tree",
            data: {apikey: OPTIONS.apikey, include: "prefLabel,childrenCount", no_context: true},
    Severity: Major
    Found in public/widgets/jquery.ncbo.tree-2.0.0.js and 2 other locations - About 1 day to fix
    public/widgets/jquery.ncbo.tree-2.0.1.js on lines 77..100
    public/widgets/jquery.ncbo.tree-2.0.2.js on lines 77..100

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

    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

        this.jumpToClass = function(cls, callback) {
          ROOT.html($("<span>").html("Loading...").css("font-size", "smaller"));
          $.ajax({
            url: determineHTTPS(OPTIONS.ncboAPIURL) + "/ontologies/" + OPTIONS.ontology + "/classes/" + encodeURIComponent(cls) + "/tree",
            data: {apikey: OPTIONS.apikey, include: "prefLabel,hasChildren", no_context: true},
    Severity: Major
    Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 day to fix
    public/widgets/jquery.ncbo.tree-2.0.0.js on lines 77..100
    public/widgets/jquery.ncbo.tree-2.0.2.js on lines 77..100

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

    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

        this.jumpToClass = function(cls, callback) {
          ROOT.html($("<span>").html("Loading...").css("font-size", "smaller"));
          $.ajax({
            url: determineHTTPS(OPTIONS.ncboAPIURL) + "/ontologies/" + OPTIONS.ontology + "/classes/" + encodeURIComponent(cls) + "/tree",
            data: {apikey: OPTIONS.apikey, display: "prefLabel,hasChildren", no_context: true},
    Severity: Major
    Found in public/widgets/jquery.ncbo.tree-2.0.2.js and 2 other locations - About 1 day to fix
    public/widgets/jquery.ncbo.tree-2.0.0.js on lines 77..100
    public/widgets/jquery.ncbo.tree-2.0.1.js on lines 77..100

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

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

    function truncateText(text, max_length) {
      if (typeof max_length === 'undefined' || max_length == "") {
        max_length = 70;
      }
    
    
    Severity: Major
    Found in app/assets/javascripts/bp_form_complete.js and 2 other locations - About 1 day to fix
    public/javascripts/widgets/form_complete.js on lines 364..392
    public/javascripts/widgets/quick_jump.js on lines 300..320

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

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

    function truncateText(text, max_length) {
        if (typeof max_length === 'undefined' || max_length == "") {
            max_length = 70;
        }
        var more = '...';
    Severity: Major
    Found in public/javascripts/widgets/quick_jump.js and 2 other locations - About 1 day to fix
    app/assets/javascripts/bp_form_complete.js on lines 211..239
    public/javascripts/widgets/form_complete.js on lines 364..392

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

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

    function truncateText(text, max_length) {
      if (typeof max_length === 'undefined' || max_length == "") {
        max_length = 70;
      }
    
    
    Severity: Major
    Found in public/javascripts/widgets/form_complete.js and 2 other locations - About 1 day to fix
    app/assets/javascripts/bp_form_complete.js on lines 211..239
    public/javascripts/widgets/quick_jump.js on lines 300..320

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

    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 NCBOAutocomplete has 268 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      $.fn.NCBOAutocomplete = function(settings) {
        var defaults = {
            url: '',
            data: [],
            minCharacters: 1,
    Severity: Major
    Found in public/widgets/jquery.ncbo.autocomplete.js - About 1 day to fix

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

      lunr.tokenizer = function (obj) {
        if (!arguments.length || obj == null || obj == undefined) return []
        if (Array.isArray(obj)) return obj.map(function (t) { return t.toLowerCase() })
      
        var str = obj.toString().replace(/^\s+/, '')
      Severity: Major
      Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 1 day to fix
      public/browse/lib/lunr.js/lib/tokenizer.js on lines 14..35

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

      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.tokenizer = function (obj) {
        if (!arguments.length || obj == null || obj == undefined) return []
        if (Array.isArray(obj)) return obj.map(function (t) { return t.toLowerCase() })
      
        var str = obj.toString().replace(/^\s+/, '')
      Severity: Major
      Found in public/browse/lib/lunr.js/lib/tokenizer.js and 1 other location - About 1 day to fix
      public/browse/lib/lunr.js/lunr.js on lines 179..200

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

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

          var initAutocomplete = function() {
            // Add the autocomplete
            var autocompleteContainer = $("<div>").addClass(OPTIONS.autocompleteClass).addClass("ncboTree");
            var input = $("<input>")
              .addClass(OPTIONS.autocompleteClass)
      Severity: Major
      Found in public/widgets/jquery.ncbo.tree-2.0.0.js and 2 other locations - About 1 day to fix
      public/widgets/jquery.ncbo.tree-2.0.1.js on lines 327..354
      public/widgets/jquery.ncbo.tree-2.0.2.js on lines 327..354

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

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

          var initAutocomplete = function() {
            // Add the autocomplete
            var autocompleteContainer = $("<div>").addClass(OPTIONS.autocompleteClass).addClass("ncboTree");
            var input = $("<input>")
              .addClass(OPTIONS.autocompleteClass)
      Severity: Major
      Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 day to fix
      public/widgets/jquery.ncbo.tree-2.0.0.js on lines 327..354
      public/widgets/jquery.ncbo.tree-2.0.2.js on lines 327..354

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

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

          var initAutocomplete = function() {
            // Add the autocomplete
            var autocompleteContainer = $("<div>").addClass(OPTIONS.autocompleteClass).addClass("ncboTree");
            var input = $("<input>")
              .addClass(OPTIONS.autocompleteClass)
      Severity: Major
      Found in public/widgets/jquery.ncbo.tree-2.0.2.js and 2 other locations - About 1 day to fix
      public/widgets/jquery.ncbo.tree-2.0.0.js on lines 327..354
      public/widgets/jquery.ncbo.tree-2.0.1.js on lines 327..354

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

      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 app has 251 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      .controller('OntologyList', ['$scope', '$animate', '$timeout', function($scope, $animate, $timeout) {
        // Default values
        $scope.visible_ont_count = 0;
        $scope.ontology_sort_order = "-popularity";
        $scope.previous_sort_order = "-popularity";
      Severity: Major
      Found in public/browse/app.js - About 1 day to fix

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

        lunr.Index.load = function (serialisedData) {
          if (serialisedData.version !== lunr.version) {
            lunr.utils.warn('version mismatch: current ' + lunr.version + ' importing ' + serialisedData.version)
          }
        
        
        Severity: Major
        Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 1 day to fix
        public/browse/lib/lunr.js/lib/index.js on lines 64..80

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

        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.Index.load = function (serialisedData) {
          if (serialisedData.version !== lunr.version) {
            lunr.utils.warn('version mismatch: current ' + lunr.version + ' importing ' + serialisedData.version)
          }
        
        
        Severity: Major
        Found in public/browse/lib/lunr.js/lib/index.js and 1 other location - About 1 day to fix
        public/browse/lib/lunr.js/lunr.js on lines 844..860

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

        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

        function get_class_details_from_raw(cls) {
          var
            ont_acronym = cls.links.ontology.replace(/.*\//, ''),
            ont_name = annotator_ontologies[cls.links.ontology].name,
            ont_rel_ui = '/ontologies/' + ont_acronym,
        Severity: Major
        Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 1 day to fix
        app/assets/javascripts/bp_annotatorplus.js on lines 597..627

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

        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

        function get_class_details_from_raw(cls) {
          var
            ont_acronym = cls.links.ontology.replace(/.*\//, ''),
            ont_name = annotator_ontologies[cls.links.ontology].name,
            ont_rel_ui = '/ontologies/' + ont_acronym,
        Severity: Major
        Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 1 day to fix
        app/assets/javascripts/bp_annotator.js on lines 514..544

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

        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 NCBOPropertyTree has 240 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var NCBOPropertyTree = function(element, opt) {
            var obj = this;
            var OPTIONS;
            var ROOT_ID = "roots";
        
        
        Severity: Major
        Found in app/assets/javascripts/bp_property_tree.js - About 1 day to fix

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

          lunr.SortedSet.prototype.intersect = function (otherSet) {
            var intersectSet = new lunr.SortedSet,
                i = 0, j = 0,
                a_len = this.length, b_len = otherSet.length,
                a = this.elements, b = otherSet.elements
          Severity: Major
          Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 1 day to fix
          public/browse/lib/lunr.js/lib/sorted_set.js on lines 162..189

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

          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

          Severity
          Category
          Status
          Source
          Language