-
Notifications
You must be signed in to change notification settings - Fork 8
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
Code cleanup #133
Code cleanup #133
Conversation
- Force typing instead of Object everywhere - test for NPE in some forgotten cases - Fix cast to NormStatement instead of Norm which resulted in runtime errors in probabilistic mode
Removes useless casts
- change division types inside Math.round to double so it's floating point division and not int - convert Math.round results from long to int to fit the rest of the program - removes useless Math.round (Once used as a cast to an int and the others probably as legacy)
- uses the equals method to compare objects of class Double instead of == - changes hard to read streams to get min and max by Collections.min and Collections.max
It was not set anywhere
- avoid NPE in some cases - move the code outside of any condition so the vertexSpecies is set no matter what
Because we already have the clone method so there's no reason not using the known interface
same reason as for GamaPoint
- use standard java casing - some light comments improvements - use of a record instead of a class for DisplayParametersStructure - adding some final modifiers when it makes sense
- revert the record to use a static class instead - renaming to follow java conventions - "optimize" float parsing - simplifies some code
- use StringBuilder in loops - replace new String() by constant ""
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
gama.core/src/gama/core/kernel/batch/exploration/sobol/SobolExploration.java
Show resolved
Hide resolved
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 116 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 118 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
- prevents a potential NPE + fixes a logical bug in bdi - iterates over sets with entrySet instead of keySet when values are needed - removes an unused variable in imagelayer - switches a boxed variable to int in masked_by operator - removes the fake bug for spotbugs to pickup on in LoopStatement
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 118 findings(s) 🚩
- Improving Code Health: 238 findings(s) ✅
- Affected Hotspots: 8 files(s) 🔥
I'm currently cleaning the code base helped by spotbugs and other code-analysis tools.
Feel free to participate if you want.
Also the scope of this rework is super wide so do not hesitate to review the parts of the code you have some knowledge over as I may (and surely will) introduce new bugs.