ali92hm / halloween-tower-defense Goto Github PK
View Code? Open in Web Editor NEWA halloween themed tower defense game written in Java
License: MIT License
A halloween themed tower defense game written in Java
License: MIT License
Hello,
I have reviewed your project and I found the communication in your classes interesting. One of those classes is DriverModels where it has some responsibilities and is very extensive which is a code smells. But the main problem is having variables of different responsibilities within the class, I attach an image of the class diagram of the mentioned class
As you can see, you have many methods and many attributes. One of my solutions is to move the data as life and money to a new class called DataGame, which is in charge of handling that, plus the logic of increasing or decreasing money. I attach an image of the class diagram of the mentioned class
Hello again,
Reviewing the attached class above it is still very extensive, so we have to decrease it more because internally it still has many responsibilities that do not correspond to it, which were not completely eliminated with the previous refactoring, because of this we will use another refactoring to decrease it again , I attach an image of the class diagram of the mentioned class.
As I mentioned earlier, the best option is to use another refactoring, this is where the utility class that it has with a single method comes in, to give it more use, we give it the methods that stopped a thread or started it, so that any graphic class can do it.
Thanks for the attention friend.
Hello there.
I noticed your code has some problems about SOLID principles, so I made a report about how you can improve it along with the parts where it happens. Hope this helps you to improve!
Have a nice day!
OCP - How to Improve.docx
Hello one more time,
Reviewing the previously attached class it is still a bit long, so we have to decrease it a little more because internally it has attributes that do not correspond to it, despite all the refactoring used, because of this we will use a last refactoring to Totally decrease the class, I attach an image of the class diagram of the mentioned class.
As mentioned above, the best option is to use a last refactoring, reviewing the classes that it has, note that it has the Driver and MapData class that already have the same attributes or similar responsibility so we will give it the corresponding artributes, it is for these reasons that we could use the move Filds refactoring, so as not to have code redundancy.
Thanks for all the attention and patience.
Hello,
Looking through your classes I found a method called that I think the best you can do is to Substitute your Algorithm because it has Code Smells like Long Method, Message Chain, Duplicate Code. But, I could notice that the main problem is the way that it was coded. So, using Refactoring Techniques I brought an option that you could implement in your code.
So this is the method that I was analizing:
As you can see you have a very long method and duplicated code for each if statement you make.
Also you can see a lot of Message Chain in this method A -> B -> C
And this was the solution I propose:
The benefits for implementing this solution is that you no longer have a long method, your method is 10 lines long, which is accepted. Also you can see that there is no Message Chain, and this was solved by implemented some methods in the DriverView class. Making this also minimizes the coupling you had in your method.
Hope that I could help,
Have a nice one.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.