Apache logging services logo Apache log4j logo

PMD Results

The following document contains the results of PMD 5.5.1.

Files

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

Violation Line
Avoid empty catch blocks 407409
Avoid empty catch blocks 452454

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

Violation Line
Useless parentheses. 251

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

Violation Line
Useless parentheses. 346

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

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

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

Violation Line
Useless parentheses. 217
Useless parentheses. 217
Useless parentheses. 217

org/apache/logging/log4j/core/appender/db/jpa/converter/StackTraceElementAttributeConverter.java

Violation Line
Avoid empty catch blocks 7173

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

Violation Line
Ternary operators that can be simplified with || or && 126

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

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

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

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

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

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

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

Violation Line
Useless parentheses. 105
Useless parentheses. 107

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

Violation Line
These nested if statements could be combined 113116

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

Violation Line
Useless parentheses. 197

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

Violation Line
Useless parentheses. 218
These nested if statements could be combined 309311
These nested if statements could be combined 320322

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

Violation Line
Overriding method merely calls super 5658

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

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

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

Violation Line
Overriding method merely calls super 161163

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

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

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

Violation Line
Avoid importing anything from the package java.lang 19
Avoid importing anything from the package java.lang 20
Avoid importing anything from the package java.lang 21
Avoid empty catch blocks 4345

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

Violation Line
Avoid empty if statements 100102

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

Violation Line
Useless parentheses. 321

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

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

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

Violation Line
These nested if statements could be combined 145148

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

Violation Line
Useless parentheses. 84
Useless parentheses. 84

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

Violation Line
Useless parentheses. 109
Useless parentheses. 109

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

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

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

Violation Line
Avoid importing anything from the package java.lang 19
Avoid importing anything from the package java.lang 20
Avoid importing anything from the package java.lang 21

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

Violation Line
Useless parentheses. 259

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

Violation Line
Avoid empty catch blocks 955956

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

Violation Line
Avoid empty if statements 257259

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

Violation Line
Avoid empty catch blocks 577579
Avoid unused method parameters such as 'stackTraceElement'. 607
Avoid empty catch blocks 628630

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

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

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

Violation Line
Avoid empty if statements 7274

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

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

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

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

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

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

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

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

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

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

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

Violation Line
Avoid unused method parameters such as 'executor'. 279
Avoid unused method parameters such as 'executor'. 351
Avoid unused method parameters such as 'executor'. 368

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

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

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

Violation Line
Avoid empty catch blocks 231233

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

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

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

Violation Line
Useless parentheses. 336
Useless parentheses. 360
Useless parentheses. 509

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

Violation Line
These nested if statements could be combined 8386

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

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

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

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

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

Violation Line
Avoid empty catch blocks 328330

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

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

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

Violation Line
Useless parentheses. 198

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

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

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

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

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

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

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

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

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

Violation Line
Useless parentheses. 295

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

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

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

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

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

Violation Line
Useless parentheses. 99

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

Violation Line
Useless parentheses. 53

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

Violation Line
Useless parentheses. 86

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

Violation Line
Useless parentheses. 581
An empty statement (semicolon) not part of a loop 1519
Avoid unused local variables such as 'length'. 1626
Ternary operators that can be simplified with || or && 1658
Avoid unused local variables such as 'i'. 1739
These nested if statements could be combined 17451747
These nested if statements could be combined 18041806
Useless parentheses. 1808
Avoid empty catch blocks 20442046
Ternary operators that can be simplified with || or && 2253
Ternary operators that can be simplified with || or && 2254
Ternary operators that can be simplified with || or && 2256
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' 2585
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' 2586
Useless parentheses. 2591
Useless parentheses. 2605
Avoid unused local variables such as 'o1'. 3070
Avoid unused local variables such as 'o2'. 3071
Avoid empty catch blocks 3512
Avoid empty catch blocks 3513
Avoid empty catch blocks 3524
Avoid empty catch blocks 3525

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

Violation Line
Useless parentheses. 37

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

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

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

Violation Line
Useless parentheses. 6465
Useless parentheses. 65

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

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

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

Violation Line
Useless parentheses. 97

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

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

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

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

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

Violation Line
Avoid empty catch blocks 6264

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

Violation Line
Useless parentheses. 5053
Useless parentheses. 127134

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

Violation Line
Useless parentheses. 219
Useless parentheses. 219
Useless parentheses. 219

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

Violation Line
Useless parentheses. 143
Useless parentheses. 143144
Avoid empty catch blocks 183185