Fork me on GitHub

PMD Results

The following document contains the results of PMD 6.13.0.

Violations By Priority

Priority 1

fr/paris/lutece/plugins/newsletter/business/NewsLetterTemplate.java

Rule Violation Line
FieldNamingConventions The field name 'strFileKey' doesn't match '_[a-z][a-zA-Z0-9]*' 54

fr/paris/lutece/plugins/newsletter/service/NewsletterService.java

Rule Violation Line
LocalVariableNamingConventions The local variable name '_bTemplate' doesn't match '[a-z][a-zA-Z0-9]*' 367

fr/paris/lutece/plugins/newsletter/util/NewsLetterConstants.java

Rule Violation Line
ClassNamingConventions The utility class name 'NewsLetterConstants' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 41–168
FieldNamingConventions The public constant name 'PROPERTY_FileProviderStore' doesn't match '[A-Z][A-Z_0-9]*' 47

fr/paris/lutece/plugins/newsletter/web/NewsletterJspBean.java

Rule Violation Line
AvoidThrowingRawExceptionTypes Avoid throwing raw exception types. 1978
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 2531

fr/paris/lutece/plugins/newsletter/web/NewsletterTemplateJspBean.java

Rule Violation Line
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 534
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 537
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 547

Priority 2

fr/paris/lutece/plugins/newsletter/web/portlet/NewsLetterArchivePortletJspBean.java

Rule Violation Line
IntegerInstantiation Avoid instantiating Integer objects. Call Integer.valueOf() instead. 267

fr/paris/lutece/plugins/newsletter/web/portlet/NewsLetterSubscriptionPortletJspBean.java

Rule Violation Line
IntegerInstantiation Avoid instantiating Integer objects. Call Integer.valueOf() instead. 277

Priority 3

fr/paris/lutece/plugins/newsletter/business/AwaitingActivationDAO.java

Rule Violation Line
MissingOverride The method 'delete(int, int, Plugin)' is missing an @Override annotation. 59–68
MissingOverride The method 'exists(int, int, Plugin)' is missing an @Override annotation. 81–94
MissingOverride The method 'insert(int, int, Plugin)' is missing an @Override annotation. 106–115

fr/paris/lutece/plugins/newsletter/business/INewsLetterDAO.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 50–265

fr/paris/lutece/plugins/newsletter/business/ISendingNewsLetterDAO.java

Rule Violation Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 117
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 117

fr/paris/lutece/plugins/newsletter/business/NewsLetter.java

Rule Violation Line
TooManyFields Too many fields 46–445
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 77–86
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 326–329
MissingOverride The method 'getResourceId()' is missing an @Override annotation. 410–413
AddEmptyString Do not add empty strings 412
MissingOverride The method 'getResourceTypeCode()' is missing an @Override annotation. 420–423

fr/paris/lutece/plugins/newsletter/business/NewsLetterDAO.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 50–527
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 258
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 315
ConfusingTernary Avoid if (x != y) ..; else ..; 468–476
ConfusingTernary Avoid if (x != y) ..; else ..; 498–506

fr/paris/lutece/plugins/newsletter/business/NewsLetterHome.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 49–316

fr/paris/lutece/plugins/newsletter/business/NewsLetterTemplate.java

Rule Violation Line
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 62–69
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 181–184
MissingOverride The method 'getResourceId()' is missing an @Override annotation. 202–205
MissingOverride The method 'getResourceTypeCode()' is missing an @Override annotation. 212–215

fr/paris/lutece/plugins/newsletter/business/NewsLetterTemplateDAO.java

Rule Violation Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 73
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 134
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 274
ConfusingTernary Avoid if (x != y) ..; else ..; 311–319

fr/paris/lutece/plugins/newsletter/business/NewsletterPropertiesDAO.java

Rule Violation Line
MissingOverride The method 'load(Plugin)' is missing an @Override annotation. 57–83
MissingOverride The method 'store(NewsLetterProperties, Plugin)' is missing an @Override annotation. 93–102

fr/paris/lutece/plugins/newsletter/business/NewsletterTemplateRemovalListener.java

Rule Violation Line
ShortVariable Avoid variables with short names like id 63

fr/paris/lutece/plugins/newsletter/business/NewsletterTemplateWorkgroupRemovalListener.java

Rule Violation Line
MissingOverride The method 'canBeRemoved(String)' is missing an @Override annotation. 58–76
MissingOverride The method 'getRemovalRefusedMessage(String, Locale)' is missing an @Override annotation. 87–91

fr/paris/lutece/plugins/newsletter/business/NewsletterWorkgroupRemovalListener.java

Rule Violation Line
MissingOverride The method 'canBeRemoved(String)' is missing an @Override annotation. 58–76
MissingOverride The method 'getRemovalRefusedMessage(String, Locale)' is missing an @Override annotation. 87–91

fr/paris/lutece/plugins/newsletter/business/Pair.java

Rule Violation Line
ImmutableField Private field '_first' could be made final; it is only initialized in the declaration or constructor. 48
ImmutableField Private field '_second' could be made final; it is only initialized in the declaration or constructor. 49

fr/paris/lutece/plugins/newsletter/business/SendingNewsLetterDAO.java

Rule Violation Line
MissingOverride The method 'insert(SendingNewsLetter, Plugin)' is missing an @Override annotation. 68–83
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 93–99
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 110–133
MissingOverride The method 'store(SendingNewsLetter, Plugin)' is missing an @Override annotation. 143–150
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the checkPrimaryKey method if you want a default access modifier 161–177
DefaultPackage Use explicit scoping instead of the default package private level 161–177
DefaultPackage Use explicit scoping instead of the default package private level 186–204
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 186–204
MissingOverride The method 'selectLastSendingForNewsletterId(int, Plugin)' is missing an @Override annotation. 215–237
MissingOverride The method 'selectAllLastSendingForNewsletterId(int, Plugin)' is missing an @Override annotation. 248–272
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 251
MissingOverride The method 'findAllSendings(Plugin)' is missing an @Override annotation. 281–304
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 283
MissingOverride The method 'findSendingsByIds(ArrayList, Plugin)' is missing an @Override annotation. 315–340
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 315
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 315
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 317

fr/paris/lutece/plugins/newsletter/business/SendingNewsLetterHome.java

Rule Violation Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 168
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 168

fr/paris/lutece/plugins/newsletter/business/Subscriber.java

Rule Violation Line
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 89

