ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

Function link has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    link: function(scope, $element, attr, ctrl, $transclude) {
        var currentScope,
            currentElement,
            previousLeaveAnimation,
            autoScrollExp = attr.autoscroll,
Severity: Minor
Found in public/browse/lib/angular-route/angular-route.js - About 1 hr to fix

    Function animateSetup has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function animateSetup(animationEvent, element, className, styles) {
            var structural = ['ng-enter','ng-leave','ng-move'].indexOf(className) >= 0;
    
            var cacheKey = getCacheKey(element);
            var eventCacheKey = cacheKey + ' ' + className;
    Severity: Minor
    Found in public/browse/lib/angular-animate/angular-animate.js - About 1 hr to fix

      Function dump has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      angular.mock.dump = function(object) {
        return serialize(object);
      
        function serialize(object) {
          var out;
      Severity: Minor
      Found in public/browse/lib/angular-mocks/angular-mocks.js - About 1 hr to fix

        Function animate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          .config(['$provide', function($provide) {
        
            var reflowQueue = [];
            $provide.value('$$animateReflow', function(fn) {
              var index = reflowQueue.length;
        Severity: Minor
        Found in public/browse/lib/angular-mocks/angular-mocks.js - About 1 hr to fix

          Function timer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var timer = setInterval(function() {
              jQuery.ajax({
                url: determineHTTPS(BP_CONFIG.rest_url) + "/admin/ontologies_report/" + processId,
                data: {
                  apikey: BP_CONFIG.apikey,
          Severity: Minor
          Found in app/assets/javascripts/bp_admin.js - About 1 hr to fix

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

            lunr.Index.prototype.use = function (plugin) {
              var args = Array.prototype.slice.call(arguments, 1)
              args.unshift(this)
              plugin.apply(this, args)
            }
            Severity: Major
            Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 1 hr to fix
            public/browse/lib/lunr.js/lib/index.js on lines 417..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 71.

            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.prototype.use = function (plugin) {
              var args = Array.prototype.slice.call(arguments, 1)
              args.unshift(this)
              plugin.apply(this, args)
            }
            Severity: Major
            Found in public/browse/lib/lunr.js/lib/index.js and 1 other location - About 1 hr to fix
            public/browse/lib/lunr.js/lunr.js on lines 1197..1201

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

            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

            Method update_role has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

              def update_role(user)
                user_roles = user.role
            
                if session[:user].admin?
                  user_roles = user_roles.dup
            Severity: Minor
            Found in app/controllers/users_controller.rb - About 1 hr 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 populateOntologyRows has a Cognitive Complexity of 14 (exceeds 5 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

            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

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

                var setTrigger = function(node) {
                  $('>a',node).before('<img class="trigger" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border=0>');
                  var trigger = $('>.trigger', node);
                  trigger.click(function(event) {
                    nodeToggle(node);
            Severity: Major
            Found in public/widgets/jquery.ncbo.tree-2.0.0.js and 2 other locations - About 1 hr to fix
            public/widgets/jquery.ncbo.tree-2.0.1.js on lines 311..321
            public/widgets/jquery.ncbo.tree-2.0.2.js on lines 311..321

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

            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 setTrigger = function(node) {
                  $('>a',node).before('<img class="trigger" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border=0>');
                  var trigger = $('>.trigger', node);
                  trigger.click(function(event) {
                    nodeToggle(node);
            Severity: Major
            Found in public/widgets/jquery.ncbo.tree-2.0.2.js and 2 other locations - About 1 hr to fix
            public/widgets/jquery.ncbo.tree-2.0.0.js on lines 311..321
            public/widgets/jquery.ncbo.tree-2.0.1.js on lines 311..321

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

            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 setTrigger = function(node) {
                  $('>a',node).before('<img class="trigger" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border=0>');
                  var trigger = $('>.trigger', node);
                  trigger.click(function(event) {
                    nodeToggle(node);
            Severity: Major
            Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 hr to fix
            public/widgets/jquery.ncbo.tree-2.0.0.js on lines 311..321
            public/widgets/jquery.ncbo.tree-2.0.2.js on lines 311..321

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

            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

                this.setTrigger = function(node) {
                  $('>a',node).before('<img class="trigger" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border=0>');
                  var trigger = $('>.trigger', node);
                  trigger.click(function(event){
                    obj.nodeToggle(node);
            Severity: Major
            Found in app/assets/javascripts/bp_property_tree.js and 1 other location - About 1 hr to fix
            public/widgets/jquery.ncbo.tree.js on lines 327..337

            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

              $scope.groupAcronyms = function(groups) {
                var groupNames = [];
                angular.forEach(groups, function(group) {
                  groupNames.push($scope.groups_hash[group].acronym);
                });
            Severity: Major
            Found in public/browse/app.js and 1 other location - About 1 hr to fix
            public/browse/app.js on lines 162..168

            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

              $scope.categoryNames = function(categories) {
                var catNames = [];
                angular.forEach(categories, function(category) {
                  catNames.push($scope.categories_hash[category].name)
                })
            Severity: Major
            Found in public/browse/app.js and 1 other location - About 1 hr to fix
            public/browse/app.js on lines 154..160

            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

                  TREE.setTrigger = function(node) {
                    $('>a',node).before('<img class="trigger" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border=0>');
                    var trigger = $('>.trigger', node);
                    trigger.click(function(event){
                      TREE.nodeToggle(node);
            Severity: Major
            Found in public/widgets/jquery.ncbo.tree.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/bp_property_tree.js on lines 264..274

            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

            Function setAjaxNodes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.setAjaxNodes = function(node, parentId, successCallback, errorCallback) {
                  if (typeof OPTIONS.beforeExpand == 'function') {
                    OPTIONS.beforeExpand(node);
                  }
                  $TREE_CONTAINER.trigger("beforeExpand", node);
            Severity: Minor
            Found in app/assets/javascripts/bp_property_tree.js - About 1 hr to fix

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

              lunr.Store.prototype.set = function (id, tokens) {
                if (!this.has(id)) this.length++
                this.store[id] = tokens
              }
              Severity: Major
              Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 1 hr to fix
              public/browse/lib/lunr.js/lib/document_store.js on lines 44..47

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

              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.load = function (serialisedData) {
                var store = new this
              
                store.root = serialisedData.root
                store.length = serialisedData.length
              Severity: Major
              Found in public/browse/lib/lunr.js/lib/token_store.js and 1 other location - About 1 hr to fix
              public/browse/lib/lunr.js/lunr.js on lines 1685..1692

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

              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.Store.prototype.set = function (id, tokens) {
                if (!this.has(id)) this.length++
                this.store[id] = tokens
              }
              Severity: Major
              Found in public/browse/lib/lunr.js/lib/document_store.js and 1 other location - About 1 hr to fix
              public/browse/lib/lunr.js/lunr.js on lines 1245..1248

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

              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