Apache logging services logo Apache log4j logo

PMD Results

The following document contains the results of PMD 6.4.0.

Files

org/apache/logging/log4j/core/appender/AsyncAppender.java

Violation Priority Line
Avoid empty catch blocks 3 415417
Avoid empty catch blocks 3 460462

org/apache/logging/log4j/core/appender/ConsoleAppender.java

Violation Priority Line
Useless parentheses. 4 255

org/apache/logging/log4j/core/appender/FailoverAppender.java

Violation Priority Line
Useless parentheses. 4 132

org/apache/logging/log4j/core/appender/FileManager.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 221
Avoid modifiers which are implied by the context 3 254

org/apache/logging/log4j/core/appender/HttpURLConnectionManager.java

Violation Priority Line
Avoid empty while statements 3 113115

org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java

Violation Priority Line
Useless parentheses. 4 346

org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java

Violation Priority Line
Avoid unused constructor parameters such as 'bufferSize'. 3 205

org/apache/logging/log4j/core/appender/db/jdbc/ColumnConfig.java

Violation Priority Line
Useless parentheses. 4 231
Useless parentheses. 4 231
Useless parentheses. 4 231

org/apache/logging/log4j/core/appender/nosql/NoSqlDatabaseManager.java

Violation Priority Line
Avoid unused imports such as 'javax.jms.JMSException' 4 21

org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java

Violation Priority Line
Ternary operators that can be simplified with || or && 3 126
Useless parentheses. 4 457

org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java

Violation Priority Line
Useless parentheses. 4 316

org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java

Violation Priority Line
Avoid unused constructor parameters such as 'bufferSize'. 3 87
Ternary operators that can be simplified with || or && 3 628

org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java

Violation Priority Line
Avoid unused constructor parameters such as 'immediateFlush'. 3 65

org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 106
Avoid modifiers which are implied by the context 3 107109

org/apache/logging/log4j/core/appender/rolling/action/Duration.java

Violation Priority Line
These nested if statements could be combined 3 122138
Useless parentheses. 4 168

org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java

Violation Priority Line
Useless parentheses. 4 105
Useless parentheses. 4 107

org/apache/logging/log4j/core/appender/rolling/action/GzCompressAction.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 90
Avoid modifiers which are implied by the context 3 9192

org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java

Violation Priority Line
These nested if statements could be combined 3 113116

org/apache/logging/log4j/core/appender/rolling/action/ZipCompressAction.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 98
Avoid modifiers which are implied by the context 3 99

org/apache/logging/log4j/core/async/AsyncLogger.java

Violation Priority Line
Useless parentheses. 4 260

org/apache/logging/log4j/core/async/AsyncLoggerConfig.java

Violation Priority Line
Overriding method merely calls super 3 119121

org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java

Violation Priority Line
Useless parentheses. 4 197

org/apache/logging/log4j/core/async/RingBufferLogEvent.java

Violation Priority Line
Useless parentheses. 4 227
These nested if statements could be combined 3 321323
These nested if statements could be combined 3 332334

org/apache/logging/log4j/core/config/ConfigurationScheduler.java

Violation Priority Line
Overriding method merely calls super 3 5658

org/apache/logging/log4j/core/config/ConfigurationSource.java

Violation Priority Line
Avoid empty catch blocks 3 151153
Avoid empty catch blocks 3 165167

org/apache/logging/log4j/core/config/LoggerConfig.java

Violation Priority Line
Overriding method merely calls super 3 164166

org/apache/logging/log4j/core/config/json/JsonConfiguration.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 60

org/apache/logging/log4j/core/config/plugins/convert/Base64Converter.java

Violation Priority Line
Avoid empty catch blocks 3 4345
Avoid empty catch blocks 3 4547
Avoid empty catch blocks 3 4749
Avoid empty catch blocks 3 4951
Avoid empty catch blocks 3 5961

org/apache/logging/log4j/core/config/plugins/processor/PluginCache.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 70
Avoid modifiers which are implied by the context 3 100

