-
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
Improving code quality with SonarCloud #5
Conversation
A Random object should be only initialized once for better efficiency and randomness.
Commented out program logic should not persist inside the finished code.
Try-with-resource pattern added.
A Random object should be only initialized once for better efficiency and randomness.
A Random object should be only initialized once for better efficiency and randomness. I also fixed a typo where I left the out the class type in Pipe.java.
It has been renamed to NotifyAllTimePassed to prevent confusion with Object.noifyAll method.
If there would be multiple threads, this is the safe way.
It was too complex, too long and was overwhelming. I have added several assistant method to fix this problem.
To avoid confusion with a filed of Component class.
To we don't have to duplicate its path in the methods.
Explaining why the method is empty.
It was too complex, too long and was overwhelming. I have added several assistant method to fix this problem.
It was too complex, too long and was overwhelming. I have added several assistant method to fix this problem.
To improve readability and to reduce the complexity of the method.
It has been to complex, several assistant methods have been added. I also added an error message constant to reduce code duplication.
Readability improvid, it was too complex, so I made several helper methods to fix this issue.
I also added comments to the unused methods.
It was too long and was to confusing. I added several sub-methods and also removed unnecessary nesting.
string -> String (Java) Too much C# lately. Also added const keyword.
Too much C# as I have said.
Fixed the Maven build errors. There were several small bugifixes.
Quality Gate failedFailed conditions |
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 checked the changes, everything seems fine.
} | ||
}catch (NumberFormatException e){System.out.println("Rossz parametert adtal meg");} | ||
// Végigmegyünk az összes játékoson, és feldolgozzuk a körüket mint Szabotőr | ||
for (int i = 0; i < NumberOfPlayers; i++) { |
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.
Much easier to read this code
@gerencsermate have reviewed my work. I will merge this branch into main. |
I have fixed the high severity cases of reliability and maintainability according to SonarCloud. They did prove to be real concerns, so I made the changes accordingly. This included the following changes:
RCIR -> reduce complexity, increase readability
Cisterns.java
Game.java
GameView.java
Mountains.java
Pipe.java
PipeView.java
Player.java
TableView.java
View.java