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

#1966 - Fix sonarcloud critical and major issues (part 1) #1969

Merged
merged 5 commits into from
May 29, 2023

Conversation

sh16011993
Copy link
Collaborator

@sh16011993 sh16011993 commented May 26, 2023

This PR addresses the following sonarcloud critical issues:

  • Change var to use const or let.
  • Provide a comparator as an argument to the sort function.

@sh16011993 sh16011993 linked an issue May 26, 2023 that may be closed by this pull request
@sh16011993 sh16011993 self-assigned this May 26, 2023
@sh16011993 sh16011993 added the Sonar Involves fixing sonar related issues label May 26, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The javascript files inside the BPMN are legacy javascript files and they must be ES5 compliant so they should not be changed. Please revert these changes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned by @andrewsignori-aot , these files created as a part of a helper js in bpmn should not be changed. Please revert, thanks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -81,7 +81,13 @@ export abstract class SFTPIntegrationBase<DownloadType> {

return filesToProcess
.map((file) => path.join(remoteDownloadFolder, file.name))
.sort();
.sort((file1: string, file2: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be simplified and still be Sonarcloud compatible, IMO.

.map((file) => path.join(remoteDownloadFolder, file.name))
.sort((a, b) => a.localeCompare(b));

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into Sonarcloud issues. Please take a look at the comments.

@andrewsignori-aot
Copy link
Collaborator

This PR addresses the following sonarcloud critical issues:

  • Change var to use const or let.
  • Provide a comparator as an argument to the sort function.

The following critical sonar issue has not been addressed as a part of this PR:

  • Refactor function to reduce its Cognitive Complexity from 19 to the 15 allowed.

Is the last item in the description part of this PR? If not, please remove it.

@dheepak-aot
Copy link
Collaborator

Thanks for taking care of Sonar code quality issues. Please revert the changes on workflow/*.js files as mentioned by other devs.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 17.69% ( 2060 / 11648 )
Methods: 7.9% ( 118 / 1494 )
Lines: 20.47% ( 1809 / 8837 )
Branches: 10.1% ( 133 / 1317 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 49.81% ( 267 / 536 )
Methods: 41.56% ( 32 / 77 )
Lines: 55.33% ( 218 / 394 )
Branches: 26.15% ( 17 / 65 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 69.4% ( 390 / 562 )
Methods: 59.15% ( 42 / 71 )
Lines: 71.52% ( 344 / 481 )
Branches: 40% ( 4 / 10 )

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work @sh16011993

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the changes, looks good 👍

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 43.42% ( 3022 / 6960 )
Methods: 37.65% ( 340 / 903 )
Lines: 48.52% ( 2521 / 5196 )
Branches: 18.7% ( 161 / 861 )

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@sh16011993 sh16011993 merged commit 7c0bca4 into main May 29, 2023
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 21:58 — with GitHub Actions Inactive
@sh16011993 sh16011993 deleted the 1966_fix_sonarcloud_critical_issues branch May 29, 2023 21:58
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 21:58 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 21:58 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 21:58 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 21:58 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 21:58 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 22:10 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 22:11 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 22:11 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 22:11 — with GitHub Actions Inactive
@sh16011993 sh16011993 temporarily deployed to DEV May 29, 2023 22:11 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sonar Involves fixing sonar related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix SonarCloud critical and major Issues
5 participants