Project: acmwebsite.github.io (spotbugsMain)
SpotBugs version: 4.7.3
Code analyzed:
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)
Warning Type | Number |
---|---|
Bad practice Warnings | 4 |
Malicious code vulnerability Warnings | 2 |
Performance Warnings | 2 |
Dodgy code Warnings | 1 |
Total | 9 |
Click on a warning row to see full context information.
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 |
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 |
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 |
Code | Warning |
---|---|
SF | Switch statement found in new edu.odu.cs.cs350.acmClassifier.ACMClass(String) where default case is missing |
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.
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.
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.
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
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.
This field is never used. Consider removing it from the class.