Skip to content

Bump surefire.version from 3.5.0 to 3.5.1 #54

Bump surefire.version from 3.5.0 to 3.5.1

Bump surefire.version from 3.5.0 to 3.5.1 #54

Triggered via pull request October 7, 2024 22:03
Status Success
Total duration 40s
Artifacts 1

pmd.yml

on: pull_request
pmd-code-scan
31s
pmd-code-scan
Fit to window
Zoom out
Zoom in

Annotations

10 errors and 10 warnings
This class has only private constructors and may be final: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/Alarm.java#L5
Reports classes that may be made final because they cannot be extended from outside their compilation unit anyway. This is because all their constructors are private, so a subclass could not call the super constructor. ClassWithOnlyPrivateConstructorsShouldBeFinal (Priority: 1, Ruleset: Design) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_design.html#classwithonlyprivateconstructorsshouldbefinal
This class has only private constructors and may be final: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/AlarmBatch.java#L6
Reports classes that may be made final because they cannot be extended from outside their compilation unit anyway. This is because all their constructors are private, so a subclass could not call the super constructor. ClassWithOnlyPrivateConstructorsShouldBeFinal (Priority: 1, Ruleset: Design) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_design.html#classwithonlyprivateconstructorsshouldbefinal
Logger calls should be surrounded by log level guards.: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/DumpsysAlarmPanel.java#L201
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/DumpsysAlarmPanel.java#L209
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#guardlogstatement
This class has only private constructors and may be final: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/SharedData.java#L3
Reports classes that may be made final because they cannot be extended from outside their compilation unit anyway. This is because all their constructors are private, so a subclass could not call the super constructor. ClassWithOnlyPrivateConstructorsShouldBeFinal (Priority: 1, Ruleset: Design) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_design.html#classwithonlyprivateconstructorsshouldbefinal
Logger calls should be surrounded by log level guards.: src/main/java/edu/jiangxin/apktoolbox/android/i18n/I18nAddPanel.java#L212
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: src/main/java/edu/jiangxin/apktoolbox/android/i18n/I18nFindLongestPanel.java#L137
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: src/main/java/edu/jiangxin/apktoolbox/android/i18n/I18nRemovePanel.java#L143
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: src/main/java/edu/jiangxin/apktoolbox/android/monkey/MonkeyPanel.java#L486
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#guardlogstatement
Logger calls should be surrounded by log level guards.: src/main/java/edu/jiangxin/apktoolbox/android/monkey/MonkeyPanel.java#L515
Whenever using a log level, one should check if it is actually enabled, or otherwise skip the associate String creation and manipulation, as well as any method calls. An alternative to checking the log level are substituting parameters, formatters or lazy logging with lambdas. The available alternatives depend on the actual logging framework. GuardLogStatement (Priority: 2, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#guardlogstatement
Switch statements should be exhaustive, add a default case (or missing enum branches): src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/Alarm.java#L40
Switch statements should be exhaustive, to make their control flow easier to follow. This can be achieved by adding a `default` case, or, if the switch is on an enum type, by ensuring there is one switch branch for each enum constant. SwitchStmtsShouldHaveDefault (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#switchstmtsshouldhavedefault
Document empty method body: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/AlarmTreeTableDataModel.java#L62
Uncommented Empty Method Body finds instances where a method body does not contain statements, but there is no comment. By explicitly commenting empty method bodies it is easier to distinguish between intentional (commented) and unintentional empty methods. UncommentedEmptyMethodBody (Priority: 3, Ruleset: Documentation) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_documentation.html#uncommentedemptymethodbody
The method 'toString()' is missing an @Override annotation.: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/AlarmTreeTableDataNode.java#L52
Annotating overridden methods with @OverRide ensures at compile time that the method really overrides one, which helps refactoring and clarifies intent. MissingOverride (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#missingoverride
Useless parentheses.: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/DumpsysAlarmPanel.java#L255
Parenthesized expressions are used to override the default operator precedence rules. Parentheses whose removal would not change the relative nesting of operators are unnecessary, because they don't change the semantics of the enclosing expression. Some parentheses that strictly speaking are unnecessary, may still be considered useful for readability. This rule allows to ignore violations on two kinds of unnecessary parentheses: - "Clarifying" parentheses, which separate operators of difference precedence. While unnecessary, they make precedence rules explicit, which may be useful for rarely used operators. For example: ```java (a + b) & c // is equivalent to `a + b & c`, but probably clearer ``` Unset the property `ignoreClarifying` to report them. - "Balancing" parentheses, which are unnecessary but visually balance out another pair of parentheses around an equality operator. For example, those two expressions are equivalent: ```java (a == null) != (b == null) a == null != (b == null) ``` The parentheses on the right are required, and the parentheses on the left are just more visually pleasing. Unset the property `ignoreBalancing` to report them. UselessParentheses (Priority: 4, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_codestyle.html#uselessparentheses
An operation on an Immutable object (String, BigDecimal or BigInteger) wont change the object itself: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/DumpsysAlarmPanel.java#L277
An operation on an Immutable object (String, BigDecimal or BigInteger) won't change the object itself since the result of the operation is a new object. Therefore, ignoring the operation result is an error. UselessOperationOnImmutable (Priority: 3, Ruleset: Error Prone) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_errorprone.html#uselessoperationonimmutable
This for loop can be replaced by a foreach loop: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/DumpsysAlarmPanel.java#L280
Reports loops that can be safely replaced with the foreach syntax. The rule considers loops over lists, arrays and iterators. A loop is safe to replace if it only uses the index variable to access an element of the list or array, only has one update statement, and loops through *every* element of the list or array left to right. ForLoopCanBeForeach (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#forloopcanbeforeach
This for loop can be replaced by a foreach loop: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/DumpsysAlarmPanel.java#L286
Reports loops that can be safely replaced with the foreach syntax. The rule considers loops over lists, arrays and iterators. A loop is safe to replace if it only uses the index variable to access an element of the list or array, only has one update statement, and loops through *every* element of the list or array left to right. ForLoopCanBeForeach (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_bestpractices.html#forloopcanbeforeach
Singleton is not thread safe: src/main/java/edu/jiangxin/apktoolbox/android/dumpsys/alarm/SharedData.java#L14
Non-thread safe singletons can result in bad state changes. Eliminate static singletons if possible by instantiating the object directly. Static singletons are usually not needed as only a single instance exists anyway. Other possible fixes are to synchronize the entire method or to use an [initialize-on-demand holder class](https://en.wikipedia.org/wiki/Initialization-on-demand_holder_idiom). Refrain from using the double-checked locking pattern. The Java Memory Model doesn't guarantee it to work unless the variable is declared as `volatile`, adding an uneeded performance penalty. [Reference](http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html) See Effective Java, item 48. NonThreadSafeSingleton (Priority: 3, Ruleset: Multithreading) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_multithreading.html#nonthreadsafesingleton
Useless qualified this usage in the same class.: src/main/java/edu/jiangxin/apktoolbox/android/i18n/I18nAddPanel.java#L103
Reports qualified this usages in the same class. UselessQualifiedThis (Priority: 3, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_codestyle.html#uselessqualifiedthis
Useless qualified this usage in the same class.: src/main/java/edu/jiangxin/apktoolbox/android/i18n/I18nAddPanel.java#L109
Reports qualified this usages in the same class. UselessQualifiedThis (Priority: 3, Ruleset: Code Style) https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java_codestyle.html#uselessqualifiedthis

Artifacts

Produced during runtime
Name Size
PMD Report
18.4 KB