-
-
Notifications
You must be signed in to change notification settings - Fork 123
Clean code attributes and better descriptions complying with Sonar Coding rule guidelines #349
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
Open
pbaumard
wants to merge
29
commits into
green-code-initiative:main
Choose a base branch
from
pbaumard:feature/rule-description-normalization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c3ca195
Rule specifications normalization in progress
pbaumard bd8a4f1
Tests are now OK
pbaumard 706c181
Add tests for title length and prefix
pbaumard 06e0173
Add java version
pbaumard dabb897
Fix test unsing unsorted list
pbaumard a0a2c2e
Add license-maven-plugin and spotless-maven-plugin
pbaumard f23f81d
Revert section change for EC31
pbaumard 613a418
Better section titles in EC36
pbaumard 3975cd0
Revert tag changes
pbaumard 7d53fc2
Consistent descriptions for EC2
pbaumard 0fa8fc7
Move pom changes to ecocode-rules-specifications
pbaumard a3add9e
Move link to resources
pbaumard 52c0d78
Typography
pbaumard abfcfea
Better EC69 title
pbaumard 94c42dc
Style
pbaumard 8470f60
Test refactoring
pbaumard f714c48
Merge remote-tracking branch 'origin/main' into feature/rule-descript…
pbaumard 7b43fe8
Merge remote-tracking branch 'origin/main' into feature/rule-descript…
pbaumard ffa58e8
Merge branch 'main' into feature/rule-description-normalization
pbaumard ee7f507
Use standard sustainability tag instead of eco-design
pbaumard f2f8eff
Merge remote-tracking branch 'origin/main' into feature/rule-descript…
pbaumard 3d2e6c8
Merge remote-tracking branch 'origin/main' into feature/rule-descript…
pbaumard 4973db6
Merge branch 'main' into feature/rule-description-normalization
pbaumard d6dbc50
Merge branch 'main' into feature/rule-description-normalization
dedece35 14b4072
Merge branch 'main' into feature/rule-description-normalization
pbaumard 7fc9af0
Fix GCI82 description
pbaumard 3d041ce
Revert pom formatting changes
pbaumard f5ebd44
Merge branch 'main' into feature/rule-description-normalization
pbaumard e037fbe
Merge branch 'green-code-initiative:main' into feature/rule-descripti…
pbaumard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| { | ||
| "title": "Avoid Spring repository call in loop or stream operations", | ||
| "title": "Spring repository should not be called in loop or stream operations", | ||
| "type": "CODE_SMELL", | ||
| "status": "ready", | ||
| "remediation": { | ||
| "func": "Constant\/Issue", | ||
| "func": "Constant/Issue", | ||
| "constantCost": "50min" | ||
| }, | ||
| "tags": [ | ||
| "performance", | ||
| "spring", | ||
| "eco-design", | ||
| "ecocode" | ||
| ], | ||
| "defaultSeverity": "Minor" | ||
| "tags": [ "performance", "spring", "eco-design", "ecocode" ], | ||
| "defaultSeverity": "Minor", | ||
| "code": { | ||
| "impacts": { | ||
| "RELIABILITY": "LOW" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
ecocode-rules-specifications/src/main/rules/EC10/EC10.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| { | ||
| "title": "Avoid using unoptimized vector images", | ||
| "title": "Unoptimized vector images should be avoided", | ||
| "type": "CODE_SMELL", | ||
| "status": "ready", | ||
| "remediation": { | ||
| "func": "Constant\/Issue", | ||
| "func": "Constant/Issue", | ||
| "constantCost": "60min" | ||
| }, | ||
| "tags": [ | ||
| "eco-design", | ||
| "ecocode" | ||
| ], | ||
| "defaultSeverity": "Minor" | ||
| "tags": [ "eco-design", "ecocode", "performance" ], | ||
| "defaultSeverity": "Minor", | ||
| "code": { | ||
| "impacts": { | ||
| "RELIABILITY": "LOW" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 10 additions & 17 deletions
27
ecocode-rules-specifications/src/main/rules/EC11/EC11.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,18 @@ | ||
| { | ||
| "title": "Disallow multiple access of same DOM element.", | ||
| "title": "DOM manipulation should be limited", | ||
| "type": "CODE_SMELL", | ||
| "code": { | ||
| "impacts": { | ||
| "MAINTAINABILITY": "MEDIUM" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| }, | ||
| "status": "ready", | ||
| "remediation": { | ||
| "func": "Constant\/Issue", | ||
| "func": "Constant/Issue", | ||
| "constantCost": "5min" | ||
| }, | ||
| "tags": [ | ||
| "ecocode", | ||
| "eco-design", | ||
| "performance" | ||
| ], | ||
| "tags": [ "ecocode", "eco-design", "performance" ], | ||
| "defaultSeverity": "Major", | ||
| "compatibleLanguages": [ | ||
| "JAVASCRIPT", | ||
| "TYPESCRIPT" | ||
| ] | ||
| "code": { | ||
| "impacts": { | ||
| "RELIABILITY": "MEDIUM" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| }, | ||
| "compatibleLanguages": [ "JAVASCRIPT", "TYPESCRIPT" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 10 additions & 17 deletions
27
ecocode-rules-specifications/src/main/rules/EC12/EC12.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,18 @@ | ||
| { | ||
| "title": "Disallow multiple style changes at once.", | ||
| "title": "Multiple style changes should be batched", | ||
| "type": "CODE_SMELL", | ||
| "code": { | ||
| "impacts": { | ||
| "MAINTAINABILITY": "MEDIUM" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| }, | ||
| "status": "ready", | ||
| "remediation": { | ||
| "func": "Constant\/Issue", | ||
| "func": "Constant/Issue", | ||
| "constantCost": "10min" | ||
| }, | ||
| "tags": [ | ||
| "ecocode", | ||
| "eco-design", | ||
| "performance" | ||
| ], | ||
| "tags": [ "ecocode", "eco-design", "performance" ], | ||
| "defaultSeverity": "Major", | ||
| "compatibleLanguages": [ | ||
| "JAVASCRIPT", | ||
| "TYPESCRIPT" | ||
| ] | ||
| "code": { | ||
| "impacts": { | ||
| "RELIABILITY": "MEDIUM" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| }, | ||
| "compatibleLanguages": [ "JAVASCRIPT", "TYPESCRIPT" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 5 additions & 12 deletions
17
ecocode-rules-specifications/src/main/rules/EC13/EC13.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,18 @@ | ||
| { | ||
| "title": "Prefer API collections with pagination.", | ||
| "title": "API collections should be preferred with pagination", | ||
| "type": "CODE_SMELL", | ||
| "code": { | ||
| "impacts": { | ||
| "MAINTAINABILITY": "MEDIUM" | ||
| "RELIABILITY": "MEDIUM" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| }, | ||
| "status": "ready", | ||
| "remediation": { | ||
| "func": "Constant\/Issue", | ||
| "func": "Constant/Issue", | ||
| "constantCost": "30min" | ||
| }, | ||
| "tags": [ | ||
| "ecocode", | ||
| "eco-design", | ||
| "nestjs", | ||
| "performance" | ||
| ], | ||
| "tags": [ "ecocode", "eco-design", "nestjs", "performance" ], | ||
| "defaultSeverity": "Major", | ||
| "compatibleLanguages": [ | ||
| "TYPESCRIPT" | ||
| ] | ||
| "compatibleLanguages": [ "TYPESCRIPT" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,17 @@ | ||
| { | ||
| "title": "Avoid multiple if-else statement", | ||
| "title": "Variables should not be used in multiple if...else statements", | ||
| "type": "CODE_SMELL", | ||
| "status": "ready", | ||
| "remediation": { | ||
| "func": "Constant\/Issue", | ||
| "func": "Constant/Issue", | ||
| "constantCost": "5min" | ||
| }, | ||
| "tags": [ | ||
| "eco-design", | ||
| "performance", | ||
| "ecocode" | ||
| ], | ||
| "defaultSeverity": "Minor" | ||
| "tags": [ "eco-design", "performance", "ecocode" ], | ||
| "defaultSeverity": "Minor", | ||
| "code": { | ||
| "impacts": { | ||
| "RELIABILITY": "LOW" | ||
| }, | ||
| "attribute": "EFFICIENT" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
did you test your modification in a local SonarQube to check if the description is well displayed ?
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.
Those func attribute changes were reverted.