fr/paris/lutece/plugins/newsletter/business/SubscriberDAO.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 46–421
MissingOverride The method 'insert(Subscriber, Plugin)' is missing an @Override annotation. 72–84
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 94–100
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 111–128
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the checkPrimaryKey method if you want a default access modifier 139–155
DefaultPackage Use explicit scoping instead of the default package private level 139–155
DefaultPackage Use explicit scoping instead of the default package private level 164–183
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 164–183
MissingOverride The method 'selectAll(Plugin)' is missing an @Override annotation. 192–211
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 197
MissingOverride The method 'selectByEmail(String, Plugin)' is missing an @Override annotation. 222–240
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 225
MissingOverride The method 'selectSubscribers(int, Plugin)' is missing an @Override annotation. 251–272
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 257
MissingOverride The method 'selectSubscribers(int, String, int, int, Plugin)' is missing an @Override annotation. 289–316
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 300
MissingOverride The method 'selectSubscribersForSending(int, String, int, int, Plugin)' is missing an @Override annotation. 333–360
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 344
MissingOverride The method 'selectNewsLetters(int, Plugin)' is missing an @Override annotation. 371–392
MissingOverride The method 'selectSubscribersList(Plugin)' is missing an @Override annotation. 401–420
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 407

fr/paris/lutece/plugins/newsletter/business/portlet/INewsLetterArchivePortletDAO.java

Rule Violation Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 79

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterArchivePortlet.java

Rule Violation Line
MissingOverride The method 'getXmlDocument(HttpServletRequest)' is missing an @Override annotation. 68–71
MissingOverride The method 'getXml(HttpServletRequest)' is missing an @Override annotation. 80–101
MissingOverride The method 'remove()' is missing an @Override annotation. 114–117

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterArchivePortletDAO.java

Rule Violation Line
MissingOverride The method 'insert(Portlet)' is missing an @Override annotation. 65–68
MissingOverride The method 'delete(int)' is missing an @Override annotation. 77–83
MissingOverride The method 'load(int)' is missing an @Override annotation. 92–110
MissingOverride The method 'store(Portlet)' is missing an @Override annotation. 118–121
MissingOverride The method 'insertSending(int, int, Plugin)' is missing an @Override annotation. 131–139
MissingOverride The method 'removeSending(int, int, Plugin)' is missing an @Override annotation. 149–157
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 166
MissingOverride The method 'findSendingsInPortlet(int, Plugin)' is missing an @Override annotation. 166–182
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 168

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterArchivePortletHome.java

Rule Violation Line
AssignmentToNonFinalStatic Possible unsafe assignment to a non-final static field in a constructor. 50
CallSuperInConstructor It is a good practice to call super() in a constructor 58–64
MissingOverride The method 'getPortletTypeId()' is missing an @Override annotation. 71–77
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strPortletTypeId' 76
MissingOverride The method 'getDAO()' is missing an @Override annotation. 94–97
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 132

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterSubscriptionPortlet.java

Rule Violation Line
MissingOverride The method 'compare(NewsLetter, NewsLetter)' is missing an @Override annotation. 96–99
MissingOverride The method 'setPluginName(String)' is missing an @Override annotation. 112–118
MissingOverride The method 'getXmlDocument(HttpServletRequest)' is missing an @Override annotation. 127–130
CyclomaticComplexity The method 'getXml(HttpServletRequest)' has a cyclomatic complexity of 12. 139–243
MissingOverride The method 'getXml(HttpServletRequest)' is missing an @Override annotation. 139–243
ExcessiveMethodLength Avoid really long methods. 139–243
NPathComplexity The method 'getXml(HttpServletRequest)' has an NPath complexity of 960 139–243
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 175
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'str' 242
MissingOverride The method 'remove()' is missing an @Override annotation. 256–259

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterSubscriptionPortletDAO.java

Rule Violation Line
MissingOverride The method 'insert(Portlet)' is missing an @Override annotation. 65–68
MissingOverride The method 'delete(int)' is missing an @Override annotation. 77–83
MissingOverride The method 'load(int)' is missing an @Override annotation. 92–110
MissingOverride The method 'store(Portlet)' is missing an @Override annotation. 118–121
MissingOverride The method 'insertSubscription(int, int)' is missing an @Override annotation. 131–139
MissingOverride The method 'removeSubscription(int, int)' is missing an @Override annotation. 149–157
MissingOverride The method 'findSelectedNewsletters(int)' is missing an @Override annotation. 166–182
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 168

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterSubscriptionPortletHome.java

Rule Violation Line
MissingOverride The method 'getPortletTypeId()' is missing an @Override annotation. 59–65
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strPortletTypeId' 64
MissingOverride The method 'getDAO()' is missing an @Override annotation. 82–85

fr/paris/lutece/plugins/newsletter/business/topic/FreeHtmlTopicDao.java

Rule Violation Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 121
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 124
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 126

fr/paris/lutece/plugins/newsletter/business/topic/NewsletterTopic.java

Rule Violation Line
ShortVariable Avoid variables with short names like o 192
CyclomaticComplexity The method 'compareTo(NewsletterTopic)' has a cyclomatic complexity of 12. 192–228
ShortVariable Avoid variables with short names like o 250

fr/paris/lutece/plugins/newsletter/business/topic/NewsletterTopicDao.java

Rule Violation Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 139
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 178

fr/paris/lutece/plugins/newsletter/business/topic/NewsletterTopicHome.java

Rule Violation Line
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 151
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 154

fr/paris/lutece/plugins/newsletter/service/NewsLetterArchiveService.java

Rule Violation Line
AssignmentToNonFinalStatic Possible unsafe assignment to a non-final static field in a constructor. 64
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 98
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 100
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 117
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 117

fr/paris/lutece/plugins/newsletter/service/NewsLetterRegistrationService.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34–435
AssignmentToNonFinalStatic Possible unsafe assignment to a non-final static field in a constructor. 93
ExcessiveMethodLength Avoid really long methods. 129–237
NPathComplexity The method 'doSubscription(HttpServletRequest)' has an NPath complexity of 579 129–237
CyclomaticComplexity The method 'doSubscription(HttpServletRequest)' has a cyclomatic complexity of 13. 129–237
CollapsibleIfStatements These nested if statements could be combined 153–157
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 212
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 212
CyclomaticComplexity The method 'doConfirmSubscribe(HttpServletRequest)' has a cyclomatic complexity of 10. 247–328
CyclomaticComplexity The method 'doUnSubscribe(HttpServletRequest)' has a cyclomatic complexity of 10. 338–381
InsufficientStringBufferDeclaration StringBuffer constructor is initialized with size 16, but has at least 104 characters appended. 410
ConsecutiveLiteralAppends StringBuffer (or StringBuilder).append is called 2 consecutive times with literals. Use a single append with a single combined String. 411

fr/paris/lutece/plugins/newsletter/service/NewsletterFileService.java

Rule Violation Line
CommentRequired Header comments are required 14–101
CommentRequired Public method and constructor comments are required 16–27
CommentRequired Public method and constructor comments are required 29–31
CommentRequired Public method and constructor comments are required 32–51
ConfusingTernary Avoid if (x != y) ..; else ..; 38–45
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 47
CommentRequired Public method and constructor comments are required 53–75
ConfusingTernary Avoid if (x != y) ..; else ..; 61–68
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 71
CommentRequired Public method and constructor comments are required 77–88
CommentRequired Public method and constructor comments are required 89–100

