Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
term = term.toLowerCase();
const processors = current.model.configuration.processors;
const type = typeof filteredType === 'function' ? filteredType() : null;
if (type || computeTypes.every(sType => processors[sType].filter(p => p.toLowerCase().includes(term)).length)) {

Check failure on line 206 in src/main/resources/META-INF/resources/webjars/service/prov/prov.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this code to not nest functions more than 4 levels deep.

See more on https://sonarcloud.io/project/issues?id=ligoj_plugin-prov&issues=AZ23Aymvz4R1ck_dW-9z&open=AZ23Aymvz4R1ck_dW-9z&pullRequest=303
return { id: term, text: '[' + term + ']' };
}
}
Expand All @@ -214,7 +214,7 @@
if (current.model) {
const processors = current.model.configuration.processors;
const type = typeof filteredType === 'function' ? filteredType() : null;
return { results: (type ? processors[type] || [] : computeTypes.map(sType => processors[sType]).flat()).map(p => ({ id: p, text: p })) };

Check warning on line 217 in src/main/resources/META-INF/resources/webjars/service/prov/prov.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `.flatMap(…)` over `.map(…).flat()`.

See more on https://sonarcloud.io/project/issues?id=ligoj_plugin-prov&issues=AZ23Aymvz4R1ck_dW-90&open=AZ23Aymvz4R1ck_dW-90&pullRequest=303
}
return { results: [] };
}
Expand Down Expand Up @@ -3594,7 +3594,7 @@
_('support-level').select2('data', current.select2IdentityData(quote.level || null));

// Access types
_('support-access-api').select2('data', quote.accessApi || null);
_('support-access-api').select2('data', current.select2IdentityData((quote.accessApi) || null));
_('support-access-email').select2('data', quote.accessEmail || null);
_('support-access-phone').select2('data', quote.accessPhone || null);
_('support-access-chat').select2('data', quote.accessChat || null);
Expand Down Expand Up @@ -4096,7 +4096,7 @@

getFilteredData: function (type, filterDate, filtreInstance) {
let result = [];
if (filtreInstance == type || filtreInstance == (undefined || null)) {

Check warning on line 4099 in src/main/resources/META-INF/resources/webjars/service/prov/prov.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Unexpected constant truthiness on the left-hand side of a `||` expression.

See more on https://sonarcloud.io/project/issues?id=ligoj_plugin-prov&issues=AZ23Aymvz4R1ck_dW-91&open=AZ23Aymvz4R1ck_dW-91&pullRequest=303
if (current[type + 'Table']) {
const data = _('prov-' + type + 's').DataTable().rows({ filter: 'applied' }).data();
for (let index = 0; index < data.length; index++) {
Expand All @@ -4121,7 +4121,7 @@
return result;
},

computeStatsType: function (conf, filterDate, filtreInstance, reservationModeMax, defaultUsage, duration, timeline, type, result, callback, callbackQi) {

Check warning on line 4124 in src/main/resources/META-INF/resources/webjars/service/prov/prov.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Method 'computeStatsType' has too many parameters (11). Maximum allowed is 7.

See more on https://sonarcloud.io/project/issues?id=ligoj_plugin-prov&issues=AZ23Aymvz4R1ck_dW-92&open=AZ23Aymvz4R1ck_dW-92&pullRequest=303
let ramAdjustedRate = conf.ramAdjustedRate / 100;
let publicAccess = 0;
let instances = current.getFilteredData(type, filterDate,filtreInstance);
Expand Down Expand Up @@ -4439,7 +4439,7 @@
let allProcessors = {};
stats.function.filtered.forEach(qi => {
let Processors = allProcessors[qi.price.type.name];
if (typeof Processors === 'undefined') {

Check warning on line 4442 in src/main/resources/META-INF/resources/webjars/service/prov/prov.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Compare with `undefined` directly instead of using `typeof`.

See more on https://sonarcloud.io/project/issues?id=ligoj_plugin-prov&issues=AZ23Aymvz4R1ck_dW-93&open=AZ23Aymvz4R1ck_dW-93&pullRequest=303
// First runtime
Processors = {
name: qi.price.type.name,
Expand Down