https://github.com/walkmod/walkmod-sonar-plugin
Plugin to automatically fix sonar violations
https://github.com/walkmod/walkmod-sonar-plugin
Last synced: 5 months ago
JSON representation
Plugin to automatically fix sonar violations
- Host: GitHub
- URL: https://github.com/walkmod/walkmod-sonar-plugin
- Owner: walkmod
- Created: 2016-02-25T07:05:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-08-20T17:55:06.000Z (almost 4 years ago)
- Last Synced: 2024-04-16T20:18:48.434Z (about 2 years ago)
- Language: Java
- Size: 101 KB
- Stars: 22
- Watchers: 6
- Forks: 13
- Open Issues: 9
-
Metadata Files:
- Readme: README.asciidoc
Awesome Lists containing this project
README
walkmod-sonar-plugin
====================
Raquel Pau
image:https://travis-ci.org/walkmod/walkmod-sonar-plugin.svg?branch=master["Build Status", link="https://travis-ci.org/walkmod/walkmod-sonar-plugin"]
This is a http://www.walkmod.com[walkmod] plugin to automatically fix sonar rule violations. Currently, the supported rules are:
----
- sonar:AddCurlyBrackets
- sonar:AddSwitchDefaultCase
- sonar:ArrayDesignatorOnType
- sonar:CollapsibleIfStatements
- sonar:DeclarationsShouldUseCollectionInterfaces
- sonar:LocalVarsShouldComplyWithNamingConvention
- sonar:PrimitiveInstantiationForToString
- sonar:RedundantCastsShouldNotBeUsed
- sonar:RemoveCodeComment
- sonar:RemoveEmptyMethod
- sonar:RemoveEmptyStatement
- sonar:RemoveLiteralBoolean
- sonar:RemoveUnusedMethodParameters
- sonar:RemoveUselessImports
- sonar:RemoveUselessParentheses
- sonar:RemoveUselessVariables
- sonar:StaticInitializedFieldToFinal
- sonar:StringCheckOnLeft
- sonar:UseCollectionIsEmpty
- sonar:UseStringEquals
- sonar:VariableImmediatelyReturned
----
== Usage
1) Verify that your walkmod version is > = 2.3.2 and your project is Maven or Gradle.
2) Execute the following command to add this code transformation plugin as part of your conventions.
----
walkmod add sonar:CollapsibleIfStatements
----
3) Now, You see the results, executing:
----
walkmod apply
----
Or, alternatively, you can also check which would be the modified classes typing:
----
walkmod check
----
== Contributing
If you want to hack on this, fork it, improve it and send me a pull request.
To get started using it, just clone it and call mvn install.