-
Download and install Gradle.
-
Checkout/fork the target/latest version from github: https://github.com/spotbugs/spotbugs or https://github.com/landawn/spotbugs
-
Modify all
java/jdk versionsin./spotbugs/spotbugs/build.gradleand./spotbugs/spotbugs-annotations/build.gradleto11. -
Modify below lines in class
edu.umd.cs.findbugs.ba.AnalysisContext:
public boolean isTooBig(final ClassDescriptor desc) {
final IAnalysisCache analysisCache = Global.getAnalysisCache();
try {
final ClassContext classContext = analysisCache.getClassAnalysis(ClassContext.class, desc);
final ClassData classData = analysisCache.getClassAnalysis(ClassData.class, desc);
if (classData.getData().length > 10000000) { // increase the number to 10000000
return true;
}
try {
final JavaClass javaClass = classContext.getJavaClass();
if (javaClass.getMethods().length > 10000) { // increase the number to 10000
return true;
}
} catch (final RuntimeException e) {
.....
}-
Run
gradlew buildunder root folder:.\spotbugs\ -
For
Eclipse, copy alljarfiles under folder:.\spotbugs\eclipsePlugin\lib\to Eclipse plugin folder:ECLIPSE_ROOT\plugins\com.github.spotbugs.plugin.eclipse_4.8.6.r202406180231-6cf7b2c\lib. Depends on the SpotBugs plugin version installed in Eclipse,com.github.spotbugs.plugin.eclipse_4.8.6.r202406180231-6cf7b2ccould be different. -
For
Intellij, copy alljarfiles under folder:.\spotbugs\eclipsePlugin\lib\to Intellij plugin folder:Users\<user>\AppData\Roaming\JetBrains\IdeaIC2024.3\plugins\spotbugs-idea\lib.IdeaIC2024.3is the current installed Intellij version.