fr/paris/lutece/plugins/newsletter/service/NewsletterPlugin.java

Rule Violation Line
MissingOverride The method 'init()' is missing an @Override annotation. 53–58

fr/paris/lutece/plugins/newsletter/service/NewsletterResourceIdService.java

Rule Violation Line
CallSuperInConstructor It is a good practice to call super() in a constructor 124–127
MissingOverride The method 'register()' is missing an @Override annotation. 132–196
ShortVariable Avoid variables with short names like rt 134
ShortVariable Avoid variables with short names like p 140
MissingOverride The method 'getResourceIdList(Locale)' is missing an @Override annotation. 205–208
MissingOverride The method 'getTitle(String, Locale)' is missing an @Override annotation. 219–229
ConfusingTernary Avoid if (x != y) ..; else ..; 228

fr/paris/lutece/plugins/newsletter/service/NewsletterService.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34–541
GodClass Possible God Class (WMC=51, ATFD=65, TCC=0.000%) 83–541
ConfusingTernary Avoid if (x != y) ..; else ..; 143–151
ShortVariable Avoid variables with short names like t 156
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 167
UnnecessaryWrapperObjectCreation Unnecessary wrapper object creation 206
IdenticalCatchBranches 'catch' branch identical to 'UnsupportedEncodingException' branch 242–245
CyclomaticComplexity The method 'generateNewsletterHtmlCode(NewsLetter, int, String, AdminUser, Locale)' has a cyclomatic complexity of 13. 301–381
NPathComplexity The method 'generateNewsletterHtmlCode(NewsLetter, int, String, AdminUser, Locale)' has an NPath complexity of 300 301–381
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 311
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 311
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 319
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 348

fr/paris/lutece/plugins/newsletter/service/NewsletterTemplateResourceIdService.java

Rule Violation Line
CallSuperInConstructor It is a good practice to call super() in a constructor 70–73
MissingOverride The method 'register()' is missing an @Override annotation. 78–102
ShortVariable Avoid variables with short names like rt 80
ShortVariable Avoid variables with short names like p 86
MissingOverride The method 'getResourceIdList(Locale)' is missing an @Override annotation. 111–114
MissingOverride The method 'getTitle(String, Locale)' is missing an @Override annotation. 125–136
ConfusingTernary Avoid if (x != y) ..; else ..; 135

fr/paris/lutece/plugins/newsletter/service/SubscriberCleaningDaemon.java

Rule Violation Line
MissingOverride The method 'run()' is missing an @Override annotation. 46–49

fr/paris/lutece/plugins/newsletter/service/topic/FreeHtmlTopicService.java

Rule Violation Line
MissingOverride The method 'hasConfiguration()' is missing an @Override annotation. 103–106
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 115
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 115
ConfusingTernary Avoid if (x != y) ..; else ..; 193–200

fr/paris/lutece/plugins/newsletter/service/topic/NewsletterTopicService.java

Rule Violation Line
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 222

fr/paris/lutece/plugins/newsletter/util/HtmlDomDocNewsletter.java

Rule Violation Line
ImmutableField Private field '_strBaseUrl' could be made final; it is only initialized in the declaration or constructor. 124
ShortVariable Avoid variables with short names like tf 208
IdenticalCatchBranches 'catch' branch identical to 'TransformerConfigurationException' branch 222–227
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'stringResult' 231
ImmutableField Private field '_strTagName' could be made final; it is only initialized in the declaration or constructor. 259
ImmutableField Private field '_strAttributeName' could be made final; it is only initialized in the declaration or constructor. 260
ImmutableField Private field '_strTestedAttributeName' could be made final; it is only initialized in the declaration or constructor. 261
ImmutableField Private field '_strTestedAttributeValue' could be made final; it is only initialized in the declaration or constructor. 262

fr/paris/lutece/plugins/newsletter/util/NewsLetterConstants.java

Rule Violation Line
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 165
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 166
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 167

fr/paris/lutece/plugins/newsletter/util/NewsletterUtils.java

Rule Violation Line
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 85
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 86
PositionLiteralsFirstInComparisons Position literals first in String comparisons 149
ConfusingTernary Avoid if (x != y) ..; else ..; 157–164
CommentRequired Public method and constructor comments are required 227–230

fr/paris/lutece/plugins/newsletter/web/NewsLetterApp.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 65–277
UncommentedEmptyMethodBody Document empty method body 100–101
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 116–151
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 121
ConfusingTernary Avoid if (x != y) ..; else ..; 166–197
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 178
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 266
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 266

fr/paris/lutece/plugins/newsletter/web/NewsletterJspBean.java

Rule Violation Line
ExcessivePublicCount This class has a bunch of public methods and attributes 34–2626
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34–2626
ExcessiveClassLength Avoid really long classes. 117–2626
CyclomaticComplexity The class 'NewsletterJspBean' has a total cyclomatic complexity of 231 (highest 19). 117–2626
TooManyMethods This class has too many methods, consider refactoring it. 118–2626
UnusedPrivateField Avoid unused private fields such as 'JSP_URL_MODIFY_NEWSLETTER'. 268
ImmutableField Private field '_newsletterService' could be made final; it is only initialized in the declaration or constructor. 338
ImmutableField Private field '_newsletterTopicService' could be made final; it is only initialized in the declaration or constructor. 339
CallSuperInConstructor It is a good practice to call super() in a constructor 344–347
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 362
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 362
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 384
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 388
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 388
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 423–424
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 453
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 453
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 459–460
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 491
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 491
ConfusingTernary Avoid if (x != y) ..; else ..; 531–538
ConfusingTernary Avoid if (x != y) ..; else ..; 540–547
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 573
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 573
CyclomaticComplexity The method 'getComposeNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 10. 602–680
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 607
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 623
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 623
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 706
NPathComplexity The method 'doCreateNewsLetter(HttpServletRequest)' has an NPath complexity of 1344 748–824
CyclomaticComplexity The method 'doCreateNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 16. 748–824
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 751
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 752
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 753
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 754
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 755
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 756
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 757
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 758
ConfusingTernary Avoid if (x != y) ..; else ..; 803–810
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 837
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 837
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 837
NPathComplexity The method 'doModifyNewsLetter(HttpServletRequest)' has an NPath complexity of 336 874–947
CyclomaticComplexity The method 'doModifyNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 13. 874–947
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 877
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 878
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 879
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 880
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 881
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 882
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 883
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 887
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1021
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1127
ConfusingTernary Avoid if (x != y) ..; else ..; 1162–1171
ShortVariable Avoid variables with short names like sb 1173
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 1183
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1241
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1267
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1300
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1344–1345
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1347
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1347
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1446
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1446
ConfusingTernary Avoid if (x != y) ..; else ..; 1449–1456
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 1525
NPathComplexity The method 'doConfirmSendNewsLetter(HttpServletRequest)' has an NPath complexity of 324 1540–1597
CyclomaticComplexity The method 'doConfirmSendNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 11. 1540–1597
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1583
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1693
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1759
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1760
ConfusingTernary Avoid if (x != y) ..; else ..; 1773–1806
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1833
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1833
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1864
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1864
NPathComplexity The method 'doImportSubscribers(HttpServletRequest)' has an NPath complexity of 1410 1880–1980
CyclomaticComplexity The method 'doImportSubscribers(HttpServletRequest)' has a cyclomatic complexity of 19. 1880–1980
ExcessiveMethodLength Avoid really long methods. 1880–1980
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1886
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 1924
ConfusingTernary Avoid if (x != y) ..; else ..; 1948–1967
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 1978
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1995
ShortVariable Avoid variables with short names like os 2010
NcssCount The method 'getManageNewsletterTopics(HttpServletRequest)' has a NCSS line count of 78. 2034–2159
CyclomaticComplexity The method 'getManageNewsletterTopics(HttpServletRequest)' has a cyclomatic complexity of 15. 2034–2159
ExcessiveMethodLength Avoid really long methods. 2034–2159
NPathComplexity The method 'getManageNewsletterTopics(HttpServletRequest)' has an NPath complexity of 1440 2034–2159
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 2079
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 2079
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 2101
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 2106–2107
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 2306
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 2306
LinguisticNaming Linguistics Antipattern - The method 'isWrongEmail' indicates linguistically it returns a boolean, but it returns 'String' 2415–2432
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 2423–2429
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 2473
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 2481–2489
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 2529–2556
LinguisticNaming Linguistics Antipattern - The setter 'setHtmlTemplateEmail' should not return any type except void linguistically 2572–2588
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 2574
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 2574
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 2599
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 2600

