Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\cli.js: TypeError: Cannot read properties of undefined (reading 'camelCase')And the code says:
import { camelCase, kebabCase } from 'change-case';
...
const param = programOptions[key === 'minifyURLs' ? 'minifyUrls' : camelCase(key)];camelCase is an object from change-case which is a module that must be installed via npm, as is not part from the repo, jtmetrics cannot find the definition while searching for the metric "Function Coupling", thats why it fails.
Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\demo\main.js: TypeError: Cannot read properties of undefined (reading 'Boolean')And the code says:
value = Boolean(option.checked);
...
checked: Boolean(yes)Boolean function does not come from an import. Its a built-in global constructor/function provided by the JavaScript runtime, so we can't find the declaration while parsing/traversing the AST.
Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\src\htmlminifier.js: TypeError: Cannot read properties of undefined (reading 'decodeHTMLStrict')And the code says:
import { decodeHTMLStrict, decodeHTML } from 'entities';
...
attrValue = decodeHTMLStrict(attrValue);decodeHTMLStrict is an object from entities which a module that must be installed via npm, as is not part from the repo, jtmetrics cannot find the definition while searching for the metric "Function Coupling", thats why it fails.
Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\src\utils.js: TypeError: Cannot read properties of undefined (reading 'asyncFn')And the code says:
export async function replaceAsync(str, regex, asyncFn) {
const promises = [];
str.replace(regex, (match, ...args) => {
const promise = asyncFn(match, ...args);
promises.push(promise);
});
const data = await Promise.all(promises);
return str.replace(regex, () => data.shift());
}asyncFN is a callback used inside replaceAsync function, we are unable to track the definition of that function as jtmetrics only does static analisys.
Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\benchmarks\backtest.cjs: TypeError: Cannot read properties of undefined (reading 'require')And the code says:
...
const urls = require('./sites.json');
...require function does not come from an import. Its a built-in global constructor/function provided by the JavaScript runtime, so we can't find the declaration while parsing/traversing the AST.
Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\benchmarks\benchmark.cjs: TypeError: Cannot read properties of undefined (reading 'done')And the code says:
function run(tasks, done) {
let i = 0;
function callback() {
if (i < tasks.length) {
tasks[i++](callback);
} else {
done();
}
}
callback();
}
...done is a callback function, we are unable to track the definition of that function as jtmetrics only does static analisys.
Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\tests\cli.spec.js: TypeError: Cannot read properties of undefined (reading 'spawnSync')And the code says:
import { spawnSync } from 'child_process';
...
const { stdout, stderr } = spawnSync('node', [cliPath, ...args], spawnOptions);spawnSync is an object from child_process which an external node module, as is not part from the repo, jtmetrics cannot find the definition while searching for the metric "Function Coupling", thats why it fails.
Error traversing AST on metric function-coupling -> C:\Users\anais\OneDrive\Documentos\Github\Metrics2\repositories\P84-html-minifier-terser\tests\minifier.spec.js: TypeError: Cannot read properties of undefined (reading 'defaultFn')And the code says:
test('canCollapseWhitespace and canTrimWhitespace hooks', async () => {
function canCollapseAndTrimWhitespace(tagName, attrs, defaultFn) {
if ((attrs || []).some(function (attr) { return attr.name === 'class' && attr.value === 'leaveAlone'; })) {
return false;
}
return defaultFn(tagName, attrs);
}
...defaultFn is a callback function, we are unable to track the definition of that function as jtmetrics only does static analisys.