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

docs(core): sonar fixes #180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 .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
Loading