robotcoral/coral-app

View on GitHub
src/app/common/settings.service.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 3 of 3 total issues

Function repairInvalidSettings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

repairInvalidSettings() {
if (
!Object.values(THEMES || 'auto').includes(
this.settings.globalSettings.theme
)
Severity: Minor
Found in src/app/common/settings.service.ts - About 25 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (touchUIActive != this.settings.globalSettings.touchUIActive) {
this.settings.globalSettings.touchUIActive = touchUIActive;
this.applyTouchUI();
}
Severity: Minor
Found in src/app/common/settings.service.ts and 1 other location - About 50 mins to fix
src/app/common/settings.service.ts on lines 282..285

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (language != this.settings.globalSettings.language) {
this.settings.globalSettings.language = language;
this.applyLanguage();
}
Severity: Minor
Found in src/app/common/settings.service.ts and 1 other location - About 50 mins to fix
src/app/common/settings.service.ts on lines 286..289
Category
Status