org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 119

org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java

Violation Priority Line
Avoid unused imports such as 'java.util.ArrayList' 4 26

org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 216

org/apache/logging/log4j/core/config/plugins/visitors/PluginElementVisitor.java

Violation Priority Line
Avoid empty if statements 3 100102

org/apache/logging/log4j/core/config/properties/PropertiesConfigurationFactory.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 47

org/apache/logging/log4j/core/config/xml/XmlConfiguration.java

Violation Priority Line
Useless parentheses. 4 318

org/apache/logging/log4j/core/filter/MapFilter.java

Violation Priority Line
Useless parentheses. 4 90
Useless parentheses. 4 90
Useless parentheses. 4 103
Useless parentheses. 4 103
Useless parentheses. 4 116
Useless parentheses. 4 116

org/apache/logging/log4j/core/filter/ScriptFilter.java

Violation Priority Line
These nested if statements could be combined 3 146149

org/apache/logging/log4j/core/filter/StructuredDataFilter.java

Violation Priority Line
Useless parentheses. 4 84
Useless parentheses. 4 84

org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java

Violation Priority Line
Useless parentheses. 4 109
Useless parentheses. 4 109

org/apache/logging/log4j/core/filter/TimeFilter.java

Violation Priority Line
Avoid unused private fields such as 'HOUR_MS'. 3 49
Avoid unused private fields such as 'MINUTE_MS'. 3 54
Avoid unused private fields such as 'SECOND_MS'. 3 59

org/apache/logging/log4j/core/impl/Log4jContextFactory.java

Violation Priority Line
Useless parentheses. 4 260

org/apache/logging/log4j/core/impl/Log4jLogEvent.java

Violation Priority Line
Avoid empty catch blocks 3 9991001

org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 241
Avoid empty if statements 3 257259

org/apache/logging/log4j/core/impl/ThrowableProxy.java

Violation Priority Line
Avoid empty catch blocks 3 617619
Avoid unused method parameters such as 'stackTraceElement'. 3 647
Avoid empty catch blocks 3 668670

org/apache/logging/log4j/core/jackson/ExtendedStackTraceElementMixIn.java

Violation Priority Line
Avoid unused constructor parameters such as 'declaringClass'. 3 41
Avoid unused constructor parameters such as 'methodName'. 3 42
Avoid unused constructor parameters such as 'fileName'. 3 43
Avoid unused constructor parameters such as 'lineNumber'. 3 44
Avoid unused constructor parameters such as 'exact'. 3 45
Avoid unused constructor parameters such as 'location'. 3 46
Avoid unused constructor parameters such as 'version'. 3 47

org/apache/logging/log4j/core/jackson/Initializers.java

Violation Priority Line
Useless parentheses. 4 56
Useless parentheses. 4 78

org/apache/logging/log4j/core/jackson/InstantMixIn.java

Violation Priority Line
Avoid unused constructor parameters such as 'epochSecond'. 3 39
Avoid unused constructor parameters such as 'nanoOfSecond'. 3 40

org/apache/logging/log4j/core/jackson/Log4jJsonModule.java

Violation Priority Line
Avoid unused private fields such as 'objectMessageAsJsonObject'. 3 37

org/apache/logging/log4j/core/jackson/Log4jStackTraceElementDeserializer.java

Violation Priority Line
Avoid empty if statements 3 7274

org/apache/logging/log4j/core/jackson/MarkerMixIn.java

Violation Priority Line
Avoid unused constructor parameters such as 'name'. 3 61

org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.java

Violation Priority Line
Avoid unused constructor parameters such as 'declaringClass'. 3 37
Avoid unused constructor parameters such as 'methodName'. 3 38
Avoid unused constructor parameters such as 'fileName'. 3 39
Avoid unused constructor parameters such as 'lineNumber'. 3 40

org/apache/logging/log4j/core/jackson/ThrowableProxyMixIn.java

