refactoring-kata-spotbugs-rule

My SpotBugs plugin project

License

License

Categories

Categories

Spotbugs Application Testing & Monitoring Code Analysis
GroupId

GroupId

com.github.meixuesong
ArtifactId

ArtifactId

kata-spotbugs-rule
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

refactoring-kata-spotbugs-rule
My SpotBugs plugin project
Project URL

Project URL

https://github.com/meixuesong/refactoring-kata-spotbugs-rule
Source Code Management

Source Code Management

https://github.com/meixuesong/refactoring-kata-spotbugs-rule/tree/master

Download kata-spotbugs-rule

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.meixuesong/kata-spotbugs-rule/ -->
<dependency>
    <groupId>com.github.meixuesong</groupId>
    <artifactId>kata-spotbugs-rule</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.meixuesong/kata-spotbugs-rule/
implementation 'com.github.meixuesong:kata-spotbugs-rule:1.0'
// https://jarcasting.com/artifacts/com.github.meixuesong/kata-spotbugs-rule/
implementation ("com.github.meixuesong:kata-spotbugs-rule:1.0")
'com.github.meixuesong:kata-spotbugs-rule:jar:1.0'
<dependency org="com.github.meixuesong" name="kata-spotbugs-rule" rev="1.0">
  <artifact name="kata-spotbugs-rule" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.meixuesong', module='kata-spotbugs-rule', version='1.0')
)
libraryDependencies += "com.github.meixuesong" % "kata-spotbugs-rule" % "1.0"
[com.github.meixuesong/kata-spotbugs-rule "1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.29

provided (1)

Group / Artifact Type Version
com.github.spotbugs : spotbugs jar 4.0.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.13
com.github.spotbugs : test-harness jar 4.0.0

Project Modules

There are no modules declared in this project.

Refactoring Kata SpotBugs plugin

This spotbugs plugin can check feature envy rule.

Feature envy is a method that uses more methods or variables from another (unrelated) class than from its own class violates the principle of putting data and behavior in the same place.

To use this spotbugs plugin with Maven and sonarqube, sample pom.xml as following:

    <properties>
        <sonar.java.spotbugs.reportPaths>./target/spotbugsXml.xml</sonar.java.spotbugs.reportPaths>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>4.0.4</version>
                    <configuration>
                        <plugins>
                            <plugin>
                                <groupId>refactoring</groupId>
                                <artifactId>kata-spotbugs-rule</artifactId>
                                <version>1.0</version>
                            </plugin>
                        </plugins>
                        <includeFilterFile>${project.basedir}/src/main/resources/spotbugs.xml</includeFilterFile>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
mvn clean verify spotbugs:spotbugs

Versions

Version
1.0