fr/paris/lutece/plugins/newsletter/web/NewsletterTemplateJspBean.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34–849
CyclomaticComplexity The class 'NewsletterTemplateJspBean' has a total cyclomatic complexity of 89 (highest 24). 94–849
GodClass Possible God Class (WMC=89, ATFD=241, TCC=13.636%) 94–849
UnusedPrivateField Avoid unused private fields such as 'MESSAGE_IMAGE_FILE_ALREADY_EXISTS'. 121
ImmutableField Private field '_newsletterTopicService' could be made final; it is only initialized in the declaration or constructor. 150
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 163
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 163
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 168
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 172
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 172
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 239
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 239
CyclomaticComplexity The method 'doCreateNewsletterTemplate(HttpServletRequest)' has a cyclomatic complexity of 17. 255–318
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 312
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 343
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 343
NPathComplexity The method 'doModifyNewsletterTemplate(HttpServletRequest)' has an NPath complexity of 18722 360–490
ExcessiveMethodLength Avoid really long methods. 360–490
CyclomaticComplexity The method 'doModifyNewsletterTemplate(HttpServletRequest)' has a cyclomatic complexity of 24. 360–490
NcssCount The method 'doModifyNewsletterTemplate(HttpServletRequest)' has a NCSS line count of 67. 360–490
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 381
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 390
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 393
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 394
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 484
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 504
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 504
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 504
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 525–575
NcssCount The method 'doModifyNewsletterTemplateFile(HttpServletRequest)' has a NCSS line count of 61. 591–702
NPathComplexity The method 'doModifyNewsletterTemplateFile(HttpServletRequest)' has an NPath complexity of 273 591–702
ExcessiveMethodLength Avoid really long methods. 591–702
CyclomaticComplexity The method 'doModifyNewsletterTemplateFile(HttpServletRequest)' has a cyclomatic complexity of 14. 591–702
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 594–699
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 613
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 692
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 723

fr/paris/lutece/plugins/newsletter/web/portlet/NewsLetterArchivePortletJspBean.java

Rule Violation Line
MissingOverride The method 'getCreate(HttpServletRequest)' is missing an @Override annotation. 93–108
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 100
MissingOverride The method 'doCreate(HttpServletRequest)' is missing an @Override annotation. 117–150
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 119
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 123
MissingOverride The method 'getModify(HttpServletRequest)' is missing an @Override annotation. 159–185
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 169
MissingOverride The method 'doModify(HttpServletRequest)' is missing an @Override annotation. 194–227
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 199
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 250

fr/paris/lutece/plugins/newsletter/web/portlet/NewsLetterSubscriptionPortletJspBean.java

Rule Violation Line
MissingOverride The method 'getCreate(HttpServletRequest)' is missing an @Override annotation. 102–118
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 110
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 111
MissingOverride The method 'doCreate(HttpServletRequest)' is missing an @Override annotation. 127–161
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 129
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 133
MissingOverride The method 'getModify(HttpServletRequest)' is missing an @Override annotation. 170–195
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 179
MissingOverride The method 'doModify(HttpServletRequest)' is missing an @Override annotation. 204–237
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 209
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 260

Priority 4

fr/paris/lutece/plugins/newsletter/business/NewsLetterHome.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.sql.Timestamp' due to existing import 'java.sql.Timestamp' 242

fr/paris/lutece/plugins/newsletter/business/Pair.java

Rule Violation Line
ShortClassName Avoid short class names like Pair 46–81

fr/paris/lutece/plugins/newsletter/business/Subscriber.java

Rule Violation Line
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 118–121

fr/paris/lutece/plugins/newsletter/service/NewsletterFileService.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'fr.paris.lutece.portal.service.util.AppLogService.error' due to existing import 'fr.paris.lutece.portal.service.util.AppLogService' 49
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'fr.paris.lutece.portal.service.util.AppLogService.error' due to existing import 'fr.paris.lutece.portal.service.util.AppLogService' 73

fr/paris/lutece/plugins/newsletter/util/HtmlDomDocNewsletter.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.w3c.dom.Document' due to existing import 'org.w3c.dom.Document' 239

fr/paris/lutece/plugins/newsletter/util/NewsletterUtils.java

Rule Violation Line
UseVarargs Consider using varargs for methods or constructors which take an array the last parameter. 182
UseVarargs Consider using varargs for methods or constructors which take an array the last parameter. 197

fr/paris/lutece/plugins/newsletter/web/NewsletterJspBean.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.sql.Timestamp' due to existing import 'java.sql.Timestamp' 1412
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 1412
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 1669
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 1732
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.sql.Timestamp' due to existing import 'java.sql.Timestamp' 1930
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 1930
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.ArrayList' due to existing import 'java.util.ArrayList' 2124

fr/paris/lutece/plugins/newsletter/web/NewsletterTemplateJspBean.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'fr.paris.lutece.plugins.newsletter.util.NewsLetterConstants.MARK_TEMPLATE_FILE' due to existing import 'fr.paris.lutece.plugins.newsletter.util.NewsLetterConstants' 542

Files

fr/paris/lutece/plugins/newsletter/business/AwaitingActivationDAO.java

Rule Violation Priority Line
MissingOverride The method 'delete(int, int, Plugin)' is missing an @Override annotation. 3 59–68
MissingOverride The method 'exists(int, int, Plugin)' is missing an @Override annotation. 3 81–94
MissingOverride The method 'insert(int, int, Plugin)' is missing an @Override annotation. 3 106–115

fr/paris/lutece/plugins/newsletter/business/INewsLetterDAO.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 50–265

fr/paris/lutece/plugins/newsletter/business/ISendingNewsLetterDAO.java

Rule Violation Priority Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 117
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 117

fr/paris/lutece/plugins/newsletter/business/NewsLetter.java

Rule Violation Priority Line
TooManyFields Too many fields 3 46–445
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 77–86
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 3 326–329
MissingOverride The method 'getResourceId()' is missing an @Override annotation. 3 410–413
AddEmptyString Do not add empty strings 3 412
MissingOverride The method 'getResourceTypeCode()' is missing an @Override annotation. 3 420–423

fr/paris/lutece/plugins/newsletter/business/NewsLetterDAO.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 50–527
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 258
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 315
ConfusingTernary Avoid if (x != y) ..; else ..; 3 468–476
ConfusingTernary Avoid if (x != y) ..; else ..; 3 498–506

fr/paris/lutece/plugins/newsletter/business/NewsLetterHome.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 49–316
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.sql.Timestamp' due to existing import 'java.sql.Timestamp' 4 242

fr/paris/lutece/plugins/newsletter/business/NewsLetterTemplate.java

Rule Violation Priority Line
FieldNamingConventions The field name 'strFileKey' doesn't match '_[a-z][a-zA-Z0-9]*' 1 54
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 62–69
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 3 181–184
MissingOverride The method 'getResourceId()' is missing an @Override annotation. 3 202–205
MissingOverride The method 'getResourceTypeCode()' is missing an @Override annotation. 3 212–215

fr/paris/lutece/plugins/newsletter/business/NewsLetterTemplateDAO.java

Rule Violation Priority Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 73
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 134
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 274
ConfusingTernary Avoid if (x != y) ..; else ..; 3 311–319

fr/paris/lutece/plugins/newsletter/business/NewsletterPropertiesDAO.java

Rule Violation Priority Line
MissingOverride The method 'load(Plugin)' is missing an @Override annotation. 3 57–83
MissingOverride The method 'store(NewsLetterProperties, Plugin)' is missing an @Override annotation. 3 93–102

fr/paris/lutece/plugins/newsletter/business/NewsletterTemplateRemovalListener.java

Rule Violation Priority Line
ShortVariable Avoid variables with short names like id 3 63

fr/paris/lutece/plugins/newsletter/business/NewsletterTemplateWorkgroupRemovalListener.java

Rule Violation Priority Line
MissingOverride The method 'canBeRemoved(String)' is missing an @Override annotation. 3 58–76
MissingOverride The method 'getRemovalRefusedMessage(String, Locale)' is missing an @Override annotation. 3 87–91

fr/paris/lutece/plugins/newsletter/business/NewsletterWorkgroupRemovalListener.java

Rule Violation Priority Line
MissingOverride The method 'canBeRemoved(String)' is missing an @Override annotation. 3 58–76
MissingOverride The method 'getRemovalRefusedMessage(String, Locale)' is missing an @Override annotation. 3 87–91

fr/paris/lutece/plugins/newsletter/business/Pair.java

Rule Violation Priority Line
ShortClassName Avoid short class names like Pair 4 46–81
ImmutableField Private field '_first' could be made final; it is only initialized in the declaration or constructor. 3 48
ImmutableField Private field '_second' could be made final; it is only initialized in the declaration or constructor. 3 49

fr/paris/lutece/plugins/newsletter/business/SendingNewsLetterDAO.java

Rule Violation Priority Line
MissingOverride The method 'insert(SendingNewsLetter, Plugin)' is missing an @Override annotation. 3 68–83
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 3 93–99
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 3 110–133
MissingOverride The method 'store(SendingNewsLetter, Plugin)' is missing an @Override annotation. 3 143–150
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the checkPrimaryKey method if you want a default access modifier 3 161–177
DefaultPackage Use explicit scoping instead of the default package private level 3 161–177
DefaultPackage Use explicit scoping instead of the default package private level 3 186–204
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 3 186–204
MissingOverride The method 'selectLastSendingForNewsletterId(int, Plugin)' is missing an @Override annotation. 3 215–237
MissingOverride The method 'selectAllLastSendingForNewsletterId(int, Plugin)' is missing an @Override annotation. 3 248–272
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 251
MissingOverride The method 'findAllSendings(Plugin)' is missing an @Override annotation. 3 281–304
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 283
MissingOverride The method 'findSendingsByIds(ArrayList, Plugin)' is missing an @Override annotation. 3 315–340
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 315
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 315
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 317

fr/paris/lutece/plugins/newsletter/business/SendingNewsLetterHome.java

Rule Violation Priority Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 168
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 168

fr/paris/lutece/plugins/newsletter/business/Subscriber.java

Rule Violation Priority Line
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 89
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 118–121

fr/paris/lutece/plugins/newsletter/business/SubscriberDAO.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 46–421
MissingOverride The method 'insert(Subscriber, Plugin)' is missing an @Override annotation. 3 72–84
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 3 94–100
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 3 111–128
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the checkPrimaryKey method if you want a default access modifier 3 139–155
DefaultPackage Use explicit scoping instead of the default package private level 3 139–155
DefaultPackage Use explicit scoping instead of the default package private level 3 164–183
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 3 164–183
MissingOverride The method 'selectAll(Plugin)' is missing an @Override annotation. 3 192–211
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 197
MissingOverride The method 'selectByEmail(String, Plugin)' is missing an @Override annotation. 3 222–240
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 225
MissingOverride The method 'selectSubscribers(int, Plugin)' is missing an @Override annotation. 3 251–272
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 257
MissingOverride The method 'selectSubscribers(int, String, int, int, Plugin)' is missing an @Override annotation. 3 289–316
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 300
MissingOverride The method 'selectSubscribersForSending(int, String, int, int, Plugin)' is missing an @Override annotation. 3 333–360
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 344
MissingOverride The method 'selectNewsLetters(int, Plugin)' is missing an @Override annotation. 3 371–392
MissingOverride The method 'selectSubscribersList(Plugin)' is missing an @Override annotation. 3 401–420
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 407

fr/paris/lutece/plugins/newsletter/business/portlet/INewsLetterArchivePortletDAO.java

Rule Violation Priority Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 79

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterArchivePortlet.java

Rule Violation Priority Line
MissingOverride The method 'getXmlDocument(HttpServletRequest)' is missing an @Override annotation. 3 68–71
MissingOverride The method 'getXml(HttpServletRequest)' is missing an @Override annotation. 3 80–101
MissingOverride The method 'remove()' is missing an @Override annotation. 3 114–117

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterArchivePortletDAO.java

Rule Violation Priority Line
MissingOverride The method 'insert(Portlet)' is missing an @Override annotation. 3 65–68
MissingOverride The method 'delete(int)' is missing an @Override annotation. 3 77–83
MissingOverride The method 'load(int)' is missing an @Override annotation. 3 92–110
MissingOverride The method 'store(Portlet)' is missing an @Override annotation. 3 118–121
MissingOverride The method 'insertSending(int, int, Plugin)' is missing an @Override annotation. 3 131–139
MissingOverride The method 'removeSending(int, int, Plugin)' is missing an @Override annotation. 3 149–157
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 166
MissingOverride The method 'findSendingsInPortlet(int, Plugin)' is missing an @Override annotation. 3 166–182
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 168

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterArchivePortletHome.java

Rule Violation Priority Line
AssignmentToNonFinalStatic Possible unsafe assignment to a non-final static field in a constructor. 3 50
CallSuperInConstructor It is a good practice to call super() in a constructor 3 58–64
MissingOverride The method 'getPortletTypeId()' is missing an @Override annotation. 3 71–77
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strPortletTypeId' 3 76
MissingOverride The method 'getDAO()' is missing an @Override annotation. 3 94–97
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 132

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterSubscriptionPortlet.java

Rule Violation Priority Line
MissingOverride The method 'compare(NewsLetter, NewsLetter)' is missing an @Override annotation. 3 96–99
MissingOverride The method 'setPluginName(String)' is missing an @Override annotation. 3 112–118
MissingOverride The method 'getXmlDocument(HttpServletRequest)' is missing an @Override annotation. 3 127–130
CyclomaticComplexity The method 'getXml(HttpServletRequest)' has a cyclomatic complexity of 12. 3 139–243
MissingOverride The method 'getXml(HttpServletRequest)' is missing an @Override annotation. 3 139–243
ExcessiveMethodLength Avoid really long methods. 3 139–243
NPathComplexity The method 'getXml(HttpServletRequest)' has an NPath complexity of 960 3 139–243
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 175
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'str' 3 242
MissingOverride The method 'remove()' is missing an @Override annotation. 3 256–259

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterSubscriptionPortletDAO.java

Rule Violation Priority Line
MissingOverride The method 'insert(Portlet)' is missing an @Override annotation. 3 65–68
MissingOverride The method 'delete(int)' is missing an @Override annotation. 3 77–83
MissingOverride The method 'load(int)' is missing an @Override annotation. 3 92–110
MissingOverride The method 'store(Portlet)' is missing an @Override annotation. 3 118–121
MissingOverride The method 'insertSubscription(int, int)' is missing an @Override annotation. 3 131–139
MissingOverride The method 'removeSubscription(int, int)' is missing an @Override annotation. 3 149–157
MissingOverride The method 'findSelectedNewsletters(int)' is missing an @Override annotation. 3 166–182
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 168

fr/paris/lutece/plugins/newsletter/business/portlet/NewsLetterSubscriptionPortletHome.java

Rule Violation Priority Line
MissingOverride The method 'getPortletTypeId()' is missing an @Override annotation. 3 59–65
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strPortletTypeId' 3 64
MissingOverride The method 'getDAO()' is missing an @Override annotation. 3 82–85

fr/paris/lutece/plugins/newsletter/business/topic/FreeHtmlTopicDao.java

Rule Violation Priority Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 121
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 124
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 126

fr/paris/lutece/plugins/newsletter/business/topic/NewsletterTopic.java

Rule Violation Priority Line
ShortVariable Avoid variables with short names like o 3 192
CyclomaticComplexity The method 'compareTo(NewsletterTopic)' has a cyclomatic complexity of 12. 3 192–228
ShortVariable Avoid variables with short names like o 3 250

fr/paris/lutece/plugins/newsletter/business/topic/NewsletterTopicDao.java

Rule Violation Priority Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 139
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 178

fr/paris/lutece/plugins/newsletter/business/topic/NewsletterTopicHome.java

Rule Violation Priority Line
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 151
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 154

fr/paris/lutece/plugins/newsletter/service/NewsLetterArchiveService.java

Rule Violation Priority Line
AssignmentToNonFinalStatic Possible unsafe assignment to a non-final static field in a constructor. 3 64
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 98
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 100
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 117
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 117

fr/paris/lutece/plugins/newsletter/service/NewsLetterRegistrationService.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34–435
AssignmentToNonFinalStatic Possible unsafe assignment to a non-final static field in a constructor. 3 93
ExcessiveMethodLength Avoid really long methods. 3 129–237
NPathComplexity The method 'doSubscription(HttpServletRequest)' has an NPath complexity of 579 3 129–237
CyclomaticComplexity The method 'doSubscription(HttpServletRequest)' has a cyclomatic complexity of 13. 3 129–237
CollapsibleIfStatements These nested if statements could be combined 3 153–157
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 212
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 212
CyclomaticComplexity The method 'doConfirmSubscribe(HttpServletRequest)' has a cyclomatic complexity of 10. 3 247–328
CyclomaticComplexity The method 'doUnSubscribe(HttpServletRequest)' has a cyclomatic complexity of 10. 3 338–381
InsufficientStringBufferDeclaration StringBuffer constructor is initialized with size 16, but has at least 104 characters appended. 3 410
ConsecutiveLiteralAppends StringBuffer (or StringBuilder).append is called 2 consecutive times with literals. Use a single append with a single combined String. 3 411

fr/paris/lutece/plugins/newsletter/service/NewsletterFileService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 14–101
CommentRequired Public method and constructor comments are required 3 16–27
CommentRequired Public method and constructor comments are required 3 29–31
CommentRequired Public method and constructor comments are required 3 32–51
ConfusingTernary Avoid if (x != y) ..; else ..; 3 38–45
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 47
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'fr.paris.lutece.portal.service.util.AppLogService.error' due to existing import 'fr.paris.lutece.portal.service.util.AppLogService' 4 49
CommentRequired Public method and constructor comments are required 3 53–75
ConfusingTernary Avoid if (x != y) ..; else ..; 3 61–68
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 71
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'fr.paris.lutece.portal.service.util.AppLogService.error' due to existing import 'fr.paris.lutece.portal.service.util.AppLogService' 4 73
CommentRequired Public method and constructor comments are required 3 77–88
CommentRequired Public method and constructor comments are required 3 89–100

