Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCK-7070: fix sonar reports #102

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion forward_engineering/helpers/commentIfDeactivated.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const BEFORE_DEACTIVATED_STATEMENT = '-- ';
const REG_FOR_MULTYLINE_COMMENT = /(\n\/\*\n[\s\S]*?\n\s\*\/\n)|(\n\/\*\n[\s\S]*?\n\s\*\/)$/gi;
const REG_FOR_MULTYLINE_COMMENT = /(\n\/\*\n[\s\S]*?\n\s\*\/\n)$|(\n\/\*\n[\s\S]*?\n\s\*\/)$/gi;

const commentIfDeactivated = (statement, data, isPartOfLine) => {
if (data?.hasOwnProperty('isActivated') && !data.isActivated) {
Expand Down
2 changes: 1 addition & 1 deletion forward_engineering/helpers/indexHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ module.exports = app => {

const createTableIndex = (terminator, tableName, index, isParentActivated) => {
if (index.type === 'spatial') {
return createSpatialIndex(terminator, tableName, index, isParentActivated);
return createSpatialIndex(terminator, tableName, index);
} else if (index.type === 'fulltext') {
return createFullTextIndex(terminator, tableName, index);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const reorderTableRows = (tableRows, isFieldOrderAlphabetic) => {
return tableRows;
}

const reorderedFieldNames = Object.keys(tableRows[0]).sort();
const reorderedFieldNames = Object.keys(tableRows[0]).sort((a, b) => a?.localeCompare?.(b));
return tableRows.map(row =>
Object.values(row).reduce(
(columns, columnValue, i) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const handleDefault = (typeObject, value) => {

const validValue = {
numeric: Number(value.replace(/(^\(\()|(\)\)$)/g, '')),
char: value.replace(/(^\(\')|(\'\))$/g, ''),
xml: value.replace(/(^\(N\')|(\'\))$/g, ''),
char: value.replace(/(^\(')$|('\))$/g, ''),
xml: value.replace(/(^\(N')$|('\))$/g, ''),
}[typeObject.type];

return { default: validValue !== undefined ? validValue : value };
Expand Down