mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed the following SonarQube code smells:
1) Do not use the Array index in keys. 2) Import from the same module should be merged. 3) Mutable variables should not be exported. 4) Variables should not be initialized to undefined. 5) startswith or endswith method should be used. 6) Unwrap this unnecessarily grouped subpattern. Additionally, addressed many other SonarQube rules.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
import * as Node from 'pgbrowser/node';
|
||||
import * as SchemaTreeNode from './schema_child_tree_node';
|
||||
|
||||
let SchemaChildNode = Node.extend({
|
||||
const SchemaChildNode = Node.extend({
|
||||
parent_type: ['schema', 'catalog'],
|
||||
canDrop: SchemaTreeNode.isTreeItemOfChildOfSchema,
|
||||
canDropCascade: SchemaTreeNode.isTreeItemOfChildOfSchema,
|
||||
|
||||
@@ -587,7 +587,7 @@ export default class ColumnSchema extends BaseUISchema {
|
||||
}
|
||||
|
||||
validate(state, setError) {
|
||||
let msg = undefined;
|
||||
let msg;
|
||||
|
||||
if (!_.isUndefined(state.cltype) && !isEmptyString(state.attlen)) {
|
||||
// Validation for Length field
|
||||
|
||||
@@ -527,7 +527,7 @@ def parse_rule_definition(res):
|
||||
condition_part = condition_part_match.group(1)
|
||||
|
||||
condition_match = re.search(
|
||||
r"(?:WHERE)\s+(\([\s\S]*\))\s+(?:DO)", condition_part)
|
||||
r"(?:WHERE)?\s+(\([\s\S]*\))\s+(?:DO)?", condition_part)
|
||||
|
||||
if condition_match is not None:
|
||||
condition = condition_match.group(1)
|
||||
@@ -537,7 +537,7 @@ def parse_rule_definition(res):
|
||||
|
||||
# Parse data for statements
|
||||
statement_match = re.search(
|
||||
r"(?:DO\s+)(?:INSTEAD\s+)?([\s\S]*)(?:;)", data_def)
|
||||
r"(?:DO\s+)?(?:INSTEAD\s+)?([\s\S]*)(?:;)?", data_def)
|
||||
|
||||
statement = ''
|
||||
if statement_match is not None:
|
||||
|
||||
Reference in New Issue
Block a user