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

init #4941

Merged
merged 30 commits into from Feb 7, 2024
Merged

init #4941

merged 30 commits into from Feb 7, 2024

Conversation

hitchikermn
Copy link
Collaborator

sync polaris

Copy link

gitguardian bot commented Feb 1, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9241816 Triggered Generic High Entropy Secret 538941e packages/plugin-syncpolaris-api/src/utils/utils.ts View secret
9241816 Triggered Generic High Entropy Secret cfe94cb packages/plugin-syncpolaris-api/src/utils/utils.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

PR Type: Enhancement

PR Summary: The pull request introduces enhancements to the contracts form component, including improved optional chaining for better null safety, mapping of weekend values to numbers, and handling of custom payment values. It also includes updates to the GraphQL resolvers and configurations for the ZMS plugin.

Decision: Comment

📝 Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
  • Unsupported files: the diff contains files that Sourcery does not currently support during reviews.
  • Big diff: the diff is too large to approve with confidence.

General suggestions:

  • Verify TypeScript version compatibility for the use of optional chaining with array index access to ensure it is supported.
  • Add checks to ensure that the 'weekends' array does not contain null or undefined values before converting them to numbers to prevent runtime errors.
  • Consider using the nullish coalescing operator instead of the logical OR for default values to correctly handle cases where '0' is a valid value.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -154,7 +156,7 @@ class ContractForm extends React.Component<Props, State> {
customInterest: contract.customInterest || 0,
customPayment: contract.customPayment || 0,
currency:
contract.currency || this.props.currentUser.configs?.dealCurrency[0],
contract.currency || this.props.currentUser?.configs?.dealCurrency?.[0],
Copy link

Choose a reason for hiding this comment

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

issue (llm): The use of optional chaining with array index access should be verified for TypeScript version compatibility. If the project's TypeScript version is below 3.7, this syntax will not be supported.

@@ -232,7 +234,7 @@
leaseType: this.state.leaseType,
savingContractId: this.state.savingContractId,
commitmentInterest: this.state.commitmentInterest,
weekends: this.state.weekends.map(week => Number(week)),
weekends: this.state.weekends.map((week) => Number(week)),
Copy link

Choose a reason for hiding this comment

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

issue (llm): Ensure that the 'weekends' array cannot contain null or undefined values which could cause runtime errors when calling 'Number' on them.

);
const customPayment = Number(
name === 'customPayment' ? value : this.state.customPayment || 0
name === 'customPayment' ? value : this.state.customPayment || 0,
Copy link

Choose a reason for hiding this comment

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

suggestion (llm): The logical OR operator might lead to unexpected results if 'this.state.customPayment' is 0. Consider using nullish coalescing operator (??) to handle 0 as a valid value.

Copy link

sonarcloud bot commented Feb 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

28.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@munkhsaikhan munkhsaikhan merged commit 5ed2da9 into dev Feb 7, 2024
10 of 12 checks passed
@munkhsaikhan munkhsaikhan deleted the syncpolaris branch February 7, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants