Fixed code smell 'Update this function so that its implementation is not identical' reported by SonarQube.

This commit is contained in:
Akshay Joshi
2022-01-25 20:10:31 +05:30
parent 094129e2be
commit 0ce3434631
33 changed files with 603 additions and 1055 deletions

View File

@@ -27,6 +27,14 @@ export class RestoreSectionSchema extends BaseUISchema {
return 'id';
}
isDisabled(state) {
return this.selectedNodeType !== 'function' &&
this.selectedNodeType !== 'table' &&
this.selectedNodeType !== 'trigger' &&
this.selectedNodeType !== 'trigger_function' &&
(state.only_data || state.only_schema);
}
get baseFields() {
let obj = this;
return [{
@@ -36,10 +44,7 @@ export class RestoreSectionSchema extends BaseUISchema {
group: gettext('Sections'),
deps: ['only_data', 'only_schema'],
disabled: function(state) {
return obj.selectedNodeType !== 'function' && obj.selectedNodeType !== 'table' &&
obj.selectedNodeType !== 'trigger' &&
obj.selectedNodeType !== 'trigger_function' &&
(state.only_data || state.only_schema);
return obj.isDisabled(state);
},
}, {
id: 'data',
@@ -48,11 +53,7 @@ export class RestoreSectionSchema extends BaseUISchema {
group: gettext('Sections'),
deps: ['only_data', 'only_schema'],
disabled: function(state) {
return obj.selectedNodeType !== 'function' &&
obj.selectedNodeType !== 'table' &&
obj.selectedNodeType !== 'trigger' &&
obj.selectedNodeType !== 'trigger_function' &&
(state.only_data || state.only_schema);
return obj.isDisabled(state);
},
}, {
id: 'post_data',
@@ -61,11 +62,7 @@ export class RestoreSectionSchema extends BaseUISchema {
group: gettext('Sections'),
deps: ['only_data', 'only_schema'],
disabled: function(state) {
return obj.selectedNodeType !== 'function' &&
obj.selectedNodeType !== 'table' &&
obj.selectedNodeType !== 'trigger' &&
obj.selectedNodeType !== 'trigger_function' &&
(state.only_data || state.only_schema);
return obj.isDisabled(state);
},
}];
}