Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
'readonly',
'serializable',
'sinon',
'readonly',
'serializable',
'sinon',
'unregister',
'workerpool'
],
'unregister',
'workerpool'
],
run: |
npm run test
npm run coverage
run: |
npm run test
npm run coverage
.eslintcache
.history/
.scannerwork
.eslintcache
.history/
.scannerwork
/**
* Intentionally inefficient implementation.
*
/**
* Intentionally inefficient implementation.
*
- * @param {number} n
- * @returns {number}
+ * @param {number} n - The number of fibonacci numbers to generate.
+ * @returns {number} - The nth fibonacci number.
*/
function fibonacci (n) {
if (n <= 1) return 1
return fibonacci(n - 1) + fibonacci(n - 2)
}
*/
function fibonacci (n) {
if (n <= 1) return 1
return fibonacci(n - 1) + fibonacci(n - 2)
}
+/**
+ * Intentionally inefficient implementation.
+ *
+ * @param {number} n - The number to calculate the factorial of.
+ * @returns {number} - The factorial of n.
+ */
+function factorial (n) {
+ if (n === 0) {
+ return 1
+ } else {
+ return factorial(n - 1) * n
+ }
+}
+
const LIST_FORMATTER = new Intl.ListFormat('en-US', {
style: 'long',
type: 'conjunction'
const LIST_FORMATTER = new Intl.ListFormat('en-US', {
style: 'long',
type: 'conjunction'
jsonIntegerSerialization,
generateRandomInteger,
fibonacci,
jsonIntegerSerialization,
generateRandomInteger,
fibonacci,
"format": "prettier --loglevel silent --write .; prettierx --write .",
"lint": "eslint . --cache",
"lint:fix": "eslint . --cache --fix",
"format": "prettier --loglevel silent --write .; prettierx --write .",
"lint": "eslint . --cache",
"lint:fix": "eslint . --cache --fix",
+ "lint:report": "eslint . --cache --format json --output-file reports/eslint.json",
"typedoc": "typedoc",
"sonar:properties": "./updateSonarProps.sh",
"prepublishOnly": "npm run build:prod"
"typedoc": "typedoc",
"sonar:properties": "./updateSonarProps.sh",
"prepublishOnly": "npm run build:prod"
sonar.projectKey=pioardi_poolifier
sonar.organization=pioardi
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.projectKey=pioardi_poolifier
sonar.organization=pioardi
sonar.javascript.lcov.reportPaths=coverage/lcov.info
+sonar.eslint.reportPaths=reports/eslint.json
sonar.projectName=poolifier
sonar.projectVersion=2.2.2
sonar.host.url=https://sonarcloud.io
sonar.projectName=poolifier
sonar.projectVersion=2.2.2
sonar.host.url=https://sonarcloud.io
/**
* Intentionally inefficient implementation.
*
/**
* Intentionally inefficient implementation.
*
- * @param {number} n
- * @returns {number}
+ * @param {number} n - The number of fibonacci numbers to generate.
+ * @returns {number} - The nth fibonacci number.
*/
static fibonacci (n) {
if (n <= 1) return 1
*/
static fibonacci (n) {
if (n <= 1) return 1
/**
* Intentionally inefficient implementation.
*
/**
* Intentionally inefficient implementation.
*
- * @param {number} n
- * @returns {number}
+ * @param {number} n - The number to calculate the factorial of.
+ * @returns {number} - The factorial of n.
*/
static factorial (n) {
if (n === 0) {
*/
static factorial (n) {
if (n === 0) {