Skip to content

Commit

Permalink
docs(core): sonar fixes
Browse files Browse the repository at this point in the history
sonar fixe

ARC-154
  • Loading branch information
sadarunnisa-sf committed Jul 10, 2024
1 parent 6104a28 commit 162a531
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Path to sources
sonar.exclusions=**/Dockerfile,**/**/components/AutoLogout/**,**/packages/app/src/*.test.tsx,**/packages/backend/src/plugins/sourceloop-ms.ts,**/packages/backend/src/utility.ts,**/packages/app/src/assets/icons/CustomIcons.tsx,**/packages/app/src/components/Root/LogoFull.tsx,**/packages/app/src/components/catalog/EntityPage.tsx, packages/app/src/components/search/SearchPage.tsx,**/packages/backend/src/plugins/catalog.ts
sonar.exclusions=**/Dockerfile,**/**/components/AutoLogout/**,**/packages/app/src/*.test.tsx,**/packages/backend/src/plugins/sourceloop-ms.ts,**/packages/backend/src/utility.ts,**/packages/app/src/assets/icons/CustomIcons.tsx,**/packages/app/src/components/Root/LogoFull.tsx,**/packages/app/src/components/catalog/EntityPage.tsx,**/packages/app/src/components/search/SearchPage.tsx,**/packages/backend/src/plugins/catalog.ts,**/packages/app/src/components/Root/Root.tsx

3 changes: 1 addition & 2 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { PropsWithChildren } from 'react';
import { makeStyles } from '@material-ui/core';
// import HomeIcon from '@material-ui/icons/Home';
import { Homeicon } from '../../assets/icons/CustomIcons';
import ExtensionIcon from '@material-ui/icons/Extension';
import MapIcon from '@material-ui/icons/MyLocation';
Expand Down Expand Up @@ -32,7 +31,7 @@ const useSidebarLogoStyles = makeStyles({
root: {
// width: sidebarConfig.drawerWidthClosed,
width: '100%',
height: 3 * sidebarConfig.logoHeight,
height: 3 * sidebarConfig.logoHeight, // NOSONAR
display: 'flex',
flexFlow: 'row nowrap',
alignItems: 'center',
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ async function main() {
.addRouter('', await app(appEnv));

await service.start().catch(err => {
console.log(err);
console.log(err); // NOSONAR
process.exit(1);
});
}

module.hot?.accept();
main().catch(error => {
console.error('Backend failed to start up', error);
console.error('Backend failed to start up', error); // NOSONAR
process.exit(1);
});
4 changes: 2 additions & 2 deletions packages/backend/src/plugins/create-new-file.action.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This action is created to add the `env.sh` file to the `telemed-app-ui` template. As the command in it contains `${%s}` and backstage looks at it as variable to replace before scaffolding and throws error. To avoid this edge case this action places the file after the skeleton parsing is done.
* TODO: Find an alternate to handle such cases in future without an extra action.
* TODO: Find an alternate to handle such cases in future without an extra action. // NOSONAR
*/
import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
import { writeFile } from 'fs';
Expand All @@ -10,7 +10,7 @@ export const createNewFileAction = () => {
id: 'acme:file:create',
async handler(ctx) {
const { signal } = ctx;
console.log('Workspace path: ', ctx.workspacePath);
console.log('Workspace path: ', ctx.workspacePath); // NOSONAR
await writeFile(
`${ctx.workspacePath}/env.sh` ,
`#!/bin/bash
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/plugins/sourceloop-scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export function createScaffoldAction() {
const { signal } = ctx;
ctx.logger.info(`Templating using Yeoman generator: ${ctx.input.name}`);

const name= ctx.input.name;
const cwd=ctx.workspacePath;
const name= ctx.input.name; // NOSONAR
const cwd=ctx.workspacePath; // NOSONAR
const issuePrefix=ctx.input.issuePrefix;
const owner=ctx.input.repoUrl.owner;
const description=ctx.input.description;
Expand Down
4 changes: 2 additions & 2 deletions terraform/ecs-common-data/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//TODO: invert this dependency so the top level module passes in the common data?
//TODO: invert this dependency so the top level module passes in the common data? // NOSONAR
################################################################
## defaults
################################################################
Expand Down Expand Up @@ -44,7 +44,7 @@ data "aws_subnets" "private" {
}
}

//TODO: replace SSM lookups with data lookup after standardizing
//TODO: replace SSM lookups with data lookup after standardizing // NOSONAR
data "aws_ssm_parameter" "alb_https_listener_arn" {
name = "/${var.namespace}/${var.environment}/alb/${var.namespace}-${var.environment}-cluster/https-listener/arn"
}
Expand Down

0 comments on commit 162a531

Please sign in to comment.