Skip to content
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

[EC82] Variable can be made constant #285

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

Djoums
Copy link
Contributor

@Djoums Djoums commented Apr 2, 2024

Variable is never reassigned and can be made constant.

@@ -57,6 +57,7 @@ Some are applicable for different technologies.
| EC78 | Const parameter in batch update | Don't set const parameter in batch update => Put its in query. Creating this parameter and destroying it consumes CPU cycles and RAM unnecessarily. | | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
| EC79 | Free resources | try-with-resources Statement needs to be implemented for any object that implements the AutoCloseable interface, it save computer resources. | | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
| EC81 | Specify struct layouts | When possible, specify struct layouts to optimize their memory footprint | | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | ✅ |
| EC82 | Make variable constant | A variable is never reassigned and can be made constant. | | 🚀 | 🚀 | 🚀 | 🚀 | 🚀 | ✅ |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like you added rockets 🚀 to the EC203 rule (that was 🚫 everywhere before)
And on the new rule EC82, everything is 🚫 excepted the last column.
Is it normal ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind, i think the review screen make me confuse. after checking, it seems good

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you put 🚀 in all columns mean that this rule can be implemented in all languages. It is possible to implement it in all others languages than c# ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EC203 is unchanged, on line 61 now.
EC82 has 🚀 everywhere because it should be applicable in every language, except for C# that has ✅ because the code is ready, just waiting for this PR validation first.

@@ -57,6 +57,7 @@ Some are applicable for different technologies.
| EC78 | Const parameter in batch update | Don't set const parameter in batch update => Put its in query. Creating this parameter and destroying it consumes CPU cycles and RAM unnecessarily. | | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
| EC79 | Free resources | try-with-resources Statement needs to be implemented for any object that implements the AutoCloseable interface, it save computer resources. | | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
| EC81 | Specify struct layouts | When possible, specify struct layouts to optimize their memory footprint | | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | ✅ |
| EC82 | Make variable constant | A variable is never reassigned and can be made constant. | | 🚀 | 🚀 | 🚀 | 🚀 | 🚀 | ✅ |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind, i think the review screen make me confuse. after checking, it seems good

@@ -57,6 +57,7 @@ Some are applicable for different technologies.
| EC78 | Const parameter in batch update | Don't set const parameter in batch update => Put its in query. Creating this parameter and destroying it consumes CPU cycles and RAM unnecessarily. | | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
| EC79 | Free resources | try-with-resources Statement needs to be implemented for any object that implements the AutoCloseable interface, it save computer resources. | | ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
| EC81 | Specify struct layouts | When possible, specify struct layouts to optimize their memory footprint | | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | ✅ |
| EC82 | Make variable constant | A variable is never reassigned and can be made constant. | | 🚀 | 🚀 | 🚀 | 🚀 | 🚀 | ✅ |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you put 🚀 in all columns mean that this rule can be implemented in all languages. It is possible to implement it in all others languages than c# ?

@Djoums Djoums merged commit d5896f3 into main Apr 3, 2024
1 check passed
@Djoums Djoums deleted the rule/EC82_VariableCanBeMadeConstant branch April 3, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants