PMD Results

The following document contains the results of PMD

Files

org/apache/myfaces/tobago/example/addressbook/web/AppenderModel.java

Violation Line
Private field could be made final. It is only initialized in the declaration or constructor. 31
Local variable could be declared final 51
Local variable could be declared final 53
Consider simply returning the value vs storing it in local variable 'patternLayout' 54

org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java

Violation Line
Parameter 'facesContext' is not assigned and could be declared final 37
Local variable could be declared final 38
Local variable could be declared final 39
Local variable could be declared final 41
Local variable could be declared final 42
Local variable could be declared final 43
Local variable could be declared final 46

org/apache/myfaces/tobago/example/addressbook/web/Controller.java

Violation Line
Avoid unused imports such as 'org.apache.commons.fileupload.FileItem' 25
Avoid unused imports such as 'org.apache.commons.logging.Log' 26
Avoid unused imports such as 'org.apache.commons.logging.LogFactory' 27
Avoid unused imports such as 'org.apache.myfaces.tobago.component.UIColumn' 28
Avoid unused imports such as 'org.apache.myfaces.tobago.config.TobagoConfig' 29
Avoid unused imports such as 'org.apache.myfaces.tobago.context.ClientProperties' 30
Avoid unused imports such as 'org.apache.myfaces.tobago.context.Theme' 31
Avoid unused imports such as 'org.apache.myfaces.tobago.event.SortActionEvent' 32
Avoid unused imports such as 'org.apache.myfaces.tobago.example.addressbook.Address' 33
Avoid unused imports such as 'org.apache.myfaces.tobago.example.addressbook.AddressDao' 34
Avoid unused imports such as 'org.apache.myfaces.tobago.example.addressbook.AddressDaoException' 35
Avoid unused imports such as 'org.apache.myfaces.tobago.example.addressbook.Picture' 36
Avoid unused imports such as 'org.apache.myfaces.tobago.model.SheetState' 37
Avoid unused imports such as 'javax.annotation.PostConstruct' 41
Avoid unused imports such as 'javax.annotation.Resource' 42
Avoid unused imports such as 'javax.faces.application.Application' 43
Avoid unused imports such as 'javax.faces.application.FacesMessage' 44
Avoid unused imports such as 'javax.faces.component.UIComponent' 45
Avoid unused imports such as 'javax.faces.context.FacesContext' 46
Avoid unused imports such as 'javax.faces.event.ActionEvent' 47
Avoid unused imports such as 'javax.faces.model.SelectItem' 48
Avoid unused imports such as 'javax.faces.validator.ValidatorException' 49
Avoid unused imports such as 'javax.servlet.http.HttpSession' 50
Avoid unused imports such as 'java.io.IOException' 51
Avoid unused imports such as 'java.util.ArrayList' 52
Avoid unused imports such as 'java.util.Collections' 53
Avoid unused imports such as 'java.util.Iterator' 54
Avoid unused imports such as 'java.util.List' 55
Avoid unused imports such as 'java.util.Locale' 56
A high number of imports can indicate a high degree of coupling within an object. 417

org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java

Violation Line
Parameter 'value' is not assigned and could be declared final 44
Parameter 'facesContext' is not assigned and could be declared final 44
Parameter 'uiComponent' is not assigned and could be declared final 44
Local variable could be declared final 46

org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java

Violation Line
Avoid unused private fields such as 'LOG' 36
Avoid unused private fields such as 'LOG' 36
Parameter 'component' is not assigned and could be declared final 39
Parameter 'facesContext' is not assigned and could be declared final 39
Parameter 'reference' is not assigned and could be declared final 39
Local variable could be declared final 43
Parameter 'object' is not assigned and could be declared final 52
Parameter 'component' is not assigned and could be declared final 52
Parameter 'facesContext' is not assigned and could be declared final 52

org/apache/myfaces/tobago/example/addressbook/web/MessageUtils.java

Violation Line
Document empty constructor 27 - 28
Parameter 'key' is not assigned and could be declared final 30
Parameter 'facesContext' is not assigned and could be declared final 30
Local variable could be declared final 31 - 33
Parameter 'facesContext' is not assigned and could be declared final 37
Parameter 'key' is not assigned and could be declared final 38
Parameter 'value' is not assigned and could be declared final 38
Parameter 'facesContext' is not assigned and could be declared final 43
Parameter 'key' is not assigned and could be declared final 44
Parameter 'value' is not assigned and could be declared final 44
Parameter 'key' is not assigned and could be declared final 50
Parameter 'facesContext' is not assigned and could be declared final 50
Local variable could be declared final 51

org/apache/myfaces/tobago/example/addressbook/web/SelectItemComparator.java

