Sorts number of severity issues e.g. 1 High, 0 Medium, 0 Low.
@private
@param {array} aIssues
@name sap.ui.support.IssueManager._sortSeverityIssuesByPriority
@returns {object} Object containing the number of issues sorted by severity.
552310
function(aIssues) {
				var iHighIssues = 0,
					iMediumIssues = 0,
					iLowIssues = 0;
				aIssues.forEach(function(element) {
					switch (element.severity) {
						case constants.SUPPORT_ASSISTANT_ISSUE_SEVERITY_LOW:
							iLowIssues++;
							break;
						case constants.SUPPORT_ASSISTANT_ISSUE_SEVERITY_MEDIUM:
							iMediumIssues++;
							break;
						case constants.SUPPORT_ASSISTANT_ISSUE_SEVERITY_HIGH:
							iHighIssues++;
							break;
					}
				});

				return {high: iHighIssues, medium: iMediumIssues, low: iLowIssues};
			}
251685
public void sortIndices(SortCoupledArray_F64 sorter ) {
        if( sorter == null )
            sorter = new SortCoupledArray_F64();

        sorter.quick(col_idx,numCols+1,nz_rows,nz_values);
        indicesSorted = true;
    }
774759
function compareAscending(a, b) {
  var ai = a.idx,
      bi = b.idx;

  a = a.criteria;
  b = b.criteria;

  // ensure a stable sort in V8 and other engines
  // http://code.google.com/p/v8/issues/detail?id=90
  if (a !== b) {
    if (a > b || typeof a === 'undefined') {
      return 1;
    }
    /*istanbul ignore next*/
    if (a < b || typeof b === 'undefined') {
      return -1;
    }
  }

  /*istanbul ignore next*/
  return ai < bi ? -1 : 1;
}
655860
public void sort(IndexedSortable s, int p, int r) {
    sort(s, p, r, null);
  }
1280356
function sortCompare (x, y) {
  // 1. If x and y are both undefined, return +0.
  if (x === undefined && y === undefined) {
    return 0;
  }

  // 2. If x is undefined, return 1.
  if (x === undefined) {
    return 1;
  }

  // 3. If y is undefined, return -1.
  if (y === undefined) {
    return -1;
  }

  // 5. Let xString be ? ToString(x).
  x = String(x);

  // 6. Let yString be ? ToString(y).
  y = String(y);

  // 7. Let xSmaller be the result of performing Abstract Relational
  //    Comparison xString < yString.
  // 8. If xSmaller is true, return -1.
  // 9. Let ySmaller be the result of performing Abstract Relational
  //    Comparison yString < xString.
  // 10. If ySmaller is true, return 1.
  // 11. Return +0.
  return (x < y) ? -1 : (x > y) ? 1 : 0;
}
394093
function sortBy(collection, evaluator) {
        var array = map(collection, function(item){return item})
        array.sort(function(a,b){
          var aValue = evaluator(a),
              bValue = evaluator(b)
          return aValue==bValue ? 0 : (aValue>bValue ? 1 : -1)
        })
        var sortedCollection = map(array, function(item){return item}, features.newCollection, features.append)
        return sortedCollection
      }
543100
function StablePriorityQueue(comparator) {
    this.array = [];
    this.size = 0;
    this.runningcounter = 0;
    this.compare = comparator || defaultcomparator;
    this.stable_compare = function(a, b) {
      var cmp = this.compare(a.value,b.value);
      return (cmp < 0) || ( (cmp == 0) && (a.counter < b.counter) );
    }
}
1326865
function _sort(a,b) {
    if (a.weight < b.weight) {
      return 1;
    }
    else if (a.weight > b.weight) {
      return -1;
    }
    else {
      return 0;
    }
  }
1130712
public static void sortDescending(short[] shortArray) {
        int index = 0;
        short value = 0;
        
        for(int i = 1; i < shortArray.length; i++) {
            index = i;
            value = shortArray[index];
            
            while(index > 0 && value > shortArray[index - 1]) {
                shortArray[index] = shortArray[index - 1];
                
                index--;
            }
            
            shortArray[index] = value;
        }
    }
953722
function processIssues(issues) {
			if (options.rootElement) {
				issues = issues.filter(isIssueInTestArea);
			}
			if (options.hideElements) {
				issues = issues.filter(isElementOutsideHiddenArea);
			}
			return issues.map(processIssue).filter(isIssueNotIgnored);
		}
63407
function (query, items) {
            var sortExpressions = query.query.sort,
                self = this;

            if(sortExpressions){
                return items.sort(function (a, b) {
                    var sortExpression,
                        ret = 0;
                    for (var i = 0; i < sortExpressions.length; i++) {
                        sortExpression = sortExpressions[i];
                        ret = self._compareExpression(a, b, sortExpression);
                        if (ret !== 0) {
                            return ret;
                        }
                    }
                    return ret;
                });
            } else {
                return items;
            }

        }
859549
function (oIssues) {
				var groupedIssues = {},
					issue = {};

				for (var i = 0; i < oIssues.length; i++) {
					issue = oIssues[i];

					if (!groupedIssues[issue.ruleLibName]) {
						groupedIssues[issue.ruleLibName] = {};
					}

					if (!groupedIssues[issue.ruleLibName][issue.ruleId]) {
						groupedIssues[issue.ruleLibName][issue.ruleId] = [];
					}

					groupedIssues[issue.ruleLibName][issue.ruleId].push(issue);
				}

				return groupedIssues;
			}
1310167
function orderAndSort(sortConf) {
    return {
        sortFieldName: sortConf.sortBy,
        sortDesc: sortConf.sortAsc === undefined ? false : !sortConf.sortAsc
    };
}
1266886
function validateRuleSeverity(options) {
    const severity = Array.isArray(options) ? options[0] : options;
    const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity;

    if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
        return normSeverity;
    }

    throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`);

}
77553
function validatePriority (priority) {
  var type = typeOf(priority);

  if (type.hasValue && !type.isNumber) {
    throw ono('Invalid arguments. Expected a priority number.');
  }
}
95667
function argSort(vectors, ascending) {
  if (vectors.length !== ascending.length) {
    throw new Error('length of "ascending" must match the number of ' +
      'sort columns');
  }
  if (vectors.length === 0) {
    return null;
  }
  var nRow = vectors[0].size();
  var result = allocArray(nRow);
  for (var i = 0; i < nRow; i++) {
    result[i] = i;
  }

  // Create composite compare function
  var compareFuncs = ascending.map(function(asc) {
    return asc ? compare : compareReverse;
  });
  var compositeCompare = function(a, b) {
    var result = 0;
    for (var i = 0; i < compareFuncs.length; i++) {
      var aValue = vectors[i].values[a];
      var bValue = vectors[i].values[b];
      result = compareFuncs[i](aValue, bValue);
      if (result !== 0) {
        return result;
      }
    }
    // Order based on row index as last resort to ensure stable sorting
    return compare(a, b);
  };

  result.sort(compositeCompare);
  return result;
}
237193
function _sorter(a, b){
	// Use aid property priority.
	var bpri = aid.priority(b.property_id());
	var apri = aid.priority(a.property_id());
	return apri - bpri;
    }