SpotBugs Report

Project Information

Project: acmwebsite.github.io (spotbugsMain)

SpotBugs version: 4.7.3

Code analyzed:



Metrics

375 lines of code analyzed, in 10 classes, in 1 packages.

Metric Total Density*
High Priority Warnings 0.00
Medium Priority Warnings 9 24.00
Total Warnings 9 24.00

(* Defects per Thousand lines of non-commenting source statements)



Contents

Summary

Warning Type Number
Bad practice Warnings 4
Malicious code vulnerability Warnings 2
Performance Warnings 2
Dodgy code Warnings 1
Total 9

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
CN edu.odu.cs.cs350.acmClassifier.ACMClass.clone() does not call super.clone()
CN edu.odu.cs.cs350.acmClassifier.Document.clone() does not call super.clone()
CN edu.odu.cs.cs350.acmClassifier.Trainer.clone() does not call super.clone()
Nm The method name edu.odu.cs.cs350.acmClassifier.Parser.Parse() doesn't start with a lower case letter

Malicious code vulnerability Warnings

Code Warning
EI edu.odu.cs.cs350.acmClassifier.Trainer.loadState(String) may expose internal representation by returning Trainer.svm
EI edu.odu.cs.cs350.acmClassifier.Trainer.svm() may expose internal representation by returning Trainer.svm

Performance Warnings

Code Warning
Dm new edu.odu.cs.cs350.acmClassifier.Document() invokes inefficient new String(String) constructor
UuF Unused field: edu.odu.cs.cs350.acmClassifier.Main.ArrayList

Dodgy code Warnings

Code Warning
SF Switch statement found in new edu.odu.cs.cs350.acmClassifier.ACMClass(String) where default case is missing

Details

CN_IDIOM_NO_SUPER_CALL: clone method does not call super.clone()

This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone().

If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type.

DM_STRING_CTOR: Method invokes inefficient new String(String) constructor

Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter.  Just use the argument String directly.

EI_EXPOSE_REP: May expose internal representation by returning reference to mutable object

Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

NM_METHOD_NAMING_CONVENTION: Method names should start with a lower case letter

Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.

SF_SWITCH_NO_DEFAULT: Switch statement found where default case is missing

This method contains a switch statement where default case is missing. Usually you need to provide a default case.

Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if the default case is at the end of the switch statement and the switch statement doesn't contain break statements for other cases.

UUF_UNUSED_FIELD: Unused field

This field is never used.  Consider removing it from the class.