Violation Line
Parameter 's2' is not assigned and could be declared final 27
Parameter 's1' is not assigned and could be declared final 27

org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java

Violation Line
The class 'LocaleConverter' has a Cyclomatic Complexity of 3 (Highest = 5). 26 - 57
Parameter 'component' is not assigned and could be declared final 29
Parameter 'value' is not assigned and could be declared final 29
Parameter 'facesContext' is not assigned and could be declared final 29
Local variable could be declared final 30
Parameter 'component' is not assigned and could be declared final 39
Parameter 'value' is not assigned and could be declared final 39
Parameter 'facesContext' is not assigned and could be declared final 39
Parameter 'value' is not assigned and could be declared final 43
The method 'createLocale' has a Cyclomatic Complexity of 5. 43 - 55
Local variable could be declared final 44

org/apache/myfaces/tobago/example/addressbook/web/StartupPhaseListener.java

Violation Line
The class 'StartupPhaseListener' has a Cyclomatic Complexity of 3 (Highest = 5). 32 - 88
Parameter 'event' is not assigned and could be declared final 44
The method 'beforePhase' has a Cyclomatic Complexity of 5. 44 - 84
Local variable could be declared final 46
Local variable could be declared final 47
Local variable could be declared final 48
Position literals first in String comparisons 53
Local variable could be declared final 55
Local variable could be declared final 62 - 63
Local variable could be declared final 68 - 69
Local variable could be declared final 73 - 74
Document empty method 86 - 87
Parameter 'event' is not assigned and could be declared final 86

org/apache/myfaces/tobago/example/addressbook/web/LoggingController.java

Violation Line
Avoid unused imports such as 'org.apache.log4j.Logger' 20
Avoid unused imports such as 'org.apache.log4j.Level' 21
Avoid unused imports such as 'org.apache.log4j.LogManager' 22
Avoid unused imports such as 'org.apache.log4j.Appender' 23
Avoid unused imports such as 'org.apache.myfaces.tobago.model.SelectItem' 24
Avoid unused imports such as 'org.apache.myfaces.tobago.component.UIInput' 25
Avoid unused imports such as 'org.apache.myfaces.tobago.example.addressbook.Log4jUtils' 26
Avoid unused imports such as 'org.apache.commons.io.IOUtils' 27
Avoid unused imports such as 'org.apache.commons.logging.Log' 28
Avoid unused imports such as 'org.apache.commons.logging.LogFactory' 29
Avoid unused imports such as 'javax.faces.component.UIParameter' 33
Avoid unused imports such as 'javax.faces.context.FacesContext' 34
Avoid unused imports such as 'javax.servlet.ServletResponse' 35
Avoid unused imports such as 'java.util.List' 36
Avoid unused imports such as 'java.util.ArrayList' 37
Avoid unused imports such as 'java.util.Enumeration' 38
Avoid unused imports such as 'java.util.Collections' 39
Avoid unused imports such as 'java.util.Comparator' 40
Avoid unused imports such as 'java.util.Set' 41
Avoid unused imports such as 'java.io.IOException' 42
Avoid unused imports such as 'java.io.FileInputStream' 43

org/apache/myfaces/tobago/example/addressbook/web/Countries.java

Violation Line
Avoid unused imports such as 'javax.faces.model.SelectItem' 23
Avoid unused imports such as 'java.util.ArrayList' 24
Avoid unused imports such as 'java.util.Locale' 25
Avoid unused imports such as 'java.util.Collections' 26

org/apache/myfaces/tobago/example/addressbook/web/AdminController.java

Violation Line
Avoid unused imports such as 'javax.swing.DefaultBoundedRangeModel' 23
Avoid unused imports such as 'javax.swing.BoundedRangeModel' 24
Avoid unused imports such as 'javax.annotation.security.RolesAllowed' 25
Avoid unused imports such as 'java.lang.management.ManagementFactory' 26
Avoid unused imports such as 'java.lang.management.MemoryMXBean' 27
Avoid unused imports such as 'java.lang.management.MemoryUsage' 28

org/apache/myfaces/tobago/example/addressbook/web/Layout.java

Violation Line
Local variable could be declared final 32
Parameter 'width' is not assigned and could be declared final 44
Local variable could be declared final 49
Parameter 'height' is not assigned and could be declared final 61
Parameter 'minimumWidth' is not assigned and could be declared final 69
Parameter 'minimumHeight' is not assigned and could be declared final 77
Parameter 'maximumWidth' is not assigned and could be declared final 85
Parameter 'maximumHeight' is not assigned and could be declared final 93

org/apache/myfaces/tobago/example/addressbook/web/RandomAddressGenerator.java