fr/paris/lutece/plugins/newsletter/service/NewsletterPlugin.java

Rule Violation Priority Line
MissingOverride The method 'init()' is missing an @Override annotation. 3 53–58

fr/paris/lutece/plugins/newsletter/service/NewsletterResourceIdService.java

Rule Violation Priority Line
CallSuperInConstructor It is a good practice to call super() in a constructor 3 124–127
MissingOverride The method 'register()' is missing an @Override annotation. 3 132–196
ShortVariable Avoid variables with short names like rt 3 134
ShortVariable Avoid variables with short names like p 3 140
MissingOverride The method 'getResourceIdList(Locale)' is missing an @Override annotation. 3 205–208
MissingOverride The method 'getTitle(String, Locale)' is missing an @Override annotation. 3 219–229
ConfusingTernary Avoid if (x != y) ..; else ..; 3 228

fr/paris/lutece/plugins/newsletter/service/NewsletterService.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34–541
GodClass Possible God Class (WMC=51, ATFD=65, TCC=0.000%) 3 83–541
ConfusingTernary Avoid if (x != y) ..; else ..; 3 143–151
ShortVariable Avoid variables with short names like t 3 156
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 167
UnnecessaryWrapperObjectCreation Unnecessary wrapper object creation 3 206
IdenticalCatchBranches 'catch' branch identical to 'UnsupportedEncodingException' branch 3 242–245
CyclomaticComplexity The method 'generateNewsletterHtmlCode(NewsLetter, int, String, AdminUser, Locale)' has a cyclomatic complexity of 13. 3 301–381
NPathComplexity The method 'generateNewsletterHtmlCode(NewsLetter, int, String, AdminUser, Locale)' has an NPath complexity of 300 3 301–381
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 311
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 311
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 319
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 348
LocalVariableNamingConventions The local variable name '_bTemplate' doesn't match '[a-z][a-zA-Z0-9]*' 1 367

fr/paris/lutece/plugins/newsletter/service/NewsletterTemplateResourceIdService.java

Rule Violation Priority Line
CallSuperInConstructor It is a good practice to call super() in a constructor 3 70–73
MissingOverride The method 'register()' is missing an @Override annotation. 3 78–102
ShortVariable Avoid variables with short names like rt 3 80
ShortVariable Avoid variables with short names like p 3 86
MissingOverride The method 'getResourceIdList(Locale)' is missing an @Override annotation. 3 111–114
MissingOverride The method 'getTitle(String, Locale)' is missing an @Override annotation. 3 125–136
ConfusingTernary Avoid if (x != y) ..; else ..; 3 135

fr/paris/lutece/plugins/newsletter/service/SubscriberCleaningDaemon.java

Rule Violation Priority Line
MissingOverride The method 'run()' is missing an @Override annotation. 3 46–49

fr/paris/lutece/plugins/newsletter/service/topic/FreeHtmlTopicService.java

Rule Violation Priority Line
MissingOverride The method 'hasConfiguration()' is missing an @Override annotation. 3 103–106
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 115
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 115
ConfusingTernary Avoid if (x != y) ..; else ..; 3 193–200

fr/paris/lutece/plugins/newsletter/service/topic/NewsletterTopicService.java

Rule Violation Priority Line
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 222

fr/paris/lutece/plugins/newsletter/util/HtmlDomDocNewsletter.java

Rule Violation Priority Line
ImmutableField Private field '_strBaseUrl' could be made final; it is only initialized in the declaration or constructor. 3 124
ShortVariable Avoid variables with short names like tf 3 208
IdenticalCatchBranches 'catch' branch identical to 'TransformerConfigurationException' branch 3 222–227
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'stringResult' 3 231
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.w3c.dom.Document' due to existing import 'org.w3c.dom.Document' 4 239
ImmutableField Private field '_strTagName' could be made final; it is only initialized in the declaration or constructor. 3 259
ImmutableField Private field '_strAttributeName' could be made final; it is only initialized in the declaration or constructor. 3 260
ImmutableField Private field '_strTestedAttributeName' could be made final; it is only initialized in the declaration or constructor. 3 261
ImmutableField Private field '_strTestedAttributeValue' could be made final; it is only initialized in the declaration or constructor. 3 262

fr/paris/lutece/plugins/newsletter/util/NewsLetterConstants.java

Rule Violation Priority Line
ClassNamingConventions The utility class name 'NewsLetterConstants' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 1 41–168
FieldNamingConventions The public constant name 'PROPERTY_FileProviderStore' doesn't match '[A-Z][A-Z_0-9]*' 1 47
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 165
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 166
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 167

fr/paris/lutece/plugins/newsletter/util/NewsletterUtils.java

Rule Violation Priority Line
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 85
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 86
PositionLiteralsFirstInComparisons Position literals first in String comparisons 3 149
ConfusingTernary Avoid if (x != y) ..; else ..; 3 157–164
UseVarargs Consider using varargs for methods or constructors which take an array the last parameter. 4 182
UseVarargs Consider using varargs for methods or constructors which take an array the last parameter. 4 197
CommentRequired Public method and constructor comments are required 3 227–230

fr/paris/lutece/plugins/newsletter/web/NewsLetterApp.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 65–277
UncommentedEmptyMethodBody Document empty method body 3 100–101
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 3 116–151
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 121
ConfusingTernary Avoid if (x != y) ..; else ..; 3 166–197
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 178
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 266
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 266

fr/paris/lutece/plugins/newsletter/web/NewsletterJspBean.java

