SpoonLabs / astor

Automatic program repair for Java with generate-and-validate techniques :v::v:: jGenProg (2014) - jMutRepair (2016) - jKali (2016) - DeepRepair (2017) - Cardumen (2018) - 3sfix (2018)
https://hal.archives-ouvertes.fr/hal-01321615/document
GNU General Public License v2.0
207 stars 106 forks source link

Refactored small part of code according to standard quality rules #247

Closed MaximoOliveira closed 4 years ago

MaximoOliveira commented 4 years ago

Made minor changes that impact the code readability and quality according to rules from https://rules.sonarsource.com/

Code smells with Minor, Major and Critical severity were found.

This is about 10% of the total code smells found and fixed

Based on the feedback from this PR I will determine if I continue fixing the rest of the code!

Primitives should not be boxed just for "String" conversion: https://rules.sonarsource.com/java/RSPEC-2131

Constructors should not be used to instantiate "String", "BigInteger", "BigDecimal" and primitive-wrapper classes: https://jira.sonarsource.com/browse/RSPEC-2129

Collapsible "if" statements should be merged: https://jira.sonarsource.com/browse/RSPEC-1066

Strings should not be concatenated using '+' in a loop: https://rules.sonarsource.com/java/RSPEC-1643

Local variables should not be declared and then immediately returned or thrown: https://rules.sonarsource.com/java/RSPEC-1488?search=returned

"@Override" should be used on overriding and implementing methods: https://rules.sonarsource.com/java/RSPEC-1161?search=override

The diamond operator ("<>") should be used: https://rules.sonarsource.com/java/RSPEC-2293?search=the%20diamond%20operator

martinezmatias commented 4 years ago

Dear @MaximoOliveira Thanks a lot for the PR. We appreciate the contribution. However, we cannot merge the PR for the following main issues: 1) the PR is too large, it modifies many files which is hard for us to manually inspect and review. 2) We "improve" the code of a file while we modify it for incorporating a new feature or a bug fixing. 3) We are not strict of the used of some conventions dictated by SonarSource (e.g., as you mentioned, diamont or inline variables).

Regards Matias