Violation Priority Line
Avoid unused private fields such as 'causeProxy'. 3 34
Avoid unused private fields such as 'commonElementCount'. 3 38
Avoid unused private fields such as 'extendedStackTrace'. 3 43
Avoid unused private fields such as 'localizedMessage'. 3 47
Avoid unused private fields such as 'message'. 3 51
Avoid unused private fields such as 'name'. 3 55
Avoid unused private fields such as 'throwable'. 3 58

org/apache/logging/log4j/core/jackson/ThrowableProxyWithStacktraceAsStringMixIn.java

Violation Priority Line
Avoid unused private fields such as 'causeProxy'. 3 33
Avoid unused private fields such as 'commonElementCount'. 3 37
Avoid unused private fields such as 'extendedStackTrace'. 3 40
Avoid unused private fields such as 'localizedMessage'. 3 44
Avoid unused private fields such as 'message'. 3 48
Avoid unused private fields such as 'name'. 3 52
Avoid unused private fields such as 'throwable'. 3 55

org/apache/logging/log4j/core/jackson/ThrowableProxyWithoutStacktraceMixIn.java

Violation Priority Line
Avoid unused private fields such as 'causeProxy'. 3 33
Avoid unused private fields such as 'commonElementCount'. 3 37
Avoid unused private fields such as 'extendedStackTrace'. 3 40
Avoid unused private fields such as 'localizedMessage'. 3 44
Avoid unused private fields such as 'message'. 3 48
Avoid unused private fields such as 'name'. 3 52
Avoid unused private fields such as 'throwable'. 3 55

org/apache/logging/log4j/core/jmx/Server.java

Violation Priority Line
Avoid unused method parameters such as 'executor'. 3 281
Avoid unused method parameters such as 'executor'. 3 355
Avoid unused method parameters such as 'executor'. 3 372
Useless parentheses. 4 380

org/apache/logging/log4j/core/layout/ByteBufferDestination.java

Violation Priority Line
Avoid unused imports such as 'org.apache.logging.log4j.core.appender.OutputStreamManager' 4 21

org/apache/logging/log4j/core/layout/GelfLayout.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 321
Useless parentheses. 4 388

org/apache/logging/log4j/core/layout/HtmlLayout.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 74100
Avoid empty catch blocks 3 231233

org/apache/logging/log4j/core/layout/LockingStringBuilderEncoder.java

Violation Priority Line
Avoid unused private methods such as 'getCharBuffer()'. 3 48
Avoid unused method parameters such as 'destination'. 3 68

org/apache/logging/log4j/core/layout/Rfc5424Layout.java

Violation Priority Line
Useless parentheses. 4 336
Useless parentheses. 4 360
Useless parentheses. 4 394
Useless parentheses. 4 509

org/apache/logging/log4j/core/layout/ScriptPatternSelector.java

Violation Priority Line
These nested if statements could be combined 3 8386

org/apache/logging/log4j/core/layout/SerializedLayout.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 67

org/apache/logging/log4j/core/layout/StringBuilderEncoder.java

Violation Priority Line
Avoid unused method parameters such as 'destination'. 3 94

org/apache/logging/log4j/core/lookup/JndiLookup.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 55

org/apache/logging/log4j/core/net/MulticastDnsAdvertiser.java

Violation Priority Line
Avoid empty catch blocks 3 9395
Avoid empty catch blocks 3 198200

org/apache/logging/log4j/core/net/SmtpManager.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 233

org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 71

org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java

Violation Priority Line
Useless parentheses. 4 161

org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java

Violation Priority Line
Useless parentheses. 4 149

org/apache/logging/log4j/core/pattern/AnsiEscape.java

Violation Priority Line
Avoid empty catch blocks 3 328330

org/apache/logging/log4j/core/pattern/CachedDateFormat.java

Violation Priority Line
Useless parentheses. 4 211
Useless parentheses. 4 268
Useless parentheses. 4 268
Useless parentheses. 4 268
Useless parentheses. 4 381
Useless parentheses. 4 381