Rule Violation Priority Line
ExcessivePublicCount This class has a bunch of public methods and attributes 3 34–2626
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34–2626
ExcessiveClassLength Avoid really long classes. 3 117–2626
CyclomaticComplexity The class 'NewsletterJspBean' has a total cyclomatic complexity of 231 (highest 19). 3 117–2626
TooManyMethods This class has too many methods, consider refactoring it. 3 118–2626
UnusedPrivateField Avoid unused private fields such as 'JSP_URL_MODIFY_NEWSLETTER'. 3 268
ImmutableField Private field '_newsletterService' could be made final; it is only initialized in the declaration or constructor. 3 338
ImmutableField Private field '_newsletterTopicService' could be made final; it is only initialized in the declaration or constructor. 3 339
CallSuperInConstructor It is a good practice to call super() in a constructor 3 344–347
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 362
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 362
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 384
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 388
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 388
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 423–424
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 453
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 453
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 459–460
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 491
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 491
ConfusingTernary Avoid if (x != y) ..; else ..; 3 531–538
ConfusingTernary Avoid if (x != y) ..; else ..; 3 540–547
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 573
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 573
CyclomaticComplexity The method 'getComposeNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 10. 3 602–680
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 607
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 623
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 623
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 706
NPathComplexity The method 'doCreateNewsLetter(HttpServletRequest)' has an NPath complexity of 1344 3 748–824
CyclomaticComplexity The method 'doCreateNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 16. 3 748–824
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 751
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 752
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 753
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 754
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 755
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 756
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 757
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 758
ConfusingTernary Avoid if (x != y) ..; else ..; 3 803–810
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 837
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 837
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 837
NPathComplexity The method 'doModifyNewsLetter(HttpServletRequest)' has an NPath complexity of 336 3 874–947
CyclomaticComplexity The method 'doModifyNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 13. 3 874–947
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 877
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 878
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 879
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 880
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 881
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 882
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 883
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 887
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1021
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1127
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1162–1171
ShortVariable Avoid variables with short names like sb 3 1173
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 1183
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1241
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1267
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1300
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1344–1345
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1347
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1347
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.sql.Timestamp' due to existing import 'java.sql.Timestamp' 4 1412
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 4 1412
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1446
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1446
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1449–1456
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 1525
NPathComplexity The method 'doConfirmSendNewsLetter(HttpServletRequest)' has an NPath complexity of 324 3 1540–1597
CyclomaticComplexity The method 'doConfirmSendNewsLetter(HttpServletRequest)' has a cyclomatic complexity of 11. 3 1540–1597
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1583
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 4 1669
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1693
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 4 1732
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1759
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1760
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1773–1806
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1833
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1833
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1864
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1864
NPathComplexity The method 'doImportSubscribers(HttpServletRequest)' has an NPath complexity of 1410 3 1880–1980
CyclomaticComplexity The method 'doImportSubscribers(HttpServletRequest)' has a cyclomatic complexity of 19. 3 1880–1980
ExcessiveMethodLength Avoid really long methods. 3 1880–1980
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1886
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 1924
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.sql.Timestamp' due to existing import 'java.sql.Timestamp' 4 1930
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.Date' due to existing import 'java.util.Date' 4 1930
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1948–1967
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 1978
AvoidThrowingRawExceptionTypes Avoid throwing raw exception types. 1 1978
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1995
ShortVariable Avoid variables with short names like os 3 2010
NcssCount The method 'getManageNewsletterTopics(HttpServletRequest)' has a NCSS line count of 78. 3 2034–2159
CyclomaticComplexity The method 'getManageNewsletterTopics(HttpServletRequest)' has a cyclomatic complexity of 15. 3 2034–2159
ExcessiveMethodLength Avoid really long methods. 3 2034–2159
NPathComplexity The method 'getManageNewsletterTopics(HttpServletRequest)' has an NPath complexity of 1440 3 2034–2159
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 2079
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 2079
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 2101
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 2106–2107
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.util.ArrayList' due to existing import 'java.util.ArrayList' 4 2124
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 2306
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 2306
LinguisticNaming Linguistics Antipattern - The method 'isWrongEmail' indicates linguistically it returns a boolean, but it returns 'String' 3 2415–2432
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 2423–2429
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 2473
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 2481–2489
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 3 2529–2556
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 1 2531
LinguisticNaming Linguistics Antipattern - The setter 'setHtmlTemplateEmail' should not return any type except void linguistically 3 2572–2588
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 2574
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 2574
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 2599
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 2600

fr/paris/lutece/plugins/newsletter/web/NewsletterTemplateJspBean.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34–849
CyclomaticComplexity The class 'NewsletterTemplateJspBean' has a total cyclomatic complexity of 89 (highest 24). 3 94–849
GodClass Possible God Class (WMC=89, ATFD=241, TCC=13.636%) 3 94–849
UnusedPrivateField Avoid unused private fields such as 'MESSAGE_IMAGE_FILE_ALREADY_EXISTS'. 3 121
ImmutableField Private field '_newsletterTopicService' could be made final; it is only initialized in the declaration or constructor. 3 150
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 163
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 163
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 168
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 172
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 172
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 239
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 239
CyclomaticComplexity The method 'doCreateNewsletterTemplate(HttpServletRequest)' has a cyclomatic complexity of 17. 3 255–318
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 312
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 343
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 343
NPathComplexity The method 'doModifyNewsletterTemplate(HttpServletRequest)' has an NPath complexity of 18722 3 360–490
ExcessiveMethodLength Avoid really long methods. 3 360–490
CyclomaticComplexity The method 'doModifyNewsletterTemplate(HttpServletRequest)' has a cyclomatic complexity of 24. 3 360–490
NcssCount The method 'doModifyNewsletterTemplate(HttpServletRequest)' has a NCSS line count of 67. 3 360–490
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 381
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 390
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 393
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 394
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 484
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 504
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 504
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 504
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 3 525–575
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 1 534
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 1 537
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'fr.paris.lutece.plugins.newsletter.util.NewsLetterConstants.MARK_TEMPLATE_FILE' due to existing import 'fr.paris.lutece.plugins.newsletter.util.NewsLetterConstants' 4 542
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 1 547
NcssCount The method 'doModifyNewsletterTemplateFile(HttpServletRequest)' has a NCSS line count of 61. 3 591–702
NPathComplexity The method 'doModifyNewsletterTemplateFile(HttpServletRequest)' has an NPath complexity of 273 3 591–702
ExcessiveMethodLength Avoid really long methods. 3 591–702
CyclomaticComplexity The method 'doModifyNewsletterTemplateFile(HttpServletRequest)' has a cyclomatic complexity of 14. 3 591–702
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 3 594–699
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 613
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 692
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 723

fr/paris/lutece/plugins/newsletter/web/portlet/NewsLetterArchivePortletJspBean.java

Rule Violation Priority Line
MissingOverride The method 'getCreate(HttpServletRequest)' is missing an @Override annotation. 3 93–108
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 100
MissingOverride The method 'doCreate(HttpServletRequest)' is missing an @Override annotation. 3 117–150
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 119
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 123
MissingOverride The method 'getModify(HttpServletRequest)' is missing an @Override annotation. 3 159–185
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 169
MissingOverride The method 'doModify(HttpServletRequest)' is missing an @Override annotation. 3 194–227
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 199
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 250
IntegerInstantiation Avoid instantiating Integer objects. Call Integer.valueOf() instead. 2 267

fr/paris/lutece/plugins/newsletter/web/portlet/NewsLetterSubscriptionPortletJspBean.java

Rule Violation Priority Line
MissingOverride The method 'getCreate(HttpServletRequest)' is missing an @Override annotation. 3 102–118
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 110
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 111
MissingOverride The method 'doCreate(HttpServletRequest)' is missing an @Override annotation. 3 127–161
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 129
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 133
MissingOverride The method 'getModify(HttpServletRequest)' is missing an @Override annotation. 3 170–195
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 179
MissingOverride The method 'doModify(HttpServletRequest)' is missing an @Override annotation. 3 204–237
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 209
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 260
IntegerInstantiation Avoid instantiating Integer objects. Call Integer.valueOf() instead. 2 277