mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed following code smells reported by SonarQube:
1) Immediately return this expression instead of assigning it to the temporary variable. 2) Extract this nested ternary operation into an independent statement. 3) Expected a `for-of` loop instead of a `for` loop with this simple iteration.
This commit is contained in:
@@ -86,10 +86,22 @@ function get_function_name(function_name) {
|
||||
}
|
||||
return func_name;
|
||||
}
|
||||
function getAppropriateLabel(treeInfo) {
|
||||
if (treeInfo.function) {
|
||||
return treeInfo.function.label;
|
||||
} else if (treeInfo.trigger_function) {
|
||||
return treeInfo.trigger_function.label;
|
||||
} else if (treeInfo.trigger) {
|
||||
return treeInfo.trigger.label;
|
||||
} else {
|
||||
return treeInfo.procedure.label;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setFocusToDebuggerEditor: setFocusToDebuggerEditor,
|
||||
getFunctionId: getFunctionId,
|
||||
getProcedureId: getProcedureId,
|
||||
setDebuggerTitle: setDebuggerTitle,
|
||||
getAppropriateLabel: getAppropriateLabel,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user