org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java

Violation Priority Line
Avoid unused imports such as 'org.apache.logging.log4j.util.Strings' 4 23

org/apache/logging/log4j/core/pattern/HighlightConverter.java

Violation Priority Line
Useless parentheses. 4 198

org/apache/logging/log4j/core/pattern/HtmlTextRenderer.java

Violation Priority Line
Avoid unused constructor parameters such as 'formats'. 3 24

org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java

Violation Priority Line
Too many static imports may lead to messy code 3 17332

org/apache/logging/log4j/core/pattern/MarkerPatternConverter.java

Violation Priority Line
Avoid unused constructor parameters such as 'options'. 3 37

org/apache/logging/log4j/core/pattern/MarkerSimpleNamePatternConverter.java

Violation Priority Line
Avoid unused constructor parameters such as 'options'. 3 36

org/apache/logging/log4j/core/pattern/NameAbbreviator.java

Violation Priority Line
Useless parentheses. 4 295

org/apache/logging/log4j/core/pattern/NanoTimePatternConverter.java

Violation Priority Line
Avoid unused constructor parameters such as 'options'. 3 37

org/apache/logging/log4j/core/pattern/PatternParser.java

Violation Priority Line
Avoid unused constructor parameters such as 'expectedClass'. 3 128
These nested if statements could be combined 3 186188

org/apache/logging/log4j/core/pattern/StyleConverter.java

Violation Priority Line
Useless parentheses. 4 99

org/apache/logging/log4j/core/pattern/UuidPatternConverter.java

Violation Priority Line
Useless parentheses. 4 53

org/apache/logging/log4j/core/pattern/VariablesNotEmptyReplacementConverter.java

Violation Priority Line
Useless parentheses. 4 86

org/apache/logging/log4j/core/script/ScriptFile.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 9697

org/apache/logging/log4j/core/selector/JndiContextSelector.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 111

org/apache/logging/log4j/core/tools/Generate.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 53166

org/apache/logging/log4j/core/tools/picocli/CommandLine.java

Violation Priority Line
Avoid modifiers which are implied by the context 3 364375
Avoid modifiers which are implied by the context 3 387398
Useless parentheses. 4 1040
Avoid using a branching statement as the last in a loop. 2 1064
Useless parentheses. 4 2092
These nested if statements could be combined 3 2170
Avoid unused method parameters such as 'valueAttachedToOption'. 3 2214
Avoid unused local variables such as 'length'. 3 2219
Ternary operators that can be simplified with || or && 3 2257
Avoid unused method parameters such as 'annotation'. 3 2285
These nested if statements could be combined 3 23192321
Avoid unused method parameters such as 'arity'. 3 2328
Avoid unused local variables such as 'desc'. 3 2358
Avoid unused method parameters such as 'cls'. 3 2368
These nested if statements could be combined 3 24342436
Avoid unused method parameters such as 'arity'. 3 2444
Avoid unused method parameters such as 'originalSize'. 3 2449
These nested if statements could be combined 3 24942496
Useless parentheses. 4 2498
These nested if statements could be combined 3 2542
Useless parentheses. 4 2610
Ternary operators that can be simplified with || or && 3 2970
Ternary operators that can be simplified with || or && 3 2971
Ternary operators that can be simplified with || or && 3 2973
Unnecessary use of fully qualified name 'Help.Column.Overflow.SPAN' due to existing static import 'org.apache.logging.log4j.core.tools.picocli.CommandLine.Help.Column.Overflow.SPAN' 4 3329
Unnecessary use of fully qualified name 'Help.Column.Overflow.WRAP' due to existing static import 'org.apache.logging.log4j.core.tools.picocli.CommandLine.Help.Column.Overflow.WRAP' 4 3330
Useless parentheses. 4 3335
Useless parentheses. 4 3349
Useless parentheses. 4 3704
Avoid unused local variables such as 'o1'. 3 3872
Avoid unused local variables such as 'o2'. 3 3873
Useless parentheses. 4 4279
Useless parentheses. 4 4519
Useless parentheses. 4 4774

