Skip to content

Commit

Permalink
chore(DataMapper): Fix SonarCloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
igarashitm committed Dec 9, 2024
1 parent 909bf55 commit ea7cc63
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/services/document.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class DocumentService {
if (!schemaFilePaths || schemaFilePaths.length === 0) return;
const fileContents: Record<string, string> = {};
const fileContentPromises: Promise<void>[] = [];
schemaFilePaths.map((path: string) => {
schemaFilePaths.forEach((path: string) => {
const promise = api.getResourceContent(path).then((content: string | undefined) => {
if (content) fileContents[path] = content;
});
Expand Down Expand Up @@ -60,7 +60,7 @@ export class DocumentService {
if (document) answer.sourceBodyDocument = document;
}
if (initModel.sourceParameters) {
Object.entries(initModel.sourceParameters).map(([key, value]) => {
Object.entries(initModel.sourceParameters).forEach(([key, value]) => {
const document = DocumentService.createDocument(value);
answer.sourceParameterMap.set(key, document ? document : new PrimitiveDocument(DocumentType.PARAM, key));
});
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/services/mapping.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export class MappingService {
answer.push(...MappingService.doExtractMappingLinks(item, targetNodePath, sourceParameterMap, sourceBody));
}
if ('children' in item) {
item.children.map((child) => {
item.children.forEach((child) => {
if (
item instanceof FieldItem &&
!(item.field.ownerDocument instanceof PrimitiveDocument) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const BrowserFilePickerMetadataProvider: FunctionComponent<PropsWithChild
if (!schemaFiles) return;
const fileContents: Record<string, string> = {};
const fileContentPromises: Promise<string>[] = [];
Array.from(schemaFiles).map((f) => {
Array.from(schemaFiles).forEach((f) => {
const promise = readFileAsString(f).then((content) => (fileContents[f.name] = content));
fileContentPromises.push(promise);
});
Expand Down
6 changes: 2 additions & 4 deletions packages/xml-schema-ts/src/SchemaBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1134,14 +1134,12 @@ export class SchemaBuilder {
}
}

private handleElementForm(el: Element, element: XmlSchemaElement, isQualified: boolean) {
private handleElementForm(el: Element, element: XmlSchemaElement, _isQualified: boolean) {
if (el.hasAttribute('form')) {
const formDef = el.getAttribute('form')!;
element.setForm(xmlSchemaFormValueOf(formDef));
}
isQualified = element.getForm() == XmlSchemaForm.QUALIFIED;

return isQualified;
return element.getForm() == XmlSchemaForm.QUALIFIED;
}

private handleElementGlobalType(el: Element, element: XmlSchemaElement) {
Expand Down

0 comments on commit ea7cc63

Please sign in to comment.