- 
                Notifications
    
You must be signed in to change notification settings  - Fork 105
 
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 23 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
    
  
  
    
              
              
  
    
      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,14 +1,21 @@ | ||
| { | ||
| "title": "Avoid using unoptimized vector images", | ||
| "title": "Unoptimized vector images should be avoided", | ||
| "type": "CODE_SMELL", | ||
| "status": "ready", | ||
| "remediation": { | ||
| "func": "Constant\/Issue", | ||
| "constantCost": "60min" | ||
| }, | ||
| "tags": [ | ||
| "eco-design", | ||
| "creedengo" | ||
| "sustainability", | ||
| "creedengo", | ||
| "performance" | ||
| ], | ||
| "defaultSeverity": "Minor" | ||
| "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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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,21 @@ | ||
| { | ||
| "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", | ||
| "constantCost": "5min" | ||
| }, | ||
| "tags": [ | ||
| "eco-design", | ||
| "sustainability", | ||
| "performance", | ||
| "creedengo" | ||
| ], | ||
| "defaultSeverity": "Minor" | ||
| "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
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      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.
in my point of view, I prefer a turn of phrase without negation, thus, I prefer "avoid" than "should not be" ... but I can ask for the point of view of core team
Uh oh!
There was an error while loading. Please reload this page.
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.
From Sonar Coding rule guidelines:
And as a developer I like the "X should [ not ] Y" pattern, because the expected fix is clear.
With "Avoid X" pattern sometimes it is not clear whether the code is avoiding X and it should not or the opposite, that is the code is using X and it should avoid it.