IHTSDO/snomed-interaction-components

View on GitHub

Showing 340 of 6,870 total issues

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

            success: function(result) {
                //if (result.paserResponse.validation) {
                data = result;
                //result.computeResponse.matches
                if (!onlyTotal) {
Severity: Major
Found in js/queryPlugin.js - About 3 hrs to fix

    Function getChildren has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.getChildren = function(conceptId, forceShow) {
            if (typeof panel.options.selectedView == "undefined") {
                panel.options.selectedView = "inferred";
            }
    
    
    Severity: Major
    Found in js/conceptDetailsPlugin.js - About 3 hrs to fix

      File util.js has 322 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Created by alo on 7/18/14.
       */
      icon = document.createElement("img");
      channel = postal.channel("Selections");
      Severity: Minor
      Found in js/util.js - About 3 hrs to fix

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

            function debounce(func, wait, options) {
              var args,
                  maxTimeoutId,
                  result,
                  stamp,
        Severity: Major
        Found in external-libs/lodash.js - About 3 hrs to fix

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

            performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
          
            var $0 = $$.length - 1;
            switch (yystate) {
            case 1: return new yy.ProgramNode($$[$0-1], this._$); 
          Severity: Major
          Found in external-libs/handlebars-v1.3.0.js - About 3 hrs to fix

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

                load: function(url, settings) {
                    settings = (typeof settings == 'boolean' ? {addTo: settings} :
                        (typeof settings == 'function' ? {onLoad: settings} :
                        (typeof settings == 'string' ? {parent: settings} : 
                        (typeof settings == 'object' && settings.nodeName ? {parent: settings} :
            Severity: Major
            Found in external-libs/jquery.svg.js - About 3 hrs to fix

              Function prop has 85 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              $.i18n.prop = function(key /* Add parameters as function arguments as necessary  */) {
                  var value = $.i18n.map[key];
                  if (value == null)
                      return '[' + key + ']';
                  
              Severity: Major
              Found in external-libs/jquery.i18n.properties-1.0.9.js - About 3 hrs to fix

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

                  lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
                
                
                  function strip(start, end) {
                    return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
                Severity: Major
                Found in external-libs/handlebars-v1.3.0.js - About 3 hrs to fix

                  Function getParent has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.getParent = function(conceptId, target) {
                          if (xhrParents != null) {
                              xhrParents.abort();
                              //console.log("aborting children call...");
                          };
                  Severity: Major
                  Found in js/conceptDetailsPlugin.js - About 3 hrs to fix

                    Function getExpressionForCondition has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        this.getExpressionForCondition = function(condition, htmlFormat, fullSyntax) {
                            var grammar = "";
                            var operator = "";
                            if (condition.criteria == "self") {
                                if (fullSyntax) {
                    Severity: Major
                    Found in js/queryPlugin.js - About 3 hrs to fix

                      Function favoritePanel has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function favoritePanel(divElement, options) {
                          var panel = this;
                          this.divElement = divElement;
                          this.options = jQuery.extend(true, {}, options);
                          var favoriteCall = null;
                      Severity: Major
                      Found in js/favoritesPlugin.js - About 3 hrs to fix

                        Function refsetPanel has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function refsetPanel(divElement, options) {
                            var panel = this;
                            this.divElement = divElement;
                            this.options = jQuery.extend(true, {}, options);
                            var favoriteCall = null;
                        Severity: Minor
                        Found in js/refsetPlugin.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 registerDefaultHelpers has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function registerDefaultHelpers(instance) {
                            instance.registerHelper('helperMissing', function(arg) {
                              if(arguments.length === 2) {
                                return undefined;
                              } else {
                        Severity: Major
                        Found in external-libs/handlebars-v1.3.0.js - About 3 hrs to fix

                          Function renderExpression has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var renderExpression = function(concept, inferredConcept, div, options) {
                              var preCoordinatedHtml = referenceToExpression(concept);
                              var tmp = document.createElement("DIV");
                              tmp.innerHTML = preCoordinatedHtml;
                              var plainPreCoordinatedExpression =  tmp.textContent || tmp.innerText || "";
                          Severity: Major
                          Found in js/conceptExpressions.js - About 3 hrs to fix

                            File jquery.i18n.properties-1.0.9.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /******************************************************************************
                             * jquery.i18n.properties
                             * 
                             * Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
                             * MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
                            Severity: Minor
                            Found in external-libs/jquery.i18n.properties-1.0.9.js - About 2 hrs to fix

                              Function getReferences has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  this.getReferences = function(conceptId) {
                                      $("#references-" + panel.divElement.id + "-accordion").html("<i class='glyphicon glyphicon-refresh icon-spin'></i>");
                                      //console.log(options.serverUrl + "/" + options.edition + "/" + options.release + "/concepts/" + conceptId + "/references");
                                      if (xhrReferences != null) {
                                          xhrReferences.abort();
                              Severity: Major
                              Found in js/conceptDetailsPlugin.js - About 2 hrs to fix

                                Function connectElements has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function connectElements(svg, fig1, fig2, side1, side2, endMarker) {
                                    var rect1cx = fig1.getBBox().x;
                                    var rect1cy = fig1.getBBox().y;
                                    var rect1cw = fig1.getBBox().width;
                                    var rect1ch = fig1.getBBox().height;
                                Severity: Major
                                Found in js/svgdiagrammingv2.js - About 2 hrs to fix

                                  Function setElementPosition has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    Notification.prototype.setElementPosition = function() {
                                      var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, wrapPos, _i, _j, _len, _len1, _ref;
                                      position = this.getPosition();
                                      pMain = position[0], pAlign = position[1], pArrow = position[2];
                                      elemPos = this.elem.position();
                                  Severity: Major
                                  Found in external-libs/notify.js - About 2 hrs to fix

                                    Function baseClone has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function baseClone(value, isDeep, callback, stackA, stackB) {
                                          if (callback) {
                                            var result = callback(value);
                                            if (typeof result != 'undefined') {
                                              return result;
                                    Severity: Major
                                    Found in external-libs/lodash.js - About 2 hrs to fix

                                      Function template has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function template(text, data, options) {
                                            // based on John Resig's `tmpl` implementation
                                            // http://ejohn.org/blog/javascript-micro-templating/
                                            // and Laura Doktorova's doT.js
                                            // https://github.com/olado/doT
                                      Severity: Major
                                      Found in external-libs/lodash.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language