org/apache/logging/log4j/core/util/Booleans.java

Violation Priority Line
Useless parentheses. 4 37

org/apache/logging/log4j/core/util/CronExpression.java

Violation Priority Line
Useless parentheses. 4 299
Useless parentheses. 4 299
Useless parentheses. 4 299
These nested if statements could be combined 3 488491
Useless parentheses. 4 510
Useless parentheses. 4 510
Useless parentheses. 4 510
Useless parentheses. 4 510
Useless parentheses. 4 510
Useless parentheses. 4 574
Useless parentheses. 4 580
Useless parentheses. 4 628
Useless parentheses. 4 630
Useless parentheses. 4 632
Useless parentheses. 4 634
Useless parentheses. 4 773
Useless parentheses. 4 943
Useless parentheses. 4 949
Useless parentheses. 4 954
Useless parentheses. 4 955
Useless parentheses. 4 960
Useless parentheses. 4 965
These nested if statements could be combined 3 965969
Useless parentheses. 4 966
Useless parentheses. 4 1118
Unnecessary use of fully qualified name 'java.util.Calendar.getInstance' due to existing import 'java.util.Calendar' 4 1266
Unnecessary use of fully qualified name 'java.util.Calendar' due to existing import 'java.util.Calendar' 4 1266
Unnecessary use of fully qualified name 'java.util.Calendar.getInstance' due to existing import 'java.util.Calendar' 4 1302
Unnecessary use of fully qualified name 'java.util.Calendar' due to existing import 'java.util.Calendar' 4 1302
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 4 1566
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 4 1567
Unnecessary use of fully qualified name 'java.util.Calendar.HOUR_OF_DAY' due to existing import 'java.util.Calendar' 4 1568
Avoid unused local variables such as 'cl'. 3 1573
Useless parentheses. 4 1642
Useless parentheses. 4 1642
Useless parentheses. 4 1651

org/apache/logging/log4j/core/util/FileUtils.java

Violation Priority Line
Useless parentheses. 4 6465
Useless parentheses. 4 65

org/apache/logging/log4j/core/util/IOUtils.java

Violation Priority Line
Avoid unused imports such as 'java.io.InputStream' 4 20
Avoid unused imports such as 'java.io.OutputStream' 4 21

org/apache/logging/log4j/core/util/JsonUtils.java

Violation Priority Line
Useless parentheses. 4 97

org/apache/logging/log4j/core/util/Log4jThreadFactory.java

Violation Priority Line
Avoid using java.lang.ThreadGroup; it is not thread safe 3 81

org/apache/logging/log4j/core/util/StringEncoder.java

Violation Priority Line
Useless parentheses. 4 81
Useless parentheses. 4 81
Useless parentheses. 4 97
Useless parentheses. 4 97
Useless parentheses. 4 98
Useless parentheses. 4 105

org/apache/logging/log4j/core/util/Throwables.java

Violation Priority Line
Avoid empty catch blocks 3 6264

org/apache/logging/log4j/core/util/Transform.java

Violation Priority Line
Useless parentheses. 4 5053
Useless parentheses. 4 127134

org/apache/logging/log4j/core/util/TypeUtil.java

Violation Priority Line
Useless parentheses. 4 219
Useless parentheses. 4 219
Useless parentheses. 4 219

org/apache/logging/log4j/core/util/UuidUtil.java

Violation Priority Line
Useless parentheses. 4 143144
Useless parentheses. 4 143

org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java

Violation Priority Line
Useless parentheses. 4 497
Useless parentheses. 4 500
Useless parentheses. 4 506
Useless parentheses. 4 509
Useless parentheses. 4 515
Useless parentheses. 4 516
Useless parentheses. 4 522
Useless parentheses. 4 526
Useless parentheses. 4 529
Useless parentheses. 4 548