forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
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
maryia/fix: sonarcloud issues on TS migration branch for package 2 #19
Merged
kate-deriv
merged 1 commit into
kate-deriv:kate/dtra-269/ts_migration_trader_package_2
from
maryia-deriv:maryia/fix-sonarcloud-issues-on-package-2
Jul 25, 2023
Merged
maryia/fix: sonarcloud issues on TS migration branch for package 2 #19
kate-deriv
merged 1 commit into
kate-deriv:kate/dtra-269/ts_migration_trader_package_2
from
maryia-deriv:maryia/fix-sonarcloud-issues-on-package-2
Jul 25, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maryia-deriv
commented
Jul 25, 2023
@@ -612,7 +611,7 @@ export const ContractType = (() => { | |||
const arr_cancellation_range: string[] = | |||
getPropertyValue(available_contract_types, [contract_type, 'config', 'cancellation_range']) || []; | |||
|
|||
const regex = new RegExp('^([0-9]+)|([a-zA-Z]+)$', 'g'); | |||
const regex = /^\d{1,}|[a-zA-Z]{1,}$/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- used a regular expression literal instead of the 'RegExp' constructor.
- replaced + with {1,} equivalent in order to prevent the regex from being vulnerable to denial of service (DoS) attacks due to backtracking.
- used concise character class syntax '\d' instead of '[0-9]'.
- removed extra brackets around 2 OR operands in order to make the intended operator precedence explicit.
Pull Request Test Coverage Report for Build 5655609946
💛 - Coveralls |
kate-deriv
approved these changes
Jul 25, 2023
kate-deriv
merged commit Jul 25, 2023
7d655a3
into
kate-deriv:kate/dtra-269/ts_migration_trader_package_2
1 check passed
kate-deriv
added a commit
that referenced
this pull request
Sep 27, 2023
…ckage (deriv-com#9284) * fix: ts-migrate screen small * fix: sass was unable to be found * chore: add key files from prev branch * chore: empty commit * Maryia/dtra-279/TS migration [Trader]: TradeModals, MarketUnavailableModal & UnsupportedContractModal (#16) * maryia/WEBREL-323/feat: ts migration of base-store (#18) * chore: start ts migration of base-store * chore: add more types to BaseStore * chore: added more types to base-store * chore: added more types to base-store * chore: finalize base-store ts migration * chore: reorder imports * Maryia/webrel-483/TS migration of ContractType function (#17) * chore: start ts migration * chore: continue ts migration of contract-types * chore: add more types to contract-types * chore: add type for getContractValues return value * chore: improve reduce types * fix: sonarcloud issues (#19) * chore: update reg exp * chore: remove code smell * chore: remove security hotspot * chore: update reg exp * chore: update reg exp to prev version * fix: conflict * fix: ts error * refactor: apply suggestions * fix: resolve more conflicts * fix: conflicts in start date * fix: type of onchangestartdate * fix: type of contract cat list in usetraderstore * fix: types in contract type and allow equals * refactor: aplly part of suggestions * refactor: remove unused type * refactor: remove wrong types * refactor: types of time * refactor: revert changes * chore: empty commit * fix: more conflicts --------- Co-authored-by: Henry Hein <henry@regentmarkets.com> Co-authored-by: Akmal Djumakhodjaev <akmal@binary.com> Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
Please provide a summary of the change.
Screenshots:
Please provide some screenshots of the change.