-
Notifications
You must be signed in to change notification settings - Fork 23
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
Refactored code to resolve implementation as well as design smells and increase maintainability. #233
Conversation
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.
Thanks a lot for your PR!
If you are interested in larger PRs check out these issues:
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.
These names are long yes, but because they follow a standard like all the other fields in this class, which is to represent the yaml keys. Please revert these.
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.
are all those extra imports are needed?
} | ||
|
||
@Test | ||
public void testTextIsClearedOnFocus() { |
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.
this isn't an existing feature, this test isnt needed
pom.xml
Outdated
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.
List<File> filesToSendTo = new ArrayList<>(); | ||
//List<String> ipsToSendTo = new ArrayList<>(); |
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.
keep these comments since they are relevant for future feature implementations
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.
Thank you so much for reviewing my pull request!
I will look into the code again considering the changes you suggested!
I have made the suggested changes to the code and have committed them. Could you please review them? |
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.
Sorry, I somehow forgot to review this.
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.
revert this.
only functions strictly related to the config should be allowed here.
private static MinecraftMod initializeMinecraftMod(File modsDir, String tempName, String input) { | ||
MinecraftMod mod = new MinecraftMod(new File(modsDir + "/" + tempName).getAbsolutePath(), tempName, "0", "", | ||
"0", "0", ""); | ||
String repo; |
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.
must be initialized: String repo = "modrinth";
|
||
try { // SPIGOT |
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.
keep these comments
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.
the FileManager is basically a FileSearcher, no need to split that up, or if you really want to split it up, make each method into its own class, because yes they are pretty long.
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.
these changes I really like, good job
|
||
Consumer<FileEvent> onFileChangeEvent = event -> { | ||
private Consumer<FileEvent> defineFileChangeEventHandler(List<File> filesToSendTo) { |
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.
shorter: createFileChangeListener
@@ -64,7 +64,7 @@ public boolean open() throws Exception { | |||
} else if (requestType == 6) { | |||
doProtocolForCopyOrCutFiles(); | |||
} else if (requestType == 7) { | |||
doProtocolForSendingRoots(); | |||
FileSystemUtils.sendRoots(dos); |
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.
previous way was fine, no need to split into another class, since this is more related to connection stuff, than filesystem stuff
} else { | ||
AL.warn("The selected theme '" + generalConfig.autoplug_system_tray_theme.asString() + "' is not a valid option! Using default."); | ||
if (!FlatLightLaf.setup()) throw new Exception("Returned false!"); | ||
ThemeSetup themeSetup = getThemeSetup(generalConfig.autoplug_system_tray_theme.asString()); |
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.
yes its nicer, but if you compare the additional amount of code needed before this, I don't think its better.
revert.
@Drashti2608 any news? |
I introduced below given test cases utilizing Mockito to enhance the testing coverage of the project.
Furthermore, I have also attempted to remove some of the implementation code smells by performing below given methods.
I have used 'Designite' tool to detect the smells present in the code.
In further refactoring I have performed below given methods to resolve the design smells present in the code: