ncbo/bioportal_web_ui

View on GitHub

Showing 306 of 628 total issues

Method get_class has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

  def get_class(params)

    if @ontology.flat?

      ignore_concept_param = params[:conceptid].nil? ||
Severity: Minor
Found in app/controllers/application_controller.rb - About 4 hrs to fix

Cognitive Complexity

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

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

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

Further reading

File bp_notes.js has 346 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var ontNotesTable;
var ont_columns = { archived: 3, date: 7, subjectSort: 2 };

jQuery(".ontologies.show").ready(function(){
  setupNotesFaceboxSizing();
Severity: Minor
Found in app/assets/javascripts/bp_notes.js - About 4 hrs to fix

    Function success has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                success: function(data) {
                    $('.recommenderSpinner').hide();
                    if (data) {
                        if (data.length > 0) {
                            $("#recommender-results").empty();
    Severity: Major
    Found in app/assets/javascripts/bp_recommender.js - About 4 hrs to fix

      Method index has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

        def index
          @app_name = "FacetedBrowsing"
          @app_dir = "/browse"
          @base_path = @app_dir
          ontologies = LinkedData::Client::Models::Ontology.all(include: LinkedData::Client::Models::Ontology.include_params + ",viewOf", include_views: true, display_context: false)
      Severity: Minor
      Found in app/controllers/ontologies_controller.rb - About 4 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      File jquery.ncbo.tree-2.0.1.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
      * jQuery SimpleTree Drag&Drop plugin
      * Update on 22th May 2008
      * Version 0.3
      *
      Severity: Minor
      Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 3 hrs to fix

        File jquery.ncbo.tree-2.0.0.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
        * jQuery SimpleTree Drag&Drop plugin
        * Update on 22th May 2008
        * Version 0.3
        *
        Severity: Minor
        Found in public/widgets/jquery.ncbo.tree-2.0.0.js - About 3 hrs to fix

          File jquery.ncbo.tree-2.0.2.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
          * jQuery SimpleTree Drag&Drop plugin
          * Update on 22th May 2008
          * Version 0.3
          *
          Severity: Minor
          Found in public/widgets/jquery.ncbo.tree-2.0.2.js - About 3 hrs to fix

            Method create has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

              def create
                params[:mappings] ||= []
                params[:max_level] ||= 0
                params[:ontologies] ||= []
                params[:semantic_types] ||= []
            Severity: Minor
            Found in app/controllers/annotator_controller.rb - About 3 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

            Function TzDate has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            angular.mock.TzDate = function(offset, timestamp) {
              var self = new Date(0);
              if (angular.isString(timestamp)) {
                var tsStr = timestamp;
            
            
            Severity: Major
            Found in public/browse/lib/angular-mocks/angular-mocks.js - About 3 hrs to fix

              Function get_annotations has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function get_annotations() {
                jQuery("#results_error").html("");
                jQuery("#annotator_error").html("");
              
                // Validation
              Severity: Major
              Found in app/assets/javascripts/bp_annotatorplus.js - About 3 hrs to fix

                Function displayUsers has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function displayUsers(data) {
                    let ontTable = null;
                    let allRows
                    if (jQuery.fn.dataTable.isDataTable('#adminUsers')) {
                        ontTable = jQuery('#adminUsers').DataTable();
                Severity: Major
                Found in app/assets/javascripts/bp_admin.js - About 3 hrs to fix

                  File ontologies_controller.rb has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class OntologiesController < ApplicationController
                    include MappingsHelper
                    include MappingStatistics
                  
                    require "multi_json"
                  Severity: Minor
                  Found in app/controllers/ontologies_controller.rb - About 3 hrs to fix

                    File app.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    'use strict';
                    
                    // Declare app level module which depends on views, and components
                    angular.module('FacetedBrowsing', [
                      'ngRoute',
                    Severity: Minor
                    Found in public/browse/app.js - About 3 hrs to fix

                      File angular-route.js has 316 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /**
                       * @license AngularJS v1.3.5
                       * (c) 2010-2014 Google, Inc. http://angularjs.org
                       * License: MIT
                       */
                      Severity: Minor
                      Found in public/browse/lib/angular-route/angular-route.js - About 3 hrs to fix

                        File bp_recommender.js has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        // Namespace for global variables and functions
                        var rec = { }
                        rec.maxInputWords = 500;
                        
                        rec.showOrHideAdvancedOptions = function() {
                        Severity: Minor
                        Found in app/assets/javascripts/bp_recommender.js - About 3 hrs to fix

                          File form_complete.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          // jQuery check, if it's not present then include it
                          function bpMinVersion(min, actual) {
                            function parseVersionString (str) {
                              if (typeof(str) != 'string') { return false; }
                              var x = str.split('.');
                          Severity: Minor
                          Found in public/javascripts/widgets/form_complete.js - About 3 hrs to fix

                            File bp_ontolobridge.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            function bindAddRequestTermClick() {
                              jQuery("a.add_request_term").live('click', function(){
                                var id = jQuery(this).attr("data-parent-id");
                                addRequestTermBox(id);
                              });
                            Severity: Minor
                            Found in app/assets/javascripts/bp_ontolobridge.js - About 3 hrs to fix

                              Method show has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def show
                                  # Hack to make ontologyid and conceptid work in addition to id and ontology params
                                  params[:id] = params[:id].nil? ? params[:ontologyid] : params[:id]
                                  params[:ontology] = params[:ontology].nil? ? params[:id] : params[:ontology]
                              
                              
                              Severity: Minor
                              Found in app/controllers/ontologies_controller.rb - About 3 hrs to fix

                              Cognitive Complexity

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

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

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

                              Further reading

                              Function onSuccessAction has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                              AjaxAction.prototype.onSuccessAction = function(data, ontology, deferredObj) {
                                var self = this;
                                if (!self.isLongOperation) {
                                  return;
                                }
                              Severity: Minor
                              Found in app/assets/javascripts/bp_admin.js - About 3 hrs to fix

                              Cognitive Complexity

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

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

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

                              Further reading

                              Function parseTemplate has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function parseTemplate(template, tags) {
                                  tags = tags || mustache.tags;
                                  template = template || '';
                              
                                  if (typeof tags === 'string') {
                              Severity: Major
                              Found in public/browse/lib/lunr.js/example/mustache.js - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language