-
Notifications
You must be signed in to change notification settings - Fork 41
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
Refactor Code Smells #1603
base: develop
Are you sure you want to change the base?
Refactor Code Smells #1603
Changes from all commits
816529e
798ed05
d9ecda6
96d08b3
b20ed64
77ccc0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -108,7 +108,9 @@ const SwitchNetwork = ({ history, location }: AuthRouterParams) => { | |||||||||
return [{ label: 'NO NETWORKS AVAILABLE', isDisabled: true }]; | ||||||||||
}; | ||||||||||
|
||||||||||
const goNext = (genesisID: string | undefined) => { | ||||||||||
type GoNextType = string | undefined; | ||||||||||
|
||||||||||
const goNext = (genesisID: GoNextType) => { | ||||||||||
Comment on lines
+111
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be just
Suggested change
What is the purpose of extracting it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used a tool that my teacher recommended for detecting code smells. One of these smells was 'Missing Union Type Abstractions' which suggests using type aliases to avoid the repetition of union types. The tool is called ReactSniffer and is still in development (it's part of a research project at my university). If you have any observations about this code smell, please feel free to share them in the comments, and I'll pass them on to the responsible parties. Link: https://github.com/maykongsn/react-typescript-code-smells There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, in case these types will be used (or at least may be used or it is something tricky) — it is fine. For example, it is good to have: But having I believe that no tool can determine what exactly you need in which case (at least without some well-trained AI model), so it is good to have automatic suggestions, but afterward, the coder should make a decision on what to replace, and what to keep... Let's keep commits that fix |
||||||||||
if (creatingWallet) { | ||||||||||
if (isWalletOnly && genesisID?.length) { | ||||||||||
return history.push(AuthPath.ConnectToAPI, { | ||||||||||
|
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.
Please remove the trash code.
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.
I will make the corrections and resend. Thank you for the feedback.