uhho / density-clustering

Density Based Clustering in JavaScript
MIT License
214 stars 33 forks source link

Incorrect type declarations #13

Open derek1906 opened 4 years ago

derek1906 commented 4 years ago

The source code has a lot of incorrect type declarations which is confusing my IDE.

Here are some examples:

/**
 * DBSCAN class construcotr
 * @constructor
 *
 * @param {Array} dataset
 * @param {number} epsilon
 * @param {number} minPts
 * @param {function} distanceFunction
 * @returns {DBSCAN}
 */
function DBSCAN(dataset, epsilon, minPts, distanceFunction) {

Fields are declared as mandatory but in fact they aren't.

/**
 * Start clustering
 *
 * @param {Array} dataset
 * @param {number} epsilon
 * @param {number} minPts
 * @param {function} distanceFunction
 * @returns {undefined}
 * @access public
 */
DBSCAN.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {

Same here, and the return type is declared to be undefined but in fact it returns the clusters.