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

Remove groovy rule EC5003 since it is not in the best practices anymore. #89

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#80](https://github.com/green-code-initiative/ecoCode-android/issues/80) Delete rule EC5002 (SDK range) since it not in
the [best practices mobile](https://github.com/cnumr/best-practices-mobile) anymore
- [#88](https://github.com/green-code-initiative/ecoCode-android/issues/88) Delete rule EC5003 (Disable obfuscation) since it not in
the [best practices mobile](https://github.com/cnumr/best-practices-mobile) anymore

## [1.1.0] - 2023-11-17

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
ruleKey;remediationFunction;remediationFactor
EC5001;linear;1h
EC5003;linear;10min
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
EC5001
EC5003
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,4 @@
]]></description>
<tag>code-smell</tag>
</rule>

<!-- since 2.2.3 -->
<rule>
<key>EC5003</key>
<severity>MINOR</severity>
<name><![CDATA[Disable Obfuscation]]></name>
<internalKey><![CDATA[EC5003]]></internalKey>
<description><![CDATA[<p>Using minifyEnabled true will obfuscate code and will have a sligthly negative impact on power consumption at runtime.</p>
<p>Example of violations:</p>
<pre><code> android {
compileSdk 32

defaultConfig {
applicationId &quot;com.example.sampleForSonar&quot;
minSdkVersion 28
targetSdkVersion 32
versionCode 1
versionName &quot;1.0&quot;
testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
</code></pre>
]]></description>
<tag>code-smell</tag>
</rule>

</rules>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public void test() {
assertThat(repository.language()).isEqualTo(Groovy.KEY);

List<Rule> rules = repository.rules();
assertThat(rules).hasSize(2);
assertThat(rules).hasSize(1);
}
}
1 change: 1 addition & 0 deletions codenarc-converter/CodeNarc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 2.2.5 (January 2024)
--------------------------------------
Remove rule:
- Supported Version Range -> EC5002
- Disable Obfuscation -> EC5003

Version 2.2.4 (September 2023)
--------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ ruleset {
DuplicateSetValue
DuplicateStringLiteral
EC5001
EC5003
ElseBlockBraces
EmptyCatchBlock
EmptyClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ title: CodeNarc - Rule Index by Name
* [DuplicateSetValue](./codenarc-rules-basic.html#duplicatesetvalue-rule)
* [DuplicateStringLiteral](./codenarc-rules-dry.html#duplicatestringliteral-rule)
* [EC5001](./codenarc-rules-ecocode.html#EC5001-rule)
* [EC5003](./codenarc-rules-ecocode.html#EC5003-rule)
* [ElseBlockBraces](./codenarc-rules-braces.html#elseblockbraces-rule)
* [EmptyCatchBlock](./codenarc-rules-basic.html#emptycatchblock-rule)
* [EmptyClass](./codenarc-rules-basic.html#emptyclass-rule)
Expand Down
1 change: 0 additions & 1 deletion codenarc-converter/CodeNarc/docs/codenarc-rule-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ title: CodeNarc - Rule Index

## [Ecocode](./codenarc-rules-ecocode.html)
* [EC5001](./codenarc-rules-ecocode.html#EC5001-rule)
* [EC5003](./codenarc-rules-ecocode.html#EC5003-rule)

## [Enhanced](./codenarc-rules-enhanced.html)
* [CloneWithoutCloneable](./codenarc-rules-enhanced.html#clonewithoutcloneable-rule)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

EC5003.description=Using minifyEnabled true will obfuscate code and will have a sligthly negative impact on power consumption at runtime.
EC5003.description.html=Using minifyEnabled true will obfuscate code and will have a sligthly negative impact on power consumption at runtime.

EC5001.description=Using "multiDexEnabled true" goes against the overall reduction of the weight of the apps and hence must be avoided.
EC5001.description.html=Using "multiDexEnabled true" goes against the overall reduction of the weight of the apps and hence must be avoided.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ DuplicateNumberLiteral = org.codenarc.rule.dry.DuplicateNumberLiteralRule
DuplicateSetValue = org.codenarc.rule.basic.DuplicateSetValueRule
DuplicateStringLiteral = org.codenarc.rule.dry.DuplicateStringLiteralRule
EC5001 = org.codenarc.rule.ecocode.EC5001
EC5003 = org.codenarc.rule.ecocode.EC5003
ElseBlockBraces = org.codenarc.rule.braces.ElseBlockBracesRule
EmptyCatchBlock = org.codenarc.rule.basic.EmptyCatchBlockRule
EmptyClass = org.codenarc.rule.basic.EmptyClassRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
</description>

<rule class='org.codenarc.rule.ecocode.EC5001'/>
<rule class='org.codenarc.rule.ecocode.EC5003'/>
</ruleset>
Loading