Violation Line
Parameter 'german' is not assigned and could be declared final 52
Parameter 'female' is not assigned and could be declared final 52
Local variable could be declared final 53
Local variable could be declared final 62
Parameter 'array' is not assigned and could be declared final 69
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 73

org/apache/myfaces/tobago/example/addressbook/web/CategoryModel.java

Violation Line
Private field could be made final. It is only initialized in the declaration or constructor. 29
Parameter 'level' is not assigned and could be declared final 66

org/apache/myfaces/tobago/example/addressbook/Log4jUtils.java

Violation Line
Parameter 'repository' is not assigned and could be declared final 44
Local variable could be declared final 45
Local variable could be declared final 46
Parameter 'loggers' is not assigned and could be declared final 51
Local variable could be declared final 52
Local variable could be declared final 54
Parameter 'allAppenders' is not assigned and could be declared final 60
Parameter 'logger' is not assigned and could be declared final 60
Local variable could be declared final 61
Local variable could be declared final 63
Parameter 'repository' is not assigned and could be declared final 68
Parameter 'name' is not assigned and could be declared final 68
Local variable could be declared final 69
Local variable could be declared final 71
Local variable could be declared final 73
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 83

org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java

Violation Line
Document empty method 36 - 38
Parameter 'servletContextEvent' is not assigned and could be declared final 36
Parameter 'servletContextEvent' is not assigned and could be declared final 40

org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java

Violation Line
Avoid unused imports such as 'org.apache.commons.logging.Log' 20
Avoid unused imports such as 'org.apache.commons.logging.LogFactory' 21
Avoid unused imports such as 'javax.persistence.EntityManager' 26
Avoid unused imports such as 'javax.persistence.PersistenceContext' 27
Avoid unused imports such as 'javax.persistence.Query' 28
Avoid unused imports such as 'java.util.List' 29

org/apache/myfaces/tobago/example/addressbook/Address.java

Violation Line
Avoid unused private fields such as 'revision' 48
Avoid unused private fields such as 'revision' 48
Parameter 'fromAddress' is not assigned and could be declared final 85
Avoid unused private methods such as 'load()' 124
Avoid unused private methods such as 'load()' 124
Parameter 'id' is not assigned and could be declared final 140
Parameter 'firstName' is not assigned and could be declared final 148
Parameter 'lastName' is not assigned and could be declared final 156
Parameter 'street' is not assigned and could be declared final 164
Parameter 'houseNumber' is not assigned and could be declared final 172
Parameter 'city' is not assigned and could be declared final 180
Parameter 'zipCode' is not assigned and could be declared final 188
Parameter 'country' is not assigned and could be declared final 196
Parameter 'phone' is not assigned and could be declared final 204
Parameter 'mobile' is not assigned and could be declared final 212
Parameter 'fax' is not assigned and could be declared final 220
Parameter 'email' is not assigned and could be declared final 228
Parameter 'icq' is not assigned and could be declared final 239
Parameter 'homePage' is not assigned and could be declared final 247
Parameter 'dayOfBirth' is not assigned and could be declared final 255
Parameter 'note' is not assigned and could be declared final 263
Parameter 'company' is not assigned and could be declared final 271
Parameter 'jobTitle' is not assigned and could be declared final 279
Parameter 'jobPhone' is not assigned and could be declared final 287
Parameter 'jobEmail' is not assigned and could be declared final 295
Parameter 'jobHomePage' is not assigned and could be declared final 306
Parameter 'picture' is not assigned and could be declared final 318

org/apache/myfaces/tobago/example/addressbook/AddressDaoException.java

Violation Line
Document empty constructor 22 - 23

org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java

Violation Line
Private field could be made final. It is only initialized in the declaration or constructor. 37
Use block level rather than method level synchronization 43 - 56
Parameter 'address' is not assigned and could be declared final 43
Local variable could be declared final 45
Parameter 'filter' is not assigned and could be declared final 58
Parameter 'column' is not assigned and could be declared final 58
Parameter 'order' is not assigned and could be declared final 58
Use block level rather than method level synchronization 62 - 65
Parameter 'filter' is not assigned and could be declared final 62
Use block level rather than method level synchronization 67 - 74
Parameter 'address' is not assigned and could be declared final 67
Local variable could be declared final 68
Parameter 'id' is not assigned and could be declared final 76

org/apache/myfaces/tobago/example/addressbook/Picture.java

Violation Line
Document empty constructor 45 - 46

org/apache/myfaces/tobago/example/addressbook/EmailAddress.java

Violation Line
Parameter 'email' is not assigned and could be declared final 33
Local variable could be declared final 38
Local variable could be declared final 43
Parameter 'o' is not assigned and could be declared final 47
Local variable could be declared final 55
Avoid if (x != y) ..; else ..; 57
Avoid if (x != y) ..; else ..; 65