Skip to content

Commit

Permalink
Sonar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenv-locus committed Sep 10, 2024
1 parent ec9088b commit 9bcac7d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dfs_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Global variables to store schema data
TYPE_LIJST = dict()
dov_schema_id = None

DEFAULT_TYPE = "java.lang.Object"

def init(config_filename="xsd_schema.json") -> None:
"""
Expand Down Expand Up @@ -75,7 +75,7 @@ def set_metadata(self, metadata: dict) -> None:

bindings = [restriction['binding'] for restriction in self.constraints if 'binding' in restriction]

self.binding = 'java.lang.Object' if not bindings else bindings[0]
self.binding = DEFAULT_TYPE if not bindings else bindings[0]

def __str__(self) -> str:
return f'Node(name="{self.name}", {self.min_amount}..{self.max_amount})'
Expand Down Expand Up @@ -224,7 +224,7 @@ def create_dfs_schema(node, old_node: Node = None) -> Node:
'anyURI': 'java.net.URI',
'time': 'java.sql.Time',
'dateTime': 'java.sql.Timestamp',
None: 'java.lang.Object'}
None: DEFAULT_TYPE}


def get_content(current_type):
Expand Down Expand Up @@ -302,7 +302,7 @@ def recursive_fill(current_node, current_type):
current_node.children.append(recursive_fill(child_node, child_type))

if not isinstance(current_node, ChoiceNode) and not isinstance(current_node, SequenceNode):
current_node.binding = 'java.lang.Object'
current_node.binding = DEFAULT_TYPE
if not content:
try:
current_node.binding = get_binding(current_type)
Expand Down

0 comments on commit 9bcac7d

